#4354
HalfSortQS
Se dă un vector cu n
elemente numere întregi nenule.
Să se ordoneze crescător subșirul format din elementele negative din vector și descrescător subșirul format din elementele pozitive.
Problema | HalfSortQS | Operații I/O |
halfsortqs.in /halfsortqs.out
|
---|---|---|---|
Limita timp | 0.8 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54802495 | Utilizator | |
Fișier | halfsortqs.cpp | Dimensiune | 703 B |
Data încărcării | 09 Decembrie 2024, 10:33 | Scor / rezultat | Eroare de compilare |
halfsortqs.cpp: In function 'int main()': halfsortqs.cpp:13:5: error: reference to 'cin' is ambiguous cin >> n; ^ halfsortqs.cpp:6:10: note: candidates are: std::ifstream cin ifstream cin("halfsortqs.in"); ^ In file included from halfsortqs.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ halfsortqs.cpp:17:9: error: reference to 'cin' is ambiguous cin >> x; ^ halfsortqs.cpp:6:10: note: candidates are: std::ifstream cin ifstream cin("halfsortqs.in"); ^ In file included from halfsortqs.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ halfsortqs.cpp:22:24: error: 'sort' was not declared in this scope sort(neg, neg + ind); ^ halfsortqs.cpp:29:13: error: reference to 'cout' is ambiguous cout << neg[k] << ' '; ^ halfsortqs.cpp:7:10: note: candidates are: std::ofstream cout ofstream cout("halfsortqs.out"); ^ In file included from halfsortqs.cpp:2:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ halfsortqs.cpp:32:14: error: reference to 'cout' is ambiguous else cout << poz[c] << ' ', c++; ^ halfsortqs.cpp:7:10: note: candidates are: std::ofstream cout ofstream cout("halfsortqs.out"); ^ In file included from halfsortqs.cpp:2: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 HalfSortQS 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ă.