#202
PermPF
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 | #54161960 | Utilizator | |
Fișier | permpf.cpp | Dimensiune | 671 B |
Data încărcării | 21 Noiembrie 2024, 08:46 | Scor / rezultat | Eroare de compilare |
permpf.cpp:4:14: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin ("permpf.in") ^ permpf.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream fout ("permpf.out") ^ permpf.cpp: In function 'int verifica(int)': permpf.cpp:10:12: error: 's' was not declared in this scope if(s[i]==s[k]) ^ permpf.cpp:12:12: error: 's' was not declared in this scope if(s[k]==k) ^ permpf.cpp: In function 'int Solutie(int)': permpf.cpp:17:9: error: 'n' was not declared in this scope {return n==k;} ^ permpf.cpp: In function 'void afiseaza(int)': permpf.cpp:21:9: error: 'fout' was not declared in this scope fout<<s[i]<<" "; ^ permpf.cpp:21:15: error: 's' was not declared in this scope fout<<s[i]<<" "; ^ permpf.cpp:22:5: error: 'fout' was not declared in this scope fout<<endl; ^ permpf.cpp: In function 'void bkt(int)': permpf.cpp:26:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ permpf.cpp:28:9: error: 's' was not declared in this scope s[k]=i; ^ permpf.cpp:29:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(verifica(k)==1) ^ permpf.cpp: In function 'int main()': permpf.cpp:38:10: error: 'n' was not declared in this scope fin>>n; ^ permpf.cpp: In function 'int Solutie(int)': permpf.cpp:17:14: warning: control reaches end of non-void function [-Wreturn-type] {return n==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ă.