BOJ 4963 - ์ฌ์ ๊ฐ์
๋ฌธ์ ๋ฐฑ์ค ์จ๋ผ์ธ ์ ์ง - 4963๋ฒ ํ์ด ๊ณผ์ ์ฌ๊ณผ ๋ฐ๋ค์ ์ง๋๊ฐ ์ฃผ์ด์ง ๋ ์ฌ์ ๊ฐ์๋ฅผ ๊ตฌํ๋ ๋ฌธ์ ์
๋๋ค. BFS ๋ฅผ ์ด์ฉํด์ ์ปดํฌ๋ํธ์ ๊ฐ์๋ฅผ ๊ตฌํด์ฃผ๋ฉด ๋ฉ๋๋ค. ์ฝ๋ import sys from collections import deque dx = [1, -1, 0, 0, -1, -1, 1, 1] dy = [0, 0, 1, -1, -1, 1, -1, 1] def in_range(x, y): return 0
2021. 6. 15.