#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 | #64245362 | Utilizator | |
| Fișier | permpf.cpp | Dimensiune | 879 B |
| Data încărcării | 25 Aprilie 2026, 12:20 | Scor/rezultat | 100 puncte |
permpf.cpp: In function ‘void afis(int)’: permpf.cpp:9:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(int i=1; i<=k; i++) | ^~~ permpf.cpp:11:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | fout<<endl; | ^~~~ permpf.cpp: In function ‘bool ok(int)’: permpf.cpp:18:6: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 18 | for(int i=1; i<=k-1; i++) | ^~~ permpf.cpp:21:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 21 | return 1; | ^~~~~~ permpf.cpp: In function ‘void backtracking(int)’: permpf.cpp:36:15: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 36 | if(ok(k)==1) | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.002 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 30 | 30 | ||
| 4 | 0.034 secunde | OK. | 30 | 30 | ||
| Punctaj total | 100 | |||||
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ă.