#320
PartitiiNumar
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 | #53901337 | Utilizator | |
Fișier | partitiinumar.cpp | Dimensiune | 987 B |
Data încărcării | 14 Noiembrie 2024, 11:50 | Scor / rezultat | Eroare de compilare |
partitiinumar.cpp:5:13: error: expected initializer before ']' token int n, sol41], s; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:9:13: error: 'sol' was not declared in this scope if (sol[k]<sol[k-1]) return 0; ^ partitiinumar.cpp:10:12: error: 's' was not declared in this scope if(s+sol[k]<=n){ ^ partitiinumar.cpp:10:14: error: 'sol' was not declared in this scope if(s+sol[k]<=n){ ^ partitiinumar.cpp: In function 'int solutie(int)': partitiinumar.cpp:17:16: error: 's' was not declared in this scope if(s==n) return 1; ^ partitiinumar.cpp: In function 'void afisare(int)': partitiinumar.cpp:22:22: error: 'sol' was not declared in this scope out<<sol[i]<<" "; ^ partitiinumar.cpp:24:13: error: 's' was not declared in this scope s=s-sol[k]; ^ partitiinumar.cpp:24:17: error: 'sol' was not declared in this scope s=s-sol[k]; ^ partitiinumar.cpp: In function 'void bkt(int)': partitiinumar.cpp:29:17: error: 'sol' was not declared in this scope sol[k]=i; ^ partitiinumar.cpp:36:13: error: 's' was not declared in this scope s=s-sol[k-1]; ^ partitiinumar.cpp:36:17: error: 'sol' was not declared in this scope s=s-sol[k-1]; ^ partitiinumar.cpp: In function 'int valid(int)': partitiinumar.cpp:15:9: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.