#205
Shuffle
Se citeşte un număr natural nenul n
şi o permutare a mulţimii M={1,2,..,n}
. Să se afişeze, în ordine lexicografică, toate permutările mulţimii M care nu conţin elemente alăturate care au fost alăturate şi în permutarea dată.
Problema | Shuffle | Operații I/O |
shuffle.in /shuffle.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54920200 | Utilizator | |
Fișier | shuffle.cpp | Dimensiune | 811 B |
Data încărcării | 12 Decembrie 2024, 10:39 | Scor / rezultat | Eroare de compilare |
shuffle.cpp:4:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("shuffle.in" ); ^ shuffle.cpp:5:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("shuffle.out") ; ^ shuffle.cpp: In function 'void scrie()': shuffle.cpp:11:9: error: reference to 'cout' is ambiguous cout<<sol[i]<<" "; ^ shuffle.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("shuffle.out") ; ^ In file included from shuffle.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ shuffle.cpp:12:5: error: reference to 'cout' is ambiguous cout<<endl; ^ shuffle.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("shuffle.out") ; ^ In file included from shuffle.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ shuffle.cpp: In function 'int main()': shuffle.cpp:47:5: error: reference to 'cin' is ambiguous cin>>n; ^ shuffle.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("shuffle.in" ); ^ In file included from shuffle.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ shuffle.cpp:48:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ shuffle.cpp:50:5: error: reference to 'cin' is ambiguous cin>>x; ^ shuffle.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("shuffle.in" ); ^ In file included from shuffle.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ shuffle.cpp:50:10: error: 'x' was not declared in this scope cin>>x; ^ shuffle.cpp:54:5: error: reference to 'cout' is ambiguous cout<<"nu exista"; ^ shuffle.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("shuffle.out") ; ^ In file included from shuffle.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Shuffle 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ă.