diff --git "a/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" "b/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" index 5edebdf..7b0f15f 100644 --- "a/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" +++ "b/\352\267\270\353\236\230\355\224\204/P1325_\355\232\250\354\234\250\354\240\201\354\235\270\355\225\264\355\202\271.py" @@ -7,6 +7,7 @@ def BFS(v): + visited = [False] * (N + 1) queue = deque() queue.append(v) visited[v] = True @@ -19,18 +20,14 @@ def BFS(v): queue.append(i) -for _ in range(M): +for i in range(M): S, E = map(int, input().split()) A[S].append(E) for i in range(1, N + 1): # 모든 노드에서 BFS 실행 - visited = [False] * (N + 1) BFS(i) -maxVal = 0 -for i in range(1, N + 1): - maxVal = max(maxVal, answer[i]) - +maxVal = max(answer) for i in range(1, N + 1): if maxVal == answer[i]: print(i, end=' ') diff --git "a/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" "b/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" similarity index 95% rename from "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" rename to "\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" index 406b09b..a4a0d93 100644 --- "a/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\206\214\355\212\2701.py" +++ "b/\354\240\225\353\240\254/P1377_\353\262\204\353\270\224\354\240\225\353\240\2541.py" @@ -10,4 +10,4 @@ for i in range(N): if Max < sorted_A[i][1] - i: # 정렬 전 index - 정렬 후 index 계산의 최댓값 저장하기 Max = sorted_A[i][1] - i -print(Max + 1) \ No newline at end of file +print(Max + 1) diff --git "a/\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\206\214\355\212\2702.py" "b/\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" similarity index 100% rename from "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\206\214\355\212\2702.py" rename to "\354\240\225\353\240\254/P1517_\353\262\204\353\270\224\354\240\225\353\240\2542.py" diff --git "a/\355\203\220\354\203\211/P1206_DFS\354\231\200BFS.py" "b/\355\203\220\354\203\211/P1260_DFS\354\231\200BFS.py" similarity index 100% rename from "\355\203\220\354\203\211/P1206_DFS\354\231\200BFS.py" rename to "\355\203\220\354\203\211/P1260_DFS\354\231\200BFS.py"