#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 | #64831188 | Utilizator | |
| Fișier | aranjamente.cpp | Dimensiune | 650 B |
| Data încărcării | 04 Iunie 2026, 12:36 | Scor/rezultat | Eroare de compilare |
aranjamente.cpp:5:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 5 | ofstream fout("aranjamente.out") | ^~~~~~~~ aranjamente.cpp: In function ‘void tipar(int)’: aranjamente.cpp:14:15: error: expected primary-expression before ‘;’ token 14 | for(int i=; i<=k;i++) | ^ aranjamente.cpp:15:9: error: ‘fout’ was not declared in this scope 15 | fout<<st[i]<<" "; | ^~~~ aranjamente.cpp:16:5: error: ‘fout’ was not declared in this scope 16 | fout<<endl; | ^~~~ aranjamente.cpp: In function ‘void backtrackingrecursiv(int)’: aranjamente.cpp:23:12: error: ‘valid’ was not declared in this scope; did you mean ‘val’? 23 | if(valid(k)) | ^~~~~ | val aranjamente.cpp:23:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 23 | if(valid(k)) | ^ aranjamente.cpp: In function ‘int main()’: aranjamente.cpp:32:13: error: ‘c’ was not declared in this scope 32 | fin>>n>>c; | ^ aranjamente.cpp:33:25: error: too few arguments to function ‘void backtrackingrecursiv(int)’ 33 | backtrackingrecursiv(); | ~~~~~~~~~~~~~~~~~~~~^~ aranjamente.cpp:18:6: note: declared here 18 | void backtrackingrecursiv(int k) | ^~~~~~~~~~~~~~~~~~~~
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ă.