일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 코딩테스트
- 버블정렬
- 선택정렬
- DP
- java
- 수학
- 백트래킹
- 병합정렬
- 정수론
- 자료구조
- 기수정렬
- SNS
- 삽입정렬
- 프로그래밍언어
- 선택알고리즘
- 재귀
- 알고리즘
- 안드로이드
- C++
- 퀵정렬
- 계수정렬
- 동적계획법
- 프로그래밍
- 힙정렬
- 백준
- 동적프로그래밍
- Median of Medians
- 자바
- 다이나믹프로그래밍
- 정렬
- Today
- Total
목록전체 글 (54)
MODE::CREATIVE
https://www.acmicpc.net/problem/9095문제 해석dp를 이용한 경우의 수 찾기알고리즘 분류dp풀이점화식 (dp[i] = dp[i-1] + dp[i-2] + dp[i-3]) 이용해 dp배열을 채운다코드#include #include using namespace std;int dp[12];int main() { int n; dp[1] = 1; dp[2] = 2; dp[3] = 4; for(int i = 4; i > t; for (int i = 0; i > n; cout
https://www.acmicpc.net/problem/9375문제 해석map 자료구조를 이용하여 옷을 입는 경우의 수 구하기알고리즘 분류수학해시맵조합론풀이map을 이용해 (카테고리:해당 카테고리의 옷 개수)를 입력계산식(sum *= it->second + 1;)을 이용해 경우의 수 출력코드#include #include #include using namespace std;static map mp;void solution() { int n; cin >> n; for (int i = 0; i > clothes >> catg; if (mp.find(catg) == mp.end()) { mp[catg] = 1; } else { mp[catg]++; } ..
https://www.acmicpc.net/problem/9461문제 해석파도반 수열의 점화식을 보고 dp(동적 프로그래밍)으로 풀기알고리즘 분류dp풀이그림을 보면 삼각형의 변의 길이가 늘어나는 규칙을 알 수 있음이를 점화식으로 세우고 값을 한번에 계산하면 됨dp[i] = dp[i - 2] + dp[i - 3];코드#include #include #include using namespace std;long long dp[101];void solution() { int n; cin >> n; for(int i = 4; i > t; for (int i = 0; i
11478번: 서로 다른 부분 문자열의 개수 (acmicpc.net)문제 해석set을 이용한 서로다른 부분 문자열 개수 세기알고리즘 분류자료구조문자열풀이set의 개념을 이용하여 unique한 문자열의 개수 세기코드#include #include #include using namespace std;static set words;static string str;void find_words(int sub_len) { for(int i = 0; i > str; int len = str.length(); // 문자열 길이 for(int i = 1; i
https://www.acmicpc.net/problem/11659 문제 해석누적합을 이용한 구간합 구하기알고리즘 분류누적합풀이누적합을 미리 계산해 두고 여러개의 구간합을 O(1)로 출력한다sum[j] - sum[i-1]코드#include using namespace std;int main(){ int N = 1; int M; int ii, j; cin >> N >> M; int arr[N+1]; int sum[N+1]; for (int i=1; i> arr[i]; } sum[1] = arr[1]; for (int i=2; i> ii >> j; cout
https://www.acmicpc.net/problem/11727문제 해석dp(다이나믹 프로그래밍)을 이용하여 2xn의 타일을 채울수 있는 경우의 수 구하기알고리즘 분류다이나믹 프로그래밍풀이 arr[i] = (arr[i-1] + arr[i-2]*2) 라는 규칙을 찾아내 dp배열 채우기코드#include using namespace std;int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; int arr[1001]; arr[1] = 1; arr[2] = 3; cin >> n; for(int i = 3; i