#81
Scrieţi un program care citeşte de la tastatură un tablou bidimensional cu n linii şi n coloane și afişează pe ecran numărul valorilor din tablou care sunt strict mai mari decât toți vecinii lor.
| Problema | Matrice | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64392455 | Utilizator | |
| Fișier | matrice.cpp | Dimensiune | 550 B |
| Data încărcării | 04 Mai 2026, 23:31 | Scor/rezultat | 0 puncte |
matrice.cpp: In function ‘int main()’: matrice.cpp:15:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if (v[in][dj]>v[i][j+1] && v[in][dj]>v[i+1][j] && v[in][dj]>v[i][j-1] && v[in][dj]>v[i-1][j]) | ^~ matrice.cpp:18:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 18 | if (ok==1) c++;}} | ^~ matrice.cpp:13:15: warning: array subscript 4 is above array bounds of ‘int [4]’ [-Warray-bounds=] 13 | {in=i+di[k]; | ~~~~^ matrice.cpp:3:23: note: while referencing ‘di’ 3 | int n,m,i,j,v[22][22],di[4]={-1,0,1,0},jn[4]={0,1,0,-1},k,c=0,in,dj,ok=0; | ^~ matrice.cpp:14:14: warning: array subscript 4 is above array bounds of ‘int [4]’ [-Warray-bounds=] 14 | dj=j+jn[k]; | ~~~~^ matrice.cpp:3:40: note: while referencing ‘jn’ 3 | int n,m,i,j,v[22][22],di[4]={-1,0,1,0},jn[4]={0,1,0,-1},k,c=0,in,dj,ok=0; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Caught fatal signal 11 | 40 | 0 | ||
| 3 | 0.001 secunde | Caught fatal signal 11 | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice 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ă.