| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
- 문제풀이
- 코테
- Java
- BOJ
- MySQL
- dfs
- 건강
- COS PRO
- 운동기록
- SQL
- 문제해결
- SWEA
- 문자열
- 알고리즘
- 시뮬레이션
- 러닝일지
- oracle
- BFS
- math
- 이분탐색
- 투포인터
- 백준
- binary search
- DP
- 코딩테스트
- priorityqueue
- 프로그래머스
- db
- greedy
- 자바
- Today
- Total
목록DP (38)
슈콩
[문제]https://www.acmicpc.net/problem/17070 [소스 코드]import java.io.*;import java.util.*;public class Main { static int HOR = 0, VERT = 1, DIAG = 2; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int n = Integer.parseInt(br.readLine()); int[][] map = new int[n][n]; for(int i=0;i=0 && map..
[문제]https://www.acmicpc.net/problem/7570 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int n = Integer.parseInt(br.readLine()); int[] dp = new int[n+1]; st = new StringTokenizer(br.readLine()); int m..
[문제]https://www.acmicpc.net/problem/12865 [소스 코드]import java.io.*;import java.util.*;public class Main { 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()); int k = Integer.parseInt(st.nextToken());..
재배열 부등식: 큰 값에 큰 값을 곱하면 결과가 최대, 작은 값을 곱하면 결과가 최소 [문제]https://www.acmicpc.net/problem/1026 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int n = Integer.parseInt(br.readLine()); int[] a = new int[n]; int[..
주의: 가장 많은 회의를 하게 되는 갯수를 정하는 경우 가장 오래 회의를 정하는 경우: dp[i] = max(dp[i-1],dp[j] + (end[i]-start[i])) : j는 i 회의와 겹치지 않는 바로 앞 회의를 하는 경우 [문제]https://www.acmicpc.net/problem/1931 [소스 코드]import java.io.*;import java.util.*;public class Main { static class Meeting{ int start, end; Meeting(int start,int end){ this.start = start; this.end = end; } } public static void main(String[] args) throws IO..
[문제]https://www.acmicpc.net/problem/11047 [소스 코드]import java.io.*;import java.util.*;public class Main { 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()); int k = Integer.parseInt(st.nextToken())..
[문제]https://www.acmicpc.net/problem/9657 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] dp = new int[1001]; dp[1] = 1; dp[2] = 0; dp[3] = 1; dp[4] = 1; for(int i=5;i
[문제]https://www.acmicpc.net/problem/9655 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); System.out.println(n%2==1 ? "SK" : "CY"); }}
[문제]https://www.acmicpc.net/problem/9465 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int T = Integer.parseInt(br.readLine()); while(T-->0) { int n = Integer.parseInt(br.readLine()); int[][] stick..
[문제]https://www.acmicpc.net/problem/9461 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); while(T-->0) { int n = Integer.parseInt(br.readLine()); long[] dp = new long[n+1]; if(n=..