#2943
maru
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 | #50669679 | Utilizator | |
Fișier | maru.cpp | Dimensiune | 684 B |
Data încărcării | 19 Aprilie 2024, 14:40 | Scor / rezultat | Eroare de compilare |
maru.cpp: In function 'int main()': maru.cpp:8:5: error: 's' was not declared in this scope s=0;j=1; ^ maru.cpp:8:9: error: 'j' was not declared in this scope s=0;j=1; ^ maru.cpp:9:20: error: 'n' was not declared in this scope for(int i=2;i<=n;i++) ^ maru.cpp:11:16: error: expected ';' before ')' token for(j=1) ^ maru.cpp:13:5: error: expected primary-expression before '}' token } ^ maru.cpp:13:5: error: expected ';' before '}' token maru.cpp:13:5: error: expected primary-expression before '}' token maru.cpp:13:5: error: expected ')' before '}' token maru.cpp:13:5: error: expected primary-expression before '}' token maru.cpp:13:5: error: expected ';' before '}' token maru.cpp:14:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ maru.cpp:14:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++){ ^ maru.cpp:15:17: error: 'k' was not declared in this scope for(k=i;k<=n;k++){ ^ maru.cpp:17:21: error: 'v' was not declared in this scope v[j]=v[k]+v[i-1]; ^ maru.cpp:21:24: error: 'v' was not declared in this scope s+=v[i]; ^ maru.cpp:22:29: error: 'T' was not declared in this scope while(s>T){ ^ maru.cpp:26:23: error: 'T' was not declared in this scope if(s<=T){ ^ maru.cpp:27:21: error: 'nrs' was not declared in this scope nrs=nrs+i-j; ^
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ă.