#124
Permutari1
Se citeşte un număr natural nenul n
. Să se afişeze, în ordine invers lexicografică, permutările mulţimii {1,2,..,n}
.
Problema | Permutari1 | Operații I/O |
permutari1.in /permutari1.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53292087 | Utilizator | |
Fișier | permutari1.cpp | Dimensiune | 696 B |
Data încărcării | 23 Octombrie 2024, 16:21 | Scor / rezultat | Eroare de compilare |
permutari1.cpp:4:10: error: expected unqualified-id before string constant ifstream("permutari1.in") ^ permutari1.cpp:4:10: error: expected ')' before string constant permutari1.cpp: In function 'void init(int)': permutari1.cpp:9:4: error: 'sol' was not declared in this scope { sol[k]=n+1; ^ permutari1.cpp:9:11: error: 'n' was not declared in this scope { sol[k]=n+1; ^ permutari1.cpp: In function 'int succesor(int)': permutari1.cpp:13:8: error: 'sol' was not declared in this scope { if (sol[k]>1) ^ permutari1.cpp: In function 'int valid(int)': permutari1.cpp:20:9: error: 'sol' was not declared in this scope if(sol[i]==sol[k]) ^ permutari1.cpp: In function 'int solutie(int)': permutari1.cpp:26:14: error: 'n' was not declared in this scope { return k==n; ^ permutari1.cpp: In function 'void afisare(int)': permutari1.cpp:30:26: error: 'cout' was not declared in this scope { for(int i=1;i<=k;i++) cout<<sol[i]<<" "; ^ permutari1.cpp:30:32: error: 'sol' was not declared in this scope { for(int i=1;i<=k;i++) cout<<sol[i]<<" "; ^ permutari1.cpp:31:4: error: 'cout' was not declared in this scope cout<<"\n"; ^ permutari1.cpp: In function 'void back(int)': permutari1.cpp:37:10: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(valid(k)) ^ permutari1.cpp: In function 'int main()': permutari1.cpp:43:4: error: 'cin' was not declared in this scope { cin>>n; ^ permutari1.cpp:43:9: error: 'n' was not declared in this scope { cin>>n; ^ permutari1.cpp: In function 'int succesor(int)': permutari1.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ permutari1.cpp: In function 'int solutie(int)': permutari1.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Permutari1 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ă.