From 883d31d5be4d191ffbf722abf3d791caf9894474 Mon Sep 17 00:00:00 2001 From: IAM <83930018+syslians@users.noreply.github.com> Date: Sun, 17 Aug 2025 21:37:10 +0900 Subject: [PATCH] =?UTF-8?q?Create=20=EB=B0=B1=EC=A4=809095.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 점화식 기반 DP --- .../\353\260\261\354\244\2009095.java" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "KHJ_Root/\353\260\261\354\244\200\353\254\270\354\240\234/\353\260\261\354\244\2009095.java" diff --git "a/KHJ_Root/\353\260\261\354\244\200\353\254\270\354\240\234/\353\260\261\354\244\2009095.java" "b/KHJ_Root/\353\260\261\354\244\200\353\254\270\354\240\234/\353\260\261\354\244\2009095.java" new file mode 100644 index 0000000..033a93b --- /dev/null +++ "b/KHJ_Root/\353\260\261\354\244\200\353\254\270\354\240\234/\353\260\261\354\244\2009095.java" @@ -0,0 +1,22 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + int t = sc.nextInt(); + int[] dp = bew int[12]; + dp[1] = 1; + dp[2] = 2; + dp[3] = 4; + + for (inr i = 4; i <= 11; i++) { + dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]; + } + + for (int i = 0; i < t; i++) { + int n = sc.nextInt(); + System.out.println(dp[n]); + } + } +}