#196
Se citesc două numere naturale nenule n și k. Să se afişeze, în ordine lexicografică, aranjamentele de câte k elemente ale mulţimii {1,2,..,n}.
| Problema | Aranjamente | Operații I/O |
aranjamente.in/aranjamente.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64294316 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 687 B |
| Data încărcării | 28 Aprilie 2026, 12:35 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:3:11: error: expected unqualified-id before string constant 3 | ifstream ("aranjamente.in"); | ^~~~~~~~~~~~~~~~ aranjamente.cpp:3:11: error: expected ‘)’ before string constant 3 | ifstream ("aranjamente.in"); | ~^~~~~~~~~~~~~~~~ | ) aranjamente.cpp:4:11: error: expected unqualified-id before string constant 4 | ofstream ("aranjamente.out"); | ^~~~~~~~~~~~~~~~~ aranjamente.cpp:4:11: error: expected ‘)’ before string constant 4 | ofstream ("aranjamente.out"); | ~^~~~~~~~~~~~~~~~~ | ) aranjamente.cpp: In function ‘void Afis(int)’: aranjamente.cpp:11:9: error: ‘out’ was not declared in this scope 11 | out << x[j] << " "; | ^~~ aranjamente.cpp:12:5: error: ‘out’ was not declared in this scope 12 | out << endl; | ^~~ aranjamente.cpp: In function ‘void Back(int)’: aranjamente.cpp:31:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 31 | if(OK(k)) | ^ aranjamente.cpp: In function ‘int main()’: aranjamente.cpp:39:5: error: ‘in’ was not declared in this scope; did you mean ‘n’? 39 | in >> n >> p; | ^~ | n
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Aranjamente 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ă.