PS/boj
-
boj)11053 - 가장 긴 증가하는 부분 수열PS/boj 2020. 9. 17. 21:38
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class boj_11053 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); int[] arr = new int[n+1]; int[] dp = new int[n+1]; StringTokeniz..
-
boj)2193 - 이친수PS/boj 2020. 9. 17. 15:53
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; // # 이친수 public class boj_2193 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static long[][] dp = new long[91][2]; public static void main(String[] args) throws Exception { dp[1][1] = 1; for (int i = 2; i
-
boj)10844 - 쉬운 계단 수PS/boj 2020. 9. 17. 15:04
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; // # 쉬운 계단 수 public class boj_10844 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static final long mod = 1000000000L; static long[][] dp = new lon..
-
boj)15590 - 1, 2, 3 더하기 5PS/boj 2020. 9. 17. 14:13
import java.util.*; public class boj_15990 { static final long mod = 1000000009L; static final int limit = 100000; static long[][] d = new long[limit+1][4]; public static void main(String args[]) { Scanner sc = new Scanner(System.in); for (int i=1; i= 0) { d[i][1] = d[i-1][2] + d[i-1][3]; if (i == 1) { d[i][1] = 1; } } if (i-2 >= 0) { d[i][2] = d[i-2][1] + d[i-2][3]; if (i == 2) { d[i][2] = 1; }..
-
boj)16194 - 카드 구매하기 2PS/boj 2020. 9. 17. 13:02
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; // # 카드 구매하기 2 public class boj_16194 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws Exception { int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()..
-
boj)11052 - 카드 구매하기PS/boj 2020. 9. 17. 12:35
import java.io.*; // # 카드 구매하기 public class boj_11052 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws Exception { int n = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int[] p = new int[n+1]; int[] dp = new int[n+1]; for (int i = 1; i
-
boj)9095 - 1, 2, 3 더하기PS/boj 2020. 9. 16. 18:56
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; // # 1, 2, 3 더하기 public class boj_9095 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int[] dp = new int[11]; public static void main(String[] args) throws IOException { int t = Integer.parseInt(br.readLine()); dp[1] = 1; dp[2] = 2; dp[3] = 4; for (int i = 4; i ..
-
boj)11727 - 2xn 타일링 2PS/boj 2020. 9. 16. 18:24
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; // # 2xn 타일링 2 public class boj_11727 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int[] dp = new int[1001]; public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); dp[1] = 1; dp[2] = 3; for (int i = 3; i