본문 바로가기

알고리즘 & 자료구조569

백준 11727 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main11727 { public static int[] tile; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); tile = new int[n+1]; //메모리제이션 System.out.println(tiling(n)); } //Top-down 방식 (재.. 2021. 8. 21.
백준 11726 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main11726 { public static int[] tile; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); tile = new int[n+1]; //메모리제이션 System.out.println(tiling(n)); } //Top-down 방식 (재.. 2021. 8. 21.
백준 1463 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1463 { public static int[] d; //연산 횟수를 담을 메모리제이션 public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); d = new int[N+1]; System.out.println(go(N)); br.close(); } //Top.. 2021. 8. 20.
백준 17103 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main17103 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); //에라토스네스의 체로 소수 판별 boolean[] check= new boolean[1000001]; //지워졌으면 true int n = 1000000; //100까지 소수 for(int.. 2021. 8. 19.
백준 1373 import java.io.*; public class Main1373 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int len = s.length(); int num; if(len % 3 == 1) s="00"+s; else if(len % 3 == 2) s="0"+s; for(int i=0; i 2021. 8. 18.
백준 17087 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main17087 { 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()); //동생의 수 N int.. 2021. 8. 17.