SW
-
다리만들기백준알고리즘 2019. 8. 14. 17:55
#include #include #include #include #include using namespace std; int n; int map[100][100]; int mapping[100][100]; bool d[100][100]; int dx[] = {0,0,1,-1}; int dy[] = {1,-1,0,0}; int ans = 100000000; void bfs(int x, int y, int value){ queue q; q.push({x,y}); map[x][y] = 0; d[x][y] = true; while(!q.empty()){ x = q.front().first; y = q.front().second; q.pop(); for(int i = 0; i < 4; i++){ int nx = ..
-
5644. [모의 SW 역량테스트] 무선 충전SWexpertAcademy 2019. 7. 24. 21:39
#include #include #include #include #include using namespace std; struct bat{ int x; int y; int scale; int charge; int numb; }; int map[8][21][21]; bool d[8][21][21]; int m, a; int tc; int c[5] = { 1, 5, 21, 85, 341}; int dx[] = {1,-1,0,0}; int dy[] = {0,0,1,-1}; int dx1[] = {0,-1,0,1,0}; int dy1[] = {0,0,1,0,-1}; int max(int a, int b){ int max = a; if(max < b) max = b; return max; } bool checki..