최장 경로1 [SWEA|파이썬] 2814. 최장 경로 (D3) 문제 https://tinyurl.com/2nsxaw4h SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 🐍파이썬 더보기 ❌ BFS from collections import deque T = int(input()) for test_case in range(1, T+1): n, m = map(int, input().split()) graph = [[]*(n+1) for _ in range(n+1)] for _ in range(m): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) def bfs(x): global ans queue =.. 2023. 5. 12. 이전 1 다음 반응형