프로그래머스72 스킬트리 C++ #include #include #include #include ] using namespace std; int solution(string skill, vector skill_trees) { int answer = 0; map m; for (int i = 1; i index) { flag = false; break; } else { if(m[skill_trees[i][j]] == index) index++; } } } if (flag == true) { answer++; cout 2019. 10. 23. 서울에서 경산까지 C++ #include #include #include #include using namespace std; const int MAX = 101; const int MAX2 = 100001; int score[MAX][MAX2]; int solution(int k, vector travel) { score[0][travel[0][0]] = travel[0][1]; score[0][travel[0][2]] = travel[0][3]; for(int i=1; i 2019. 10. 9. 카드 게임 C++ #include #include #include #include using namespace std; const int MAX = 2001; vector l, r; int score[MAX][MAX]; int maxsum(int x, int y) { if (x >= l.size() || y >= r.size()) return 0; int &value = score[x][y]; if (value != -1) return value; value = 0; value = max(maxsum(x+1, y), maxsum(x+1, y+1)); if (l[x] > r[y]) { value = max(value, r[y] + maxsum(x, y + 1)); } return value; } int solution(ve.. 2019. 10. 9. 보행자 천국 C++ #include #include using namespace std; const int MAX = 501; int MOD = 20170805; int top[MAX][MAX],lefts[MAX][MAX]; int solution(int m, int n, vector city_map) { memset(top,0,sizeof(top)); memset(lefts,0,sizeof(lefts)); top[1][1] = lefts[1][1] = 1; for(int i=1; i 2019. 10. 8. 이전 1 ··· 11 12 13 14 15 16 17 18 다음