알고리즘
검색결과
2
개

[c++] 백준 2440: 자두나무 (dp)
#include #include using namespace std; using ii = pair; using ll = long long; int t, max_w; int dp[1002][32][3]; int zadu[1002]; int main() { cin >> t >> max_w; for(int i=1; i> zadu[i]; for(int i=1; i max_w; for(int i=1; i> zadu[i]; for(int i=1; i
알고리즘/백준
2023. 12. 27. 11:24


[c++] 백준 1992: 쿼드트리 (분할정복)
재귀함수를 통해 풀이를 만들어주었다. #include #include using namespace std; using ii = pair; using ll = long long; int n; string str; vector img; vector to_sub(vector& src, int dir) { // 반복되는 코드!! vector result; int sz = src.size()/2; if(dir == 1) { for(int i=0; i
알고리즘/백준
2023. 12. 27. 00:22