백준 알고리즘/다이나믹 프로그래밍75 백준 2579번 C++ #include #include using namespace std; int m;int stairscore[301];int staircopy[301]; int maxscore() {staircopy[1] = stairscore[1];staircopy[2] = stairscore[1] + stairscore[2];staircopy[3] = max(stairscore[1] + stairscore[3], stairscore[2] + stairscore[3]);for (int i = 4; i > m;for (int i = 1; i > stairscore[i];}cout 2019. 1. 14. 백준 9095번 C++ #include using namespace std; int n, m;int way[11]; void findway(int m) { way[1] = 1;way[2] = 2;way[3] = 4; for (int i = 4; i > m;findway(m);}} 2019. 1. 14. 백준 5014번 C++ #include #include #include using namespace std; int f, s, g, u, d;int visited[1000001]; int bfs(int s) {queue q;q.push(s);visited[s] = 1; while (!q.empty()) {int x = q.front();q.pop(); if (x == g)return visited[x]-1; int movestairs[2] = { x + u, x - d };for (int k = 0; k = 1 && ma > f >> s >> g >> u >> d;memset(visited, 0, sizeof(visited));int ans = bfs.. 2019. 1. 14. 이전 1 ··· 16 17 18 19 다음