n = int(input())
m = int(input())
arr = [[int(input()) for j in range(m)] for i in range(n)]
r = 0
for row in arr:
k = 0
for i in range(len(row) - 1):
for j in range(i + 1, len(row)):
if row[i] != row[j]:
k += 1
if k == n:
r += 1
print(r)
Объяснение:
n = int(input())
m = int(input())
arr = [[int(input()) for j in range(m)] for i in range(n)]
r = 0
for row in arr:
k = 0
for i in range(len(row) - 1):
for j in range(i + 1, len(row)):
if row[i] != row[j]:
k += 1
if k == n:
r += 1
print(r)
Объяснение: