0779 - Vecini Pari: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

19 April 2023

3 April 2023

  • curprev 19:2619:26, 3 April 2023MiclausIoana talk contribs 688 bytes +688 Pagină nouă: == Rezolvare == <syntaxhighlight lang="python" line="1"> n, m = map(int, input().split()) matrix = [] for i in range(n): row = list(map(int, input().split())) matrix.append(row) count = 0 for i in range(n): for j in range(m): if i > 0 and matrix[i-1][j] % 2 == 1: # verificăm vecinul de sus continue if i < n-1 and matrix[i+1][j] % 2 == 1: # verificăm vecinul de jos continue if j > 0 and matrix[i][j-1] % 2 == 1:...