Algorithm(218)
-
[BOJ] 10844번 : 쉬운 계단 수
1. problem : https://www.acmicpc.net/problem/10844 2. solution 1 :#include using namespace std;int n; int d[105][10]; const int mod = 1000000000;int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i 0) d[i][j] = (d[i][j] + d[i - 1][j - 1]) % mod; if (j 3. solution 2 :// Authored by : tongnamuu// Co-authored by : BaaaaaaaaaaarkingDog// http://boj.kr/03ae0f4b94fb..
2024.09.03 -
[BOJ] 14501번 : 퇴사
1. problem : https://www.acmicpc.net/problem/14501 2. solution 1 :#include using namespace std;int n;int t[20]; int p[20];int d[20];int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i > t[i] >> p[i]; for (int i = n; i >= 1; i--) { if (t[i] + i source code 출처 : https://github.com/encrypted-def/basic-algo-lecture/blob/master/0x10/solutions/14501.cpp basic-algo-lectu..
2024.09.02 -
[BOJ] 9461번 : 파도반 수열
1. problem : https://www.acmicpc.net/problem/9461 2. solution 1 :#include using namespace std;int t; long long d[105];int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> t; d[1] = 1, d[2] = 1, d[3] = 1; for (int i = 4; i > n; cout
2024.09.02 -
[BOJ] 11053번 : 가장 긴 증가하는 부분 수열
1. problem : https://www.acmicpc.net/problem/11053 2. solution 1 :#include using namespace std;int n; int nums[1005]; int d[1005]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i > nums[i]; d[i] = 1; } for (int i = 2; i nums[j]) d[i] = max(d[i], d[j] + 1); } } cout
2024.09.02 -
[BOJ] 11055번 : 가장 큰 증가하는 부분 수열
1. problem : #include using namespace std;int n; int nums[1005]; int d[1005]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i > nums[i]; d[i] = nums[i]; } for (int i = 2; i nums[j]) d[i] = max(d[i], d[j] + nums[i]); } } cout 3. soluion 2: // Authored by : Hot6Mania// Co-authored by : -// http://boj.kr/d478c2a6be29437f80e4e280de054d12#include using namespac..
2024.09.02 -
[BOJ] 1912번 : 연속합
1. problem : https://www.acmicpc.net/problem/1912 2. solution 1 :#include using namespace std;int n;int nums[100005];int d[100005];int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i > nums[i]; for (int i = 1; i 3. solution 2:// Authored by : Hot6Mania// Co-authored by : BaaaaaaaaaaarkingDog// http://boj.kr/1fb4beecefac47d7a7f45f97f3189806#include using namespace..
2024.09.01