본문 바로가기

알고리즘 & 자료구조569

백준 11568 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main11568 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int[] card = new int[N]; int[] D = new int[N]; StringTokenizer st = new.. 2022. 1. 20.
백준 10571 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main10571 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); StringTokenizer st; //D[i] = D[i]를 마지막으로 하고, 중량이 높아지면서, 선명도 값이 낮아지는 부분수.. 2022. 1. 19.
백준 9764 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main9764 { public static final int MOD = 100999; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[][] D = new int[2001][2001]; //D[i][j] = 1~j 사이의 수들의 합으로 i를 만드는 방법의 수 //1. j를 포함하지 않고 i를 만드는 경우 // D[i][j.. 2022. 1. 18.
백준 9711 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main9711 { public static long[] D = new long[10001]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); D[0] = 0; D[1] = 1; D[2] = 1; .. 2022. 1. 17.
백준 4883 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main4883 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc = 0; while(true) { int N = Integer.parseInt(br.readLine()); if(N == 0) { break; } tc++; int[][] D = new in.. 2022. 1. 16.
백준 2780 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main2780 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //D[i][x] = i길이 마지막 사용된 수가 x인 비밀번호 갯수 //D[i-1][x] = i-1 길이의 마지막 사용된수가 x인 비밀번호 갯수 //D[i][x] = D[i-1][x1] + D[i-1][x2] + ... (x1~xn: 인접하는 수의 개수) int[.. 2022. 1. 15.