0768 - Suma Pare 3
rezolvare
<syntaxhighlight lang="python" line="1"> n, m = map(int, input().split()) matrix = [list(map(int, input().split())) for _ in range(n)]
unique_even = set() for i in range(n):
for j in range(m): if matrix[i][j] % 2 == 0: unique_even.add(matrix[i][j])
print(sum(unique_even)) </syntaxhighlight>