#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 | #64539489 | Utilizator | |
| Fișier | permpf.cpp | Dimensiune | 686 B |
| Data încărcării | 13 Mai 2026, 10:29 | Scor/rezultat | Eroare de compilare |
permpf.cpp:4:14: error: expected initializer before ‘<<’ token 4 | ofstream fout<<("permpf.out") | ^~ permpf.cpp: In function ‘int valid(int)’: permpf.cpp:10:8: error: ‘st’ was not declared in this scope; did you mean ‘std’? 10 | if(st[k]==st[i]) | ^~ | std permpf.cpp:14:12: error: ‘st’ was not declared in this scope; did you mean ‘std’? 14 | if(st[i]==i) | ^~ | std permpf.cpp: In function ‘int solutie(int)’: permpf.cpp:21:16: error: ‘n’ was not declared in this scope 21 | return (k==n); | ^ permpf.cpp: In function ‘void tipar(int)’: permpf.cpp:27:5: error: ‘fout’ was not declared in this scope 27 | fout<<st[i]<<' '; | ^~~~ permpf.cpp:27:11: error: ‘st’ was not declared in this scope; did you mean ‘std’? 27 | fout<<st[i]<<' '; | ^~ | std permpf.cpp:28:5: error: ‘fout’ was not declared in this scope 28 | fout<<endl; | ^~~~ permpf.cpp: In function ‘void back(int)’: permpf.cpp:33:16: error: ‘n’ was not declared in this scope 33 | for(i=1;i<=n;i++) | ^ permpf.cpp:35:5: error: ‘st’ was not declared in this scope; did you mean ‘std’? 35 | st[k]=i; | ^~ | std permpf.cpp:36:7: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 36 | if(valid(k)) if(solutie(k)) tipar(k); | ^ permpf.cpp: In function ‘int main()’: permpf.cpp:42:10: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 42 | fin>>n; | ^ | yn
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ă.