#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 | #64866956 | Utilizator | |
| Fișier | diff2darrays.cpp | Dimensiune | 358 B |
| Data încărcării | 08 Iunie 2026, 13:26 | Scor/rezultat | Eroare de compilare |
diff2darrays.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ diff2darrays.cpp:13:34: error: extended character ” is not valid in an identifier 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^ diff2darrays.cpp:13:36: error: extended character “ is not valid in an identifier 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^ diff2darrays.cpp: In function ‘int main()’: diff2darrays.cpp:7:1: error: ‘cin’ was not declared in this scope 7 | cin>>n; | ^~~ diff2darrays.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? +++ |+#include <iostream> 1 | #include diff2darrays.cpp:9:25: error: ‘a’ was not declared in this scope 9 | for(j=1;j<=n;j++){ cin>>a[i][j];} | ^ diff2darrays.cpp:11:88: error: ‘a’ was not declared in this scope 11 | for(int k=1;k<=q;k++){ cin>>l1>>c1>>l2>>c2>>v; for(i=l1;i<=l2;i++) for(j=c1;j<=c2;j++) a[i][j]=a[i][j]+v; | ^ diff2darrays.cpp:13:19: error: ‘cout’ was not declared in this scope 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^~~~ diff2darrays.cpp:13:19: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? diff2darrays.cpp:13:25: error: ‘a’ was not declared in this scope 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^ diff2darrays.cpp:13:34: error: ‘”’ was not declared in this scope 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^ diff2darrays.cpp:13:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^~~ diff2darrays.cpp:13:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^~~~ diff2darrays.cpp:13:39: error: ‘cout’ was not declared in this scope diff2darrays.cpp:13:39: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? diff2darrays.cpp:13:45: error: ‘endl’ was not declared in this scope 13 | for(j=1;j<=n;j++) cout<<a[i][j]<<” “; cout<<endl;} return 0; | ^~~~ diff2darrays.cpp:1:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’? +++ |+#include <ostream> 1 | #include
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ă.