We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a0ef72 commit 7325bf3Copy full SHA for 7325bf3
1 file changed
정건우/9주차/260227.java
@@ -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