#2943
Se dă o matrice pătratică de n x n numere naturale și o valoare naturală T. Suma unei submatrice este suma elementelor submatricei. Să se determine numărul submatricelor care au suma mai mică sau egală cu T.
| Problema | maru | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64213700 | Utilizator | |
| Fișier | maru.cpp | Dimensiune | 1.06 KB |
| Data încărcării | 23 Aprilie 2026, 10:47 | Scor/rezultat | Eroare de compilare |
maru.cpp:2:21: error: stray ‘#’ in program 2 | using namespace std;#include <iostream> | ^ maru.cpp:2:22: error: ‘include’ does not name a type 2 | using namespace std;#include <iostream> | ^~~~~~~ maru.cpp: In function ‘int main()’: maru.cpp:7:12: error: ‘n’ was not declared in this scope 7 | cin>>t>>n>>a>>b>>c>>d; | ^ maru.cpp:26:16: error: ‘nr’ was not declared in this scope 26 | nr++; | ^~ maru.cpp:28:15: error: ‘nr’ was not declared in this scope 28 | cout<<nr; | ^~ maru.cpp: At global scope: maru.cpp:31:5: error: redefinition of ‘int A [401][401]’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:5: note: ‘int A [401][401]’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:17: error: redefinition of ‘int S [401][401]’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:17: note: ‘int S [401][401]’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:34: error: redefinition of ‘int k1’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^~ maru.cpp:4:29: note: ‘int k1’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^~ maru.cpp:31:37: error: redefinition of ‘int k2’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^~ maru.cpp:4:32: note: ‘int k2’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^~ maru.cpp:31:40: error: redefinition of ‘int a’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:35: note: ‘int a’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:42: error: redefinition of ‘int b’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:37: note: ‘int b’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:44: error: redefinition of ‘int c’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:39: note: ‘int c’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:46: error: redefinition of ‘int d’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:41: note: ‘int d’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:48: error: redefinition of ‘int t’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:43: note: ‘int t’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:50: error: redefinition of ‘int j’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:45: note: ‘int j’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:31:52: error: redefinition of ‘int i’ 31 | int A[401][401],S[401][401],n,nr,k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:4:47: note: ‘int i’ previously declared here 4 | int A[401][401],S[401][401],k1,k2,a,b,c,d,t,j,i; | ^ maru.cpp:32:5: error: redefinition of ‘int main()’ 32 | int main() | ^~~~ maru.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema maru 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ă.