#771
Se dă o matrice cu n linii şi m coloane şi elemente numere naturale. Să se ordoneze liniile matricei crescător după suma elementelor.
| Problema | OrdLin | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64239211 | Utilizator | |
| Fișier | ordlin.cpp | Dimensiune | 780 B |
| Data încărcării | 24 Aprilie 2026, 16:47 | Scor/rezultat | 100 puncte |
ordlin.cpp: In function ‘int main()’: ordlin.cpp:26:15: warning: array subscript 1 is above array bounds of ‘int [1][101]’ [-Warray-bounds=] 26 | if(x[1][i]>x[1][j]) | ~~~^ ordlin.cpp:3:17: note: while referencing ‘x’ 3 | int v[101][101],x[1][101]; | ^ ordlin.cpp:26:23: warning: array subscript 1 is above array bounds of ‘int [1][101]’ [-Warray-bounds=] 26 | if(x[1][i]>x[1][j]) | ~~~^ ordlin.cpp:3:17: note: while referencing ‘x’ 3 | int v[101][101],x[1][101]; | ^ ordlin.cpp:28:21: warning: array subscript 1 is above array bounds of ‘int [1][101]’ [-Warray-bounds=] 28 | swap(x[1][i], x[1][j]); | ~~~^ ordlin.cpp:3:17: note: while referencing ‘x’ 3 | int v[101][101],x[1][101]; | ^ ordlin.cpp:28:30: warning: array subscript 1 is above array bounds of ‘int [1][101]’ [-Warray-bounds=] 28 | swap(x[1][i], x[1][j]); | ~~~^ ordlin.cpp:3:17: note: while referencing ‘x’ 3 | int v[101][101],x[1][101]; | ^ ordlin.cpp:19:16: warning: array subscript 1 is above array bounds of ‘int [1][101]’ [-Warray-bounds=] 19 | x[1][i]=s; | ~~~^ ordlin.cpp:3:17: note: while referencing ‘x’ 3 | int v[101][101],x[1][101]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.002 secunde | OK. | 40 | 40 | ||
| 3 | 0.004 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema OrdLin 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ă.