다이나믹 프로그래밍 3

백준[JAVA] 11726.2×n 타일링 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer[] dp = new Integer[10008]; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { dp[0] = 0; dp[1] = 1; dp[2] = 2; dp[3] = 3; // dp[n] = dp[n-1] + dp[n-2] int N = Integer.par..

백준[JAVA] 9095.1, 2, 3 더하기 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer[] dp = new Integer[11]; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { StringBuilder sb = new StringBuilder(); dp[0] = 0; dp[1] = 1; dp[2] = 2; dp[3] = 4; // dp[4] = ..

백준[JAVA] 1463.1로 만들기 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer[] dp; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int X = Integer.parseInt(br.readLine()); dp = new Integer[X + 1]; dp[0] = dp[1] = 0; System.out.println(recur(X)); } pri..