본문 바로가기

알고리즘 & 자료구조569

백준 11055 package Algorithm1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main11055 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); //수열의 길이 N int[] A = new int[N]; //수열 int[] D = new .. 2021. 9. 9.
백준 1932 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main1932 { 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][N+1]; int[][] A = new int[N+1][N+1]; for(int i=1.. 2021. 9. 8.
백준 2156 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main2156 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); //포도잔의 개수 N int[] D = new int[N+1]; int[] A = new int[N+1]; //포도주의 양 for(int i=1; i= 1){ //잔이 1개일 경우 D[1] =.. 2021. 9. 8.
백준 9465 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main9465 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); //테스트 케이스 T int[][] D; int[][] A; int[] ans = new int[T]; for(int t = 0; t 2021. 9. 8.
백준 11057 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main11057 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); //수의 길이 N long[][] D = new long[N+1][10]; final int MOD = 10_007; for(int i=0; i 2021. 9. 8.
백준 1309 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1309 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); //세로의 길이 : N int[][] D = new int[N+1][3]; final int mod = 9901; //점화식 //D[N][0] = N번 줄에 배치하지 않음 //D[N][1] =.. 2021. 9. 7.