#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 | #42550932 | Utilizator | |
Fișier | partitiinumar1.cpp | Dimensiune | 628 B |
Data încărcării | 09 Martie 2023, 20:41 | Scor / rezultat | Eroare de compilare |
partitiinumar1.cpp: In function 'void afisare(int)': partitiinumar1.cpp:12:9: error: reference to 'cout' is ambiguous cout << x[i] << " "; ^ partitiinumar1.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("partitiinumar1.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from partitiinumar1.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ partitiinumar1.cpp:13:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ partitiinumar1.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("partitiinumar1.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from partitiinumar1.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ partitiinumar1.cpp: In function 'void back(int, int)': partitiinumar1.cpp:24:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(sp <= n) ^ partitiinumar1.cpp: In function 'int main()': partitiinumar1.cpp:34:5: error: reference to 'cin' is ambiguous cin >> n; ^ partitiinumar1.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("partitiinumar1.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from partitiinumar1.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^
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ă.