From 14b4fc2f2f0778213f74ff7a6f392f63b1e55f98 Mon Sep 17 00:00:00 2001 From: zinnnn37 Date: Sun, 5 Oct 2025 15:45:01 +0900 Subject: [PATCH] =?UTF-8?q?[20251005]=20BOJ=20/=20G4=20/=20=ED=83=80?= =?UTF-8?q?=EC=9D=BC=20=EC=B1=84=EC=9A=B0=EA=B8=B0=20/=20=EA=B9=80?= =?UTF-8?q?=EB=AF=BC=EC=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 \354\261\204\354\232\260\352\270\260.md" | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 "zinnnn37/202510/5 BOJ G4 \355\203\200\354\235\274 \354\261\204\354\232\260\352\270\260.md" diff --git "a/zinnnn37/202510/5 BOJ G4 \355\203\200\354\235\274 \354\261\204\354\232\260\352\270\260.md" "b/zinnnn37/202510/5 BOJ G4 \355\203\200\354\235\274 \354\261\204\354\232\260\352\270\260.md" new file mode 100644 index 00000000..652f3a1a --- /dev/null +++ "b/zinnnn37/202510/5 BOJ G4 \355\203\200\354\235\274 \354\261\204\354\232\260\352\270\260.md" @@ -0,0 +1,38 @@ +```java +import java.io.*; + +public class BJ_2133_타일_채우기 { + + private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + private static final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + + private static int N; + private static int[] dp; + + public static void main(String[] args) throws IOException { + init(); + sol(); + } + + private static void init() throws IOException { + N = Integer.parseInt(br.readLine()); + dp = new int[N + 1]; + + if (N <= 1) return; + + dp[0] = 1; + dp[2] = 3; + } + + private static void sol() throws IOException { + for (int i = 4; i <= N; i += 2) { + dp[i] = dp[i - 2] * 4 - dp[i - 4]; + } + bw.write(dp[N] + "\n"); + bw.flush(); + bw.close(); + br.close(); + } + +} +``` \ No newline at end of file