PS
-
boj)11055 - 가장 큰 증가 부분 수열PS/boj 2020. 9. 19. 20:34
import java.io.*; import java.util.StringTokenizer; public class boj_11055 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int[] dp; static int[] val; static int n, ans; public static void main(String[] args) throws IOException { n = Integer.parseInt(br.readLine()); dp = new int[n+1]; val = new int[n+1]; st = new StringTokenize..
-
boj)1932 - 정수 삼각형PS/boj 2020. 9. 19. 17:08
import java.io.*; import java.util.StringTokenizer; public class boj_1932 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static long[][] dp; static int[][] val; // 0 ~ 9999 static int n; // 1 ~ 500 public static void main(String[] args) throws IOException { n = Integer.parseInt(br.readLine()); dp = new long[n+1][n+1]; val = new int[n..
-
boj)2156 - 포도주 시식PS/boj 2020. 9. 19. 16:25
import java.io.*; import java.util.StringTokenizer; public class boj_2156 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static long[] dp; static int[] val; static int n; public static void main(String[] args) throws IOException { n = Integer.parseInt(br.readLine()); dp = new long[n+1]; val = new int[n+1]; for (int i = 1; i = 2) { dp[2] = val[1] + val[2]; } fo..
-
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..