#3903
Se dă o matrice A, formată din N linii și N coloane. Asupra unei submatrice cu colțul din stânga-sus aflat pe linia l1 și coloana c1, și colțul din dreapta-jos aflat pe linia l2 și coloana c2, se poate efectua operație de mărire a elementelor cu un număr întreg v. Afișați matricea A, după efectuarea a Q astfel de operații.
ad-hoc
| Problema | Diff2dArrays | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.4 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
| Id soluție | #64137211 | Utilizator | |
| Fișier | diff2darrays.cpp | Dimensiune | 486 B |
| Data încărcării | 20 Aprilie 2026, 08:28 | Scor/rezultat | Eroare de compilare |
diff2darrays.cpp: In function ‘int main()’: diff2darrays.cpp:7:13: error: ‘j’ was not declared in this scope 7 | for(j=1; j<=n ; j++) | ^ diff2darrays.cpp:6:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(i=1; i<=n ; i++) | ^~~ diff2darrays.cpp:9:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | cin>>q; | ^~~ diff2darrays.cpp:11:30: error: ‘v’ was not declared in this scope 11 | cin>>l1>>c1>>c2>>l2>>v; | ^ diff2darrays.cpp:13:17: error: ‘j’ was not declared in this scope 13 | for(j=c1 ; j<=c2 ; j++)a[i][j]+=v; | ^ diff2darrays.cpp:12:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 12 | for(i=l1; i<=l2; i++) | ^~~ diff2darrays.cpp:14:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 14 | q--;} | ^ diff2darrays.cpp:15:31: error: ‘j’ was not declared in this scope 15 | for(i=1; i<=n ; i++) {for(j=1; j<=n ; j++) | ^ diff2darrays.cpp:15:27: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 15 | for(i=1; i<=n ; i++) {for(j=1; j<=n ; j++) | ^~~ diff2darrays.cpp:16:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 16 | cout<<a[i][j]<< " " ;cout<<endl;} | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Diff2dArrays 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ă.