백준 알고리즘/시뮬레이션43 백준 2455번 C++ #include #include using namespace std; int main(void) { int current=0, maxnum = -1; for (int i = 0; i > out >> in; current = current - out + in; maxnum = max(maxnum, current); } cout 2019. 8. 26. 백준 14499번 C++ #include #include using namespace std; const int MAX = 20; int n, m, x, y, k; int num[MAX][MAX]; int dice[6],copynum[6]; void checkzero() { if (num[x][y] != 0) { dice[5] = num[x][y]; num[x][y] = 0; } else { num[x][y] = dice[5]; } } bool checkend() { if (x = n || y = m) return false; else return true; } int main(void) { cin >> n >> m >> x >> y >> k; memset(dice, 0, sizeof(dice)); for (int i = 0; .. 2019. 4. 7. 백준 3190 C++ #include #include #include using namespace std; const int MAX = 100; int n, applenum; int location[MAX][MAX]; int ans = 0; list currentloc; int visited[MAX][MAX]; int dfs(int c, char dir) { int time = c - ans; for (int i = 0; i > n >> applenum; memset(location, 0, sizeof(location)); memset(visited, -1, sizeof(visited)); visited[1][1] = 0; for (int i = 0; i > row >> column; location[row][column] .. 2019. 4. 7. 백준 3190번 C++ #include#include#includeusing namespace std; const int MAX = 102;int n, k;int apple[MAX][MAX];int l;pair movedir[101];int currentdir = 1;class Point {public:int x, y;Point(int x, int y) {this->x = x;this->y = y;}};deque snake; bool terminatecheck() {if (snake.front().x n || snake.front().y > n || snake.front().y > n >> k;memset(apple, 0, sizeof(apple));for (int i = 0; i .. 2019. 1. 29. 이전 1 ··· 4 5 6 7 8 9 10 11 다음