Skip to content

Commit b142fe1

Browse files
committed
[BOJ] 경로찾기 / S1
1 parent 901c3a3 commit b142fe1

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)