[B7562] - 나이트의 이동
https://www.acmicpc.net/problem/7562나이트는 가로로 2칸 세로로 1칸 혹은 가로로 1칸 세로로 2칸씩 이동합니다그에 따라 dx[], dy[]를 설정할 때 실수가 없으면 간단하게 풀 수 있는 BFS문제입니다 12345678910111213141516171819202122232425262728293031323334353637383940414243444546#include #include using namespace std;int dx[] = { 1,1,-1,-1,2,2,-2,-2 };int dy[] = { 2,-2,2,-2,1,-1,1,-1 };struct pos { int x; int y;};int main(){ int t; cin >> t; for (int zs = 1; zs..
더보기