PS/boj
-
boj)9465 - 스티커PS/boj 2020. 9. 19. 14:25
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class boj_9465 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st, st2; static int[][] dp; static int[][] val; static int t; public static void main(String[] args) throws IOException { t = Integer.parseInt(..
-
boj)11057 - 오르막수PS/boj 2020. 9. 19. 03:16
import java.io.*; public class boj_11057 { static int[][] dp; static final int mod = 10007; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); dp = new int[n+1][10]; for (int i = 0; i
-
boj)1309 - 동물원PS/boj 2020. 9. 19. 02:26
import java.io.*; public class boj_1309 { static int[][] dp; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static final int mod = 9901; public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); dp = new int[n+1][3]; dp[0][2] = 1; for (int i = 1; i n개의 세로 중 x번째에 사자가 있는 경우 => dp[n-1][x가 아닌수]의 합 - 초기에 전부 사자가 없는 경우도 1가지의 방..
-
boj)1149 - RGB 거리PS/boj 2020. 9. 19. 01:41
import java.io.*; import java.util.StringTokenizer; public class boj_1149 { static int[][] dp; static int[][] val; // 페인트 가격 static StringTokenizer st; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); dp = new int[n][3]; val = new int[n][3]; for (int i = 0; i < n; ..
-
boj)2225 - 합분해PS/boj 2020. 9. 18. 17:19
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class boj_2225 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static long[][] dp; static StringTokenizer st; static final long mod = 1000000000L; public static void main(String[] args) throws IOException { st = new StringTokeniz..
-
boj)1699 - 제곱수PS/boj 2020. 9. 18. 16:11
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class boj_1699 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static long[] dp; public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); dp = new long[n+1]; for (int i = 1; i 변수로 생각 i - 그렇다면 나머지는 n-i^2 이고 dp[n] = dp[n-..
-
boj)1912 - 연속합PS/boj 2020. 9. 18. 01:47
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class boj_1912{ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int[] a; static int[] dp; public static void main(String[] args) throws IOException { int n = Integer.parseI..
-
boj)14002 - 가장 긴 증가하는 부분 수열 4PS/boj 2020. 9. 18. 00:53
import java.util.Scanner; public class boj_14002 { static int[] arr; static int[] dp; static int[] v; // 출력 함수 static void print(int p) { if (p == 0) return; print(v[p]); System.out.print(arr[p] + " "); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); arr = new int[n+1]; for (int i = 1; i