7562 나이트의 이동
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#include #include #include using namespace std; int dx[8] = { 1,2,2,1,-1,-2,-2,-1 };int dy[8] = {-2,-1,1,2,2,1,-1,-2};int bfs(int stX, int stY, int endX, int endY, int width) { queue q; q.push(make_pair(0, make_pair(stY, stX))); int chk[305][305] = { 0 }; chk[stY][stX] = 1; while (!q.empty()) { int..
2020. 1. 14.