#1901
Median_Heaps
Se dă un vector de N
numere naturale nenule, indexat de la 1
.
Se cere să se raspundă la Q
interogări de tipul:
[l, r]
din vector, aflați costul total mimin, al egalizării tuturor elementelor din interval.ad-hoc
Problema | Median_Heaps | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1.5 secunde | Limita memorie |
Total: 8 MB
/
Stivă 1 MB
|
Id soluție | #53535286 | Utilizator | |
Fișier | median_heaps.cpp | Dimensiune | 8.06 KB |
Data încărcării | 04 Noiembrie 2024, 15:22 | Scor / rezultat | Eroare de compilare |
In file included from /usr/include/c++/4.8/algorithm:62:0, from median_heaps.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Queries*, std::vector<Queries> >; _Tp = Queries; _Compare = processQuery()::__lambda0]': /usr/include/c++/4.8/bits/stl_algo.h:2296:78: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Queries*, std::vector<Queries> >; _Compare = processQuery()::__lambda0]' /usr/include/c++/4.8/bits/stl_algo.h:2337:62: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Queries*, std::vector<Queries> >; _Size = int; _Compare = processQuery()::__lambda0]' /usr/include/c++/4.8/bits/stl_algo.h:5499:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<Queries*, std::vector<Queries> >; _Compare = processQuery()::__lambda0]' median_heaps.cpp:244:6: required from here /usr/include/c++/4.8/bits/stl_algo.h:2263:35: error: no match for call to '(processQuery()::__lambda0) (Queries&, const Queries&)' while (__comp(*__first, __pivot)) ^ median_heaps.cpp:239:43: note: candidate is: sort(query.begin(),query.end(),[length](Queries &a, Queries &b) ^ median_heaps.cpp:239:67: note: processQuery()::__lambda0 sort(query.begin(),query.end(),[length](Queries &a, Queries &b) ^ median_heaps.cpp:239:67: note: no known conversion for argument 2 from 'const Queries' to 'Queries&' In file included from /usr/include/c++/4.8/algorithm:62:0, from median_heaps.cpp:5: /usr/include/c++/4.8/bits/stl_algo.h:2266:34: error: no match for call to '(processQuery()::__lambda0) (const Queries&, Queries&)' while (__comp(__pivot, *__last)) ^ median_heaps.cpp:239:43: note: candidate is: sort(query.begin(),query.end(),[length](Queries &a, Queries &b) ^ median_heaps.cpp:239:67: note: processQuery()::__lambda0 sort(query.begin(),query.end(),[length](Queries &a, Queries &b) ^ median_heaps.cpp:239:67: note: no known conversion for argument 1 from 'const Queries' to 'Queries&'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Median_Heaps 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ă.