coding test/Baekjoon
[Python] 13913번 숨바꼭질 4
https://www.acmicpc.net/problem/13913체감 난이도: ★★★★☆import sysinput=sys.stdin.readlinefrom collections import deque#dfsdef bfs(n): MAX=100001 #메모리초과 방지 prev=[-1]*MAX #이전 경로 저장 dist=[0]*MAX #시간 count prev[n]=100001 #현재 위치 저장 queue=deque([n]) while queue: x=queue.popleft() #만약 동생 위치 도착하면 if x==K: break for nx in (x-1,x+1,x*2): if 0 ..