HANCO
[백준] 나이트의 이동 BFS
나이트의 이동 7562 // // Created by JayPark on 2020/05/10. // #include "algo.h" using namespace std; // 값 3개가 필요하다. /* 1. 체스판의 크기 * 2. 현재 나이트의 위치 * 3. 이동해야하는 칸 * */ int T, N; int map[301][301]; bool chk[301][301]; // 시작 위치, 종료위치 typedef struct Start_Point { int x, y; } sp; // 도착해야하는 위치 int ex, ey; int dx[] = {-2, -1, 1, 2, 2, 1, -1, -2}; int dy[] = {1, 2, 2, 1, -1, -2, -2, -1}; int main(){ cin >> T; w..
Algorithm/백준알고리즘
2020. 5. 10. 18:29