#2720
BucketSort
Metoda Bucket Sort constă în distribuirea elementelor în mai multe grupe, numite “bucket-uri”. Apoi fiecare bucket este sortat individual folosind un algoritm de sortare oarecare.
Problema | BucketSort | Operații I/O |
bucketsort.in /bucketsort.out
|
---|---|---|---|
Limita timp | 0.04 secunde | Limita memorie |
Total: 1.5 MB
/
Stivă 1 MB
|
Id soluție | #54145578 | Utilizator | |
Fișier | bucketsort.cpp | Dimensiune | 466 B |
Data încărcării | 20 Noiembrie 2024, 18:54 | Scor / rezultat | Eroare de compilare |
bucketsort.cpp:5:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("bucketsort.in"); ^ bucketsort.cpp:6:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("bucketsort.out"); ^ bucketsort.cpp: In function 'int main()': bucketsort.cpp:13:5: error: reference to 'cin' is ambiguous cin >> n; ^ bucketsort.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("bucketsort.in"); ^ In file included from bucketsort.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ bucketsort.cpp:15:9: error: reference to 'cin' is ambiguous cin >> a[i]; ^ bucketsort.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("bucketsort.in"); ^ In file included from bucketsort.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ bucketsort.cpp:17:5: error: reference to 'cin' is ambiguous cin >> d; ^ bucketsort.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("bucketsort.in"); ^ In file included from bucketsort.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ bucketsort.cpp:18:19: error: 'sort' was not declared in this scope sort(a , a + n); ^ bucketsort.cpp:21:13: error: reference to 'cout' is ambiguous cout << a[i] << ' '; ^ bucketsort.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("bucketsort.out"); ^ In file included from bucketsort.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ bucketsort.cpp:24:13: error: reference to 'cout' is ambiguous cout << a[i] << ' '; ^ bucketsort.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("bucketsort.out"); ^ In file included from bucketsort.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 BucketSort 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ă.