#1157
KSort2
Se dă un vector cu n
elemente, numere naturale și un număr k
. Ordonați crescător primele k
elemente ale vectorului și descrescător ultimele n-k
elemente.
Pentru sortare se va folosit metoda QuickSort sau MergeSort.
Problema | KSort2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36934577 | Utilizator | |
Fișier | ksort2.cpp | Dimensiune | 1.87 KB |
Data încărcării | 01 Iunie 2022, 22:04 | Scor / rezultat | Eroare de compilare |
ksort2.cpp: In function 'int main()': ksort2.cpp:67:5: error: reference to 'cin' is ambiguous cin >> n >> m; ^ ksort2.cpp:5:10: note: candidates are: std::ifstream cin ifstream cin("clatite.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ ksort2.cpp:95:5: error: reference to 'cout' is ambiguous cout << m-n+1 << endl; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ksort2.cpp:96:5: error: reference to 'cout' is ambiguous cout << c << ' '; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ksort2.cpp:97:5: error: reference to 'cout' is ambiguous cout << g << ' '; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ksort2.cpp:98:5: error: reference to 'cout' is ambiguous cout << ing << ' '; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ksort2.cpp:99:5: error: reference to 'cout' is ambiguous cout << z << ' '; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ ksort2.cpp:100:5: error: reference to 'cout' is ambiguous cout << s << ' '; ^ ksort2.cpp:6:10: note: candidates are: std::ofstream cout ofstream cout("clatite.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from ksort2.cpp:1: /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 KSort2 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ă.