[백준] 16948번 데스 나이트
·
백준 문제/BFS
문제: 16948번: 데스 나이트 #include using namespace std;vector> board;vector> visits;int dx[6] = { -2, -2, 0, 0, 2, 2 };int dy[6] = { -1, 1, -2, 2, -1, 1 };int n;int r1, c1, r2, c2;vector> path;void BFS() { queue> nexts; visits[r1][c1] = 1; nexts.push({ r1, c1 }); while (!nexts.empty()) { pair cur = nexts.front(); nexts.pop(); for (int i = 0; i n - 1 || ny n - 1) continue; ..