#4677
O persoană studioasă din Cartelul Sinaloa vă pune la dispoziție o matrice pătratică n x n care memorează numai valori binare. Această matrice este de tip MatrixChess dacă orice valoare de 0 se învecinează doar cu valori de 1 și invers, orice valoare de 1 se învecinează doar cu valori de 0. Verificați dacă matricea dată este de tip MatrixChess și puteți veți primi o bursă de studiu în interiorul cartelului!
Folclorul informatic
| Problema | MatrixChess | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64560850 | Utilizator | |
| Fișier | matrixchess.cpp | Dimensiune | 749 B |
| Data încărcării | 14 Mai 2026, 12:27 | Scor/rezultat | 15 puncte |
matrixchess.cpp: In function ‘int main()’: matrixchess.cpp:21:27: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 21 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 0; | ~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:21:40: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 21 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 0; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:21:53: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 21 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 0; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:21:66: warning: statement has no effect [-Wunused-value] 21 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 0; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ matrixchess.cpp:26:27: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 26 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 1; | ~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:26:40: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 26 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 1; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:26:53: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 26 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ matrixchess.cpp:26:66: warning: statement has no effect [-Wunused-value] 26 | a[i-1][j] == a[i+1][j] == a[i][j-1] == a[i][j+1] == 1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ matrixchess.cpp:27:20: warning: ‘cnt’ may be used uninitialized [-Wmaybe-uninitialized] 27 | cnt++; | ~~~^~ matrixchess.cpp:11:16: note: ‘cnt’ was declared here 11 | int i , j, cnt; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 1 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 2 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 3 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 4 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 5 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 6 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 7 | 0.003 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 8 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 9 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 10 | 0.002 secunde | OK. | 5 | 5 | ||
| 11 | 0.001 secunde | OK. | 5 | 5 | ||
| 12 | 0.001 secunde | OK. | 5 | 5 | ||
| 13 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 14 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 15 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 16 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 17 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 18 | 0.001 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 19 | 0.002 secunde | Caught fatal signal 11 | 5 | 0 | ||
| Punctaj total | 15 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MatrixChess face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.