#3975
Intervale_AB
Dându-se N
intervale [a, b]
, calculați numărul maxim de astfel de intervale care se intersectează în cel puțin un punct.
ad-hoc
Problema | Intervale_AB | Operații I/O |
intervale.in /intervale.out
|
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #54746172 | Utilizator | |
Fișier | intervale_ab.cpp | Dimensiune | 787 B |
Data încărcării | 07 Decembrie 2024, 10:56 | Scor / rezultat | Eroare de compilare |
intervale_ab.cpp: In function 'int main()': intervale_ab.cpp:21:45: error: wrong number of template arguments (0, should be 1) priority_queue<int, vector<int>, greater<>> pq; ^ In file included from /usr/include/c++/4.8/string:48:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from intervale_ab.cpp:1: /usr/include/c++/4.8/bits/stl_function.h:222:12: error: provided for 'template<class _Tp> struct std::greater' struct greater : public binary_function<_Tp, _Tp, bool> ^ intervale_ab.cpp:21:46: error: template argument 3 is invalid priority_queue<int, vector<int>, greater<>> pq; ^ intervale_ab.cpp:21:51: error: invalid type in declaration before ';' token priority_queue<int, vector<int>, greater<>> pq; ^ intervale_ab.cpp:29:8: error: request for member 'push' in 'pq', which is of non-class type 'int' pq.push(a[1].j); ^ intervale_ab.cpp:32:19: error: request for member 'empty' in 'pq', which is of non-class type 'int' while(!pq.empty() && pq.top() < a[i].i) { ^ intervale_ab.cpp:32:33: error: request for member 'top' in 'pq', which is of non-class type 'int' while(!pq.empty() && pq.top() < a[i].i) { ^ intervale_ab.cpp:33:16: error: request for member 'pop' in 'pq', which is of non-class type 'int' pq.pop(); ^ intervale_ab.cpp:35:12: error: request for member 'push' in 'pq', which is of non-class type 'int' pq.push(a[i].j); ^ intervale_ab.cpp:36:45: error: request for member 'size' in 'pq', which is of non-class type 'int' maxi = max(maxi,static_cast<int>(pq.size())); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Intervale_AB 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ă.