#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 | #45092885 | Utilizator | |
Fișier | permpf.cpp | Dimensiune | 985 B |
Data încărcării | 02 Octombrie 2023, 17:21 | Scor / rezultat | Eroare de compilare |
permpf.cpp: In function 'void init()': permpf.cpp:8:2: error: 'st' was not declared in this scope {st[k]=0; ^ permpf.cpp: In function 'int succesor()': permpf.cpp:12:8: error: 'st' was not declared in this scope if(st[k]==n) return 0; ^ permpf.cpp: In function 'int valid()': permpf.cpp:18:5: error: 'st' was not declared in this scope {if(st[k]==st[i]) return 0;} ^ permpf.cpp:19:5: error: 'st' was not declared in this scope if(st[k]==k) return 0; ^ permpf.cpp: In function 'void tipar()': permpf.cpp:29:8: error: 'st' was not declared in this scope g<<st[i]<<" "; ^ permpf.cpp: In function 'void backtrack()': permpf.cpp:41:26: error: expected ')' before ';' token else (k++;init();} ^ permpf.cpp: In function 'int main()': permpf.cpp:46:29: error: expected primary-expression at end of input f>> ^ permpf.cpp:46:29: error: expected ';' at end of input permpf.cpp:46:29: error: expected '}' at end of input permpf.cpp: In function 'int succesor()': permpf.cpp:15:16: warning: control reaches end of non-void function [-Wreturn-type] return 1;}} ^
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ă.