#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 | #64268060 | Utilizator | |
| Fișier | permpf.cpp | Dimensiune | 681 B |
| Data încărcării | 27 Aprilie 2026, 11:35 | Scor/rezultat | 100 puncte |
permpf.cpp: In function ‘int valid(int)’: permpf.cpp:11:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 11 | if(v[i]==v[k])return 0;return 1; | ^~ permpf.cpp:11:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 11 | if(v[i]==v[k])return 0;return 1; | ^~~~~~ permpf.cpp:10:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 10 | for(i=1;i<=k-1;i++) | ^~~ permpf.cpp:11:32: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | if(v[i]==v[k])return 0;return 1; | ^~~~~~ permpf.cpp: In function ‘int solutie(int)’: permpf.cpp:15:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 15 | if(k==n) | ^~ permpf.cpp:16:18: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | return 1;return 0; | ^~~~~~ permpf.cpp: In function ‘void afisare(int)’: permpf.cpp:21:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 21 | for(i=1;i<=k;i++)fout<<v[i]<<' ';fout<<'\n'; | ^~~ permpf.cpp:21:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 21 | for(i=1;i<=k;i++)fout<<v[i]<<' ';fout<<'\n'; | ^~~~ permpf.cpp: In function ‘void backt(int)’: permpf.cpp:30:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 30 | if(valid(k)==1) | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 30 | 30 | ||
| 4 | 0.007 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ă.