![백준_2098 외판워 순회 (DP - TPS)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FszVYc%2FbtsHeft5wD5%2FmPdNKPHHRXKh49lM8kUPjK%2Fimg.png)
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.StringTokenizer;public class BJ_2098_외판원순회 { static int n; static int[][] w; static int[][] d; static int INF = 16*1000000 + 1; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ..
![백준_11049 행렬 곱셈 순서 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FGWi6n%2FbtsGZnty0jN%2FzkKK3XwAaEDy7NbbrXcjF0%2Fimg.png)
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.StringTokenizer;public class BJ_11049_행렬곱셈순서 { static int[][] matrix; static long[][] d; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); ..
![백준_2342 Dance Dance Revolution (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F28c3S%2FbtsGS6EzHjU%2Fd723Y0qM314VKmLwwWTdNK%2Fimg.png)
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.StringTokenizer;public class BJ_2342_DanceDanceRevolution { static int MAX = 10000000; public static void main(String[] args) throws IOException { int[][] m = {{1, 2, 2, 2, 2}, {0, 1, 3, 4, 3}, {0, 3, 1, 3, 4}, ..
![백준_1328 고층 빌딩 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FH8BcE%2FbtsGOvYzylt%2FldpXUubGpwml8eyRbgk2dk%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1328_고층빌딩 { static long MOD = 1000000007; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int n = Integer.p..
![백준_1915 가장 큰 정사각형 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbEDlAP%2FbtsGMfJLeKf%2FwjEUZZQHHBpqDOv8yyeKQK%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1915_가장큰정사각형 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int n = Integer.parseInt(st.nextToken()); in..
![백준_9252 LCS 2 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fliuaj%2FbtsGL2KxOmr%2FA0WLuSVT8FQkQTNreTPegk%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_9252_LCS2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s1 = br.readLine(); String s2 = br.readLine(); int[][] d = new int[s1.length() + 1][s2.length() + 1]; int i, j; for (i = 1; i < s1.lengt..
![백준_13398 연속합 2 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbgC5Td%2FbtsGIf3d1hF%2FFygOcCbHq1JZMuauXx9yzk%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_13398_연속합2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] a = new int[n]; int[] l = new int[n]; int[] r = new int[n]; i..
![백준_10844 쉬운 계단 수 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdKN9IJ%2FbtsGHsUWSAx%2FEbTOYVAJCeyOgSIBZWHQF0%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_10844_쉬운계단수 { static long M = 1000000000; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[][] d = new long[n+1][10]; int i, j; for (i=1; i
![백준_11726 2xn 타일링 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FAhVPe%2FbtsGFCpIJyo%2FVk9JKzLxuCbbyz8EyyL9dk%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_11726_2xN타일링 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] d = new int[n+2]; d[1] = 1; d[2] = 2; for (int i=3; i
![백준_2193 이친수 (DP)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdSmmIY%2FbtsGB2COJEQ%2FN0Bsy5n7o5hcowdfxkSDgk%2Fimg.png)
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_2193_이친수 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[][] d = new long[n+1][2]; //d[i][0] : i번째의 0의 개수, d[i][1] : i번째의 1의 개수 d[1][0] = 0; d[1][1] = 1; f..