#321
PartitiiNumar1
Se dă un număr natural n
. Determinaţi, în ordine lexicografică, toate modalităţile de a-l scrie pe n
ca sumă de numere naturale distincte.
Problema | PartitiiNumar1 | Operații I/O |
partitiinumar1.in /partitiinumar1.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52245411 | Utilizator | |
Fișier | partitiinumar1.cpp | Dimensiune | 674 B |
Data încărcării | 24 Septembrie 2024, 13:08 | Scor / rezultat | Eroare de compilare |
partitiinumar1.cpp:5:1: error: expected ',' or ';' before 'int' int n ,x[41],s,p[41]; ^ partitiinumar1.cpp: In function 'void afis(int)': partitiinumar1.cpp:10:15: error: 'x' was not declared in this scope cout<<x[i]<<' '; ^ partitiinumar1.cpp: In function 'int solutie(int)': partitiinumar1.cpp:16:38: error: 'x' was not declared in this scope for( int i = 1; i <= k; i++) s=s+x[i]; ^ partitiinumar1.cpp:17:11: error: 'n' was not declared in this scope if(s==n) return 1; ^ partitiinumar1.cpp: In function 'void back(int, int)': partitiinumar1.cpp:23:19: error: 'x' was not declared in this scope for ( int i = x[k-1]; i <= n-s; ++i) ^ partitiinumar1.cpp:23:32: error: 'n' was not declared in this scope for ( int i = x[k-1]; i <= n-s; ++i) ^ partitiinumar1.cpp:24:12: error: 'p' was not declared in this scope { if(!p[i]){ ^ partitiinumar1.cpp: In function 'int main()': partitiinumar1.cpp:37:5: error: 's' was not declared in this scope { s=0; ^ partitiinumar1.cpp:38:10: error: 'n' was not declared in this scope cin>>n; ^ partitiinumar1.cpp:39:5: error: 'x' was not declared in this scope x[0]=1; ^ partitiinumar1.cpp: In function 'int solutie(int)': partitiinumar1.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PartitiiNumar1 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ă.