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..
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..
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
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
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..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_14501_퇴사 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] t = new int[n + 1]; int[] p = new int[n + 1]; int[] result = ne..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_1463_1로만들기 { 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+1]; d[1] = 0; for (int i=2; i
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BJ_1947_선물전달 { static long t = 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+2]; //n=1 또는 2일 경우 아래 두줄에서 인덱스 에러. 따라서 n+2를 해줌 d[1] ..
거의 4시간 들여다본 문제.. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1256_사전 { public static void main(String[] args) throws IOException { StringBuilder result = new StringBuilder(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLi..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ_1722_순열의순서 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); boolean[] visited = new boolean[21]; //방문 배열 초기화 long[] f = new lon..