백준 7562 나이트의이동 [c++]


백준 7562 나이트의이동 [c++]

#include #include #include #include using namespace std; int t;//테스트 케이스 개수 int n;//한변의 길이 int nx, ny;//나이트의 위치 int rx, ry;//목적지의 위치 int map[301][301]; bool visited[301][301]; vectorv; int dx[8] = { 2,1,-1,-2,-2,-1,1,2 }; int dy[8] = { 1,2,2,1,-1,-2,-2,-1 }; typedef struct { int tx; int ty; int tcnt; }node; int func(int x, int y) { queueq; q.push({ x,y,0 }); visited[x][y] = true; while (!q.empty..


원문링크 : 백준 7562 나이트의이동 [c++]