0776 - Cnt Linii: 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 18:4218:42, 3 April 2023MiclausIoana talk contribs 420 bytes +420 Pagină nouă: == Rezolvare == <syntaxhighlight lang="python" line="1"> n, m = map(int, input().split()) # citim elementele matricei matrix = [] for i in range(n): row = list(map(int, input().split())) matrix.append(row) # determinăm numărul de linii cu toate elementele egale count = 0 for row in matrix: if all(elem == row[0] for elem in row): count += 1 # afișăm rezultatul print(count) </syntaxhighlight>