From dd26705fcd56b16f935fc851a3f5a702b21dcad8 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Sun, 26 Oct 2025 23:58:19 +0900 Subject: [PATCH] =?UTF-8?q?[20251026]=20PGM=20/=20LV2=20/=20=EB=A9=80?= =?UTF-8?q?=EB=A6=AC=20=EB=9B=B0=EA=B8=B0=20/=20=EC=9D=B4=EC=9D=B8?= =?UTF-8?q?=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\353\246\254 \353\233\260\352\270\260.md" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "LiiNi-coder/202510/26 PGM \353\251\200\353\246\254 \353\233\260\352\270\260.md" diff --git "a/LiiNi-coder/202510/26 PGM \353\251\200\353\246\254 \353\233\260\352\270\260.md" "b/LiiNi-coder/202510/26 PGM \353\251\200\353\246\254 \353\233\260\352\270\260.md" new file mode 100644 index 00000000..3dc878cf --- /dev/null +++ "b/LiiNi-coder/202510/26 PGM \353\251\200\353\246\254 \353\233\260\352\270\260.md" @@ -0,0 +1,19 @@ +```java +class Solution { + private static long[] dp; + public long solution(int n) { + dp = new long[n + 1]; + dp[1] = 1; + if (n >= 2) + dp[2] = 2; + return getDp(n); + } + + private long getDp(int n) { + if (dp[n] != 0) return dp[n]; + dp[n] = (getDp(n - 1) + getDp(n - 2)) % 1234567; + return dp[n]; + } +} + +```