목록Algorithm/Algorithm 문제 (96)
녕의 학습 기록

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)); ..

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()); ..

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}, ..

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..

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..

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..