Skip to content

Commit 790ec5f

Browse files
committed
[BOJ] 다리 놓기 / 실버 5 / 40분
https://www.acmicpc.net/problem/1010
1 parent 70b2be2 commit 790ec5f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
T = int(input())
2+
dp = [[0] * 30 for _ in range(30)]
3+
for i in range(30):
4+
for j in range(30):
5+
if i == 1:
6+
dp[i][j] = j
7+
else:
8+
if i == j:
9+
dp[i][j] = 1
10+
elif i < j:
11+
dp[i][j] = dp[i-1][j-1] + dp[i][j-1]
12+
13+
for _ in range(T):
14+
N, M = list(map(int, input().split()))
15+
print (dp[N][M])

0 commit comments

Comments
 (0)