#320
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.
| Problema | PartitiiNumar | Operații I/O |
partitiinumar.in/partitiinumar.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64371247 | Utilizator | |
| Fișier | partitiinumar.cpp | Dimensiune | 822 B |
| Data încărcării | 04 Mai 2026, 09:14 | Scor/rezultat | Eroare de compilare |
partitiinumar.cpp: In function ‘void init()’: partitiinumar.cpp:12:2: error: ‘st’ was not declared in this scope; did you mean ‘std’? 12 | {st[k]=0;} | ^~ | std partitiinumar.cpp:12:5: error: ‘k’ was not declared in this scope 12 | {st[k]=0;} | ^ partitiinumar.cpp: In function ‘int succesor()’: partitiinumar.cpp:15:5: error: ‘st’ was not declared in this scope; did you mean ‘std’? 15 | {if(st[k]<n) | ^~ | std partitiinumar.cpp:15:8: error: ‘k’ was not declared in this scope 15 | {if(st[k]<n) | ^ partitiinumar.cpp: In function ‘int valid()’: partitiinumar.cpp:22:16: error: ‘k’ was not declared in this scope 22 | for(int i=1;i<=k;i++) s+=st[i]; | ^ partitiinumar.cpp:22:26: error: ‘st’ was not declared in this scope; did you mean ‘s’? 22 | for(int i=1;i<=k;i++) s+=st[i]; | ^~ | s partitiinumar.cpp:24:16: error: ‘k’ was not declared in this scope 24 | for(int i=2;i<=k;i++) | ^ partitiinumar.cpp:25:4: error: ‘st’ was not declared in this scope; did you mean ‘s’? 25 | if(st[i]<st[i-1]) return 0; | ^~ | s partitiinumar.cpp: In function ‘int solutie()’: partitiinumar.cpp:32:16: error: ‘k’ was not declared in this scope 32 | for(int i=1;i<=k;i++) s+=st[i]; | ^ partitiinumar.cpp:32:26: error: ‘st’ was not declared in this scope; did you mean ‘s’? 32 | for(int i=1;i<=k;i++) s+=st[i]; | ^~ | s partitiinumar.cpp: In function ‘void back()’: partitiinumar.cpp:42:1: error: ‘k’ was not declared in this scope 42 | k=1;st[1]=0; | ^ partitiinumar.cpp:42:5: error: ‘st’ was not declared in this scope; did you mean ‘std’? 42 | k=1;st[1]=0; | ^~ | std partitiinumar.cpp:49:20: error: too few arguments to function ‘void tipar(int)’ 49 | if(solutie()) tipar(); | ~~~~~^~ partitiinumar.cpp:35:6: note: declared here 35 | void tipar(int k){ | ^~~~~ partitiinumar.cpp: At global scope: partitiinumar.cpp:56:9: error: expected declaration before ‘}’ token 56 | } | ^ partitiinumar.cpp:57:1: error: expected declaration before ‘}’ token 57 | } | ^ partitiinumar.cpp: In function ‘int main()’: partitiinumar.cpp:61:13: error: too many arguments to function ‘void back()’ 61 | back(1,0); | ~~~~^~~~~ partitiinumar.cpp:40:6: note: declared here 40 | void back() | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PartitiiNumar 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ă.