이분탐색 + bfs import sys input = sys.stdin.readline from collections import deque def is_possible(limit): queue = deque() queue.append(s) visited = {i: False for i in range(1,N+1)} visited[s] = True while queue: cur_node = queue.popleft() if cur_node == e: return True for next_node, next_limit in graph[cur_node]: if not visited[next_node] and limit