Skip to content

Commit 36f220e

Browse files
Merge pull request #257 from Coding-Crew-Forever/chaeryeon823/algorithm
[2025년 8월 셋째주 / chaeryeon823] 그래프 이론
2 parents 8f10649 + b142fe1 commit 36f220e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

chaeryeon823/BOJ_11403.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
N = int(input())
5+
arr = []
6+
for _ in range(N):
7+
arr.append(list(map(int, input().split())))
8+
9+
for k in range(N):
10+
for i in range(N):
11+
for j in range(N):
12+
if arr[i][k] and arr[k][j]:
13+
arr[i][j] = 1
14+
15+
for row in arr:
16+
print(' '.join(map(str, row)))

0 commit comments

Comments
 (0)