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.
2 parents b872e5d + f0d8c19 commit a5d71c2Copy full SHA for a5d71c2
lkhyun/202508/03 BOJ G4 타일 채우기.md
@@ -0,0 +1,30 @@
1
+```java
2
+import java.util.*;
3
+import java.io.*;
4
+
5
+public class Main {
6
+ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7
+ static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
8
+ static StringTokenizer st;
9
+ static int N;
10
+ static int[] dp;
11
12
+ public static void main(String[] args) throws Exception {
13
+ int N = Integer.parseInt(br.readLine());
14
+ if(N%2 == 1){
15
+ bw.write("0");
16
+ bw.close();
17
+ return;
18
+ }
19
20
+ dp = new int[N+1];
21
+ dp[0] = 1;
22
+ dp[2] = 3;
23
+ for (int i = 4; i <= N; i++) {
24
+ dp[i] = 4*dp[i-2] - dp[i-4];
25
26
+ bw.write(dp[N]+"");
27
28
29
+}
30
+```
0 commit comments