python31 가장 먼 노드 문제풀이 효율성 실패 def graph(arrived, start, edge, n): while(len(arrived) < n): new_start= [] for point in start: for root in edge[:]: if point in root: root.remove(point) list_root = list(root) if not list_root[0] in arrived: new_start.append(list_root[0]) arrived.add(list_root[0]) edge.remove(root) start = new_start[:] return start def solution(n, edge): answer = 0 arrived = {1, } edge_set = [set(roo.. 2021. 5. 23. 이전 1 다음