We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4bf701 commit 9022da3Copy full SHA for 9022da3
JHLEE325/202510/20 BOJ G5 Ezreal 여눈부터 가네 ㅈㅈ.md
@@ -0,0 +1,30 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main {
6
7
+ static final int MOD = 1000000007;
8
9
+ public static void main(String[] args) throws IOException {
10
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
11
+ StringTokenizer st;
12
13
+ int N = Integer.parseInt(br.readLine());
14
15
+ long[][] dp = new long[N + 1][3];
16
17
+ dp[1][1] = 1;
18
+ dp[1][2] = 1;
19
20
+ for (int i = 2; i <= N; i++) {
21
+ dp[i][0] = (dp[i-1][1] + dp[i-1][2]) % MOD;
22
+ dp[i][1] = (dp[i-1][0] + dp[i-1][2]) % MOD;
23
+ dp[i][2] = (dp[i-1][0] + dp[i-1][1]) % MOD;
24
+ }
25
26
+ System.out.println(dp[N-1][1]);
27
28
+}
29
30
+```
0 commit comments