#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 | #27798422 | Utilizator | |
Fișier | permpf.cpp | Dimensiune | 769 B |
Data încărcării | 11 Februarie 2021, 13:27 | Scor / rezultat | Eroare de compilare |
permpf.cpp: In function 'int valid(int)': permpf.cpp:10:12: error: 'v' was not declared in this scope if(v[i]==v[k]) ^ permpf.cpp:12:9: error: 'v' was not declared in this scope if(v[k]==k) ^ permpf.cpp: In function 'void afisare(int)': permpf.cpp:20:15: error: 'v' was not declared in this scope fout<<v[i]<<' '; ^ permpf.cpp: In function 'int solutie(int)': permpf.cpp:25:12: error: 'l' was not declared in this scope return l==n; ^ permpf.cpp:25:15: error: 'n' was not declared in this scope return l==n; ^ permpf.cpp: In function 'void back(int)': permpf.cpp:30:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ permpf.cpp:32:9: error: 'v' was not declared in this scope v[k]=i; ^ permpf.cpp: In function 'int main()': permpf.cpp:45:9: error: 'n' was not declared in this scope fin>>n; ^ permpf.cpp:49:5: error: 'four' was not declared in this scope four.close(); ^ permpf.cpp: In function 'int solutie(int)': permpf.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.