Skip to content

Commit 7325bf3

Browse files
authored
[BOJ] 13699 점화식 (S4)
1 parent 2a0ef72 commit 7325bf3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

정건우/9주차/260227.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//https://www.acmicpc.net/problem/13699
2+
import java.util.Scanner;
3+
4+
public class BOJ_S4_13699_점화식 {
5+
6+
public static void main(String[] args) {
7+
Scanner scann = new Scanner(System.in);
8+
9+
int N = scann.nextInt();
10+
long [] dp = new long[N+1];
11+
12+
dp[0] = 1;
13+
14+
for (int i = 1; i <= N; i++) {
15+
for (int j = 0; j < i; j++) {
16+
dp[i] += dp[j] * dp[i-j-1];
17+
}
18+
}
19+
20+
System.out.println(dp[N]);
21+
22+
}
23+
24+
}

0 commit comments

Comments
 (0)