[백준] 16236번: 아기 상어(C++)
·
개발/C++
문제 링크https://www.acmicpc.net/problem/16236 코드 구현#include #include #include #include #include using namespace std;int n;vector> space;vector> dirs = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };bool canMove(int y, int x, int sharkSize){ // 박스 범위 내에 있고 물고기의 크기가 상어 크기와 같거나 작은지 if (y >= 0 && y = 0 && x & a, const tuple& b) { // 거리 우선 if (get(a) != get(b)) return get(a) > get(b); // y 우선 if (get(a) != g..