#202
Se citeşte un număr natural nenul n. Să se afişeze, în ordine lexicografică, permutările fără puncte fixe ale mulţimii {1,2,..,n}.
| Problema | PermPF | Operații I/O |
permpf.in/permpf.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64305945 | Utilizator | |
| Fișier | permpf.cpp | Dimensiune | 740 B |
| Data încărcării | 28 Aprilie 2026, 20:27 | Scor/rezultat | Eroare de compilare |
permpf.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream fin ("permpf.in"); | ^~~~~~~~ permpf.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream fout ("permpf.out"); | ^~~~~~~~ permpf.cpp: In function ‘void afisare()’: permpf.cpp:19:20: error: ‘k’ was not declared in this scope 19 | for(int i=1;i<=k;i++) | ^ permpf.cpp:20:9: error: ‘fout’ was not declared in this scope 20 | fout<<v[i]<<" " | ^~~~ permpf.cpp: In function ‘void back(int)’: permpf.cpp:29:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 29 | int main(){ | ^~ permpf.cpp:29:13: note: remove parentheses to default-initialize a variable 29 | int main(){ | ^~ | -- permpf.cpp:29:13: note: or replace parentheses with braces to value-initialize a variable permpf.cpp:29:15: error: a function-definition is not allowed here before ‘{’ token 29 | int main(){ | ^ permpf.cpp:34:19: error: expected ‘}’ at end of input 34 | return 0;} | ^ permpf.cpp:22:18: note: to match this ‘{’ 22 | void back (int k){ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PermPF 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ă.