E. Красивая матрица

public
yeskendir.sultanov Apr 26, 2024 Never 46
Clone
Python 10.py 14 lines (11 loc) | 260 Bytes
1
table = []
2
3
r = -1
4
c = -1
5
6
for i in range(5):
7
row = input().split()
8
table.append([int(x) for x in row])
9
for j in range(5):
10
if table[i][j] == 1:
11
r = i
12
c = j
13
14
print(abs(2 - r) + abs(2 - c))
15