본문 바로가기

알고리즘 & 자료구조569

백준 1271 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.StringTokenizer; public class Main1271 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); BigInteger n = new BigIntege.. 2021. 9. 21.
백준 2309 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main2309 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = 9; int[] A = new int[N]; int sum = 0; for(int i=0; i 2021. 9. 16.
백준 17404 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main17404 { 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]; int[][] A = new int[N+1][3]; for(i.. 2021. 9. 15.
백준 1309 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1309_2 { 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[] S = new int[N+1]; final int mod = 9901; //점화식 (1차원 다이나믹으로) //S.. 2021. 9. 13.
백준 2133 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main2133 { 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[0] = 1; //점화식 //3 x N 타일링 문제는 경우의수가 아주 많다. //세로의 길이가 2를 차지하는 경우의 수는 3개 //세로의 길이가 .. 2021. 9. 13.
백준 13398 package Algorithm1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main13398 { 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]; //수열 A StringTokeni.. 2021. 9. 9.