Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fin = open('count.in', 'r')
- fout = open('count.out', 'w')
- n = int(input())
- a = [[int(x) for x in fin.readline().split()] for _ in range(n)]
- count = 0
- for i in range(n):
- for j in range(n):
- if a[i][j] == 1:
- count += 1
- print(count // 2, file = fout)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement