#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 | #64739603 | Utilizator | |
| Fișier | permpf.cpp | Dimensiune | 668 B |
| Data încărcării | 27 Mai 2026, 08:40 | Scor/rezultat | Eroare de compilare |
permpf.cpp:2:1: error: stray ‘##’ in program 2 | ##include <fstream> | ^~ permpf.cpp:2:3: error: ‘include’ does not name a type 2 | ##include <fstream> | ^~~~~~~ permpf.cpp:4:1: error: ‘ifstream’ does not name a type 4 | ifstream fin("permfp.in"); | ^~~~~~~~ permpf.cpp:5:1: error: ‘ofstream’ does not name a type 5 | ofstream fout("permpf.out"); | ^~~~~~~~ permpf.cpp: In function ‘void afisare(int)’: permpf.cpp:22:9: error: ‘fout’ was not declared in this scope 22 | fout<<x[i]<<" "; | ^~~~ permpf.cpp:23:5: error: ‘fout’ was not declared in this scope 23 | fout<<endl; | ^~~~ permpf.cpp:23:11: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’? 23 | fout<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/13/iostream:41, from permpf.cpp:1: /usr/include/c++/13/ostream:735:5: note: ‘std::endl’ declared here 735 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ permpf.cpp: In function ‘void Back(int)’: permpf.cpp:30:12: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 30 | if (valid(k)) | ^ permpf.cpp: In function ‘int main()’: permpf.cpp:41:4: error: ‘fin’ was not declared in this scope 41 | fin>>n; | ^~~
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ă.