#2126
NrMaxInterv
Se consideră n
intervale de numere întregi [A
i
, B
i
]
, 1≤i≤n
. Să se determine numărul maxim de intervale care se suprapun (au cel puțin o valoare comună).
din folclor
Problema | NrMaxInterv | Operații I/O |
nrmaxinterv.in /nrmaxinterv.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
Id soluție | #44742297 | Utilizator | |
Fișier | nrmaxinterv.cpp | Dimensiune | 788 B |
Data încărcării | 20 Septembrie 2023, 19:14 | Scor / rezultat | Eroare de compilare |
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrmaxinterv.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = bool (*)(const int*, const int*)]': /usr/include/c++/4.8/bits/stl_algo.h:2226:70: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:5500:55: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' nrmaxinterv.cpp:19:41: required from here /usr/include/c++/4.8/bits/stl_algo.h:2162:11: error: array must be initialized with a brace-enclosed initializer __val = _GLIBCXX_MOVE(*__i); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from nrmaxinterv.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:2164:17: error: invalid array assignment *__first = _GLIBCXX_MOVE(__val); ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from nrmaxinterv.cpp:1: /usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]': /usr/include/c++/4.8/bits/stl_algo.h:1946:47: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:5349:59: required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:2332:68: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int (*)[2]; _Size = int; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:5499:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' nrmaxinterv.cpp:19:41: required from here /usr/include/c++/4.8/bits/stl_heap.h:446:25: error: array must be initialized with a brace-enclosed initializer _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent)); ^ /usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = bool (*)(const int*, const int*)]': /usr/include/c++/4.8/bits/stl_algo.h:1949:50: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:5349:59: required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:2332:68: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int (*)[2]; _Size = int; _Compare = bool (*)(const int*, const int*)]' /usr/include/c++/4.8/bits/stl_algo.h:5499:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int (*)[2]; _Compare = bool (*)(const int*, const int*)]' nrmaxinterv.cpp:19:41: required from here /usr/include/c++/4.8/bits/stl_heap.h:339:28: error: array must be initialized with a brace-enclosed initializer _ValueType __value = _GLIBCXX_MOVE(*__result); ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0, from /usr/include/c++/4.8/algorithm:62, from nrmaxinterv.cpp:2: /usr/include/c++/4.8/bits/stl_heap.h:340:17: error: invalid array assignment *__result = _GLIBCXX_MOVE(*__first); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrMaxInterv 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ă.