Borderou de evaluare (job #3323733)
| Utilizator | Data | 19 noiembrie 2025 16:48:38 | |
|---|---|---|---|
| Problema | Algoritmul lui Dijkstra | Status | done |
| Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
| Scor | 0 | ||
Raport evaluator
Eroare de compilare:
main.cpp:8:22: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
8 | const int inf = 1<<31-1;
| ~~^~
In file included from /usr/include/c++/12.2.1/vector:64,
from main.cpp:3:
/usr/include/c++/12.2.1/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<std::pair<int, int>, std::greater<std::pair<int, int> > >':
/usr/include/c++/12.2.1/bits/stl_vector.h:423:11: required from 'class std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >'
main.cpp:16:75: required from here
/usr/include/c++/12.2.1/bits/stl_vector.h:88:28: error: no type named 'value_type' in 'struct std::greater<std::pair<int, int> >'
88 | rebind<_Tp>::other _Tp_alloc_type;
| ^~~~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:90:9: error: no type named 'value_type' in 'struct std::greater<std::pair<int, int> >'
90 | pointer;
| ^~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h: In instantiation of 'class std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >':
main.cpp:16:75: required from here
/usr/include/c++/12.2.1/bits/stl_vector.h:438:64: error: no type named 'value_type' in 'struct std::greater<std::pair<int, int> >'
438 | static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
| ^~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:513:20: error: '_M_allocate' has not been declared in 'std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >::_Base'
513 | using _Base::_M_allocate;
| ^~~~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:514:20: error: '_M_deallocate' has not been declared in 'std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >::_Base'
514 | using _Base::_M_deallocate;
| ^~~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:516:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >::_Base'
516 | using _Base::_M_get_Tp_allocator;
| ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/iostream:38,
from main.cpp:1:
/usr/include/c++/12.2.1/bits/stl_vector.h: In instantiation of 'constexpr std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = std::pair<int, int>; _Alloc = std::greater<std::pair<int, int> >]':
/usr/include/c++/12.2.1/type_traits:971:30: required from 'struct std::__is_constructible_impl<std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > >'
/usr/include/c++/12.2.1/type_traits:986:12: required from 'struct std::is_default_constructible<std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > >'
/usr/include/c++/12.2.1/type_traits:167:12: required from 'struct std::__and_<std::is_default_constructible<std::less<std::pair<int, int> > >, std::is_default_constructible<std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > > >'
/usr/include/c++/12.2.1/bits/stl_queue.h:553:43: required by substitution of 'template<class _Seq, class _Requires> std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > >::priority_queue() [with _Seq = std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >; _Requires = <missing>]'
main.cpp:16:78: required from here
/usr/include/c++/12.2.1/bits/stl_vector.h:137:24: error: no type named 'value_type' in 'struct std::greater<std::pair<int, int> >'
137 | _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
| ^~~~~~~~~~~~~~~~~~~~
main.cpp: In function 'void dijkstra(int, int)':
main.cpp:28:29: error: 'class std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > >' has no member named 'top'; did you mean 'pop'?
28 | auto nod_curent = pq.top();
| ^~~
| pop
main.cpp:39:28: error: no matching function for call to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > > >::push(<brace-enclosed initializer list>)'
39 | pq.push({dist[v.first], v.first});
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.1/queue:64,
from main.cpp:4:
/usr/include/c++/12.2.1/bits/stl_queue.h:738:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::greater<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >; value_type = std::pair<int, int>]'
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !
