Borderou de evaluare (job #3255357)
Utilizator | Data | 10 noiembrie 2024 14:08:38 | |
---|---|---|---|
Problema | Arbore partial de cost minim | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:32:16: error: no matching function for call to 'std::priority_queue<std::tuple<int, int, int>, std::vector<std::tuple<int, int, int> >, std::greater<std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
32 | pq.push({cost, a, b});
| ~~~~~~~^~~~~~~~~~~~~~
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::tuple<int, int, int>; _Sequence = std::vector<std::tuple<int, int, int> >; _Compare = std::greater<std::tuple<int, int, int> >; value_type = std::tuple<int, int, int>]'
738 | push(const value_type& __x)
| ^~~~
/usr/include/c++/12.2.1/bits/stl_queue.h:738:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::priority_queue<std::tuple<int, int, int>, std::vector<std::tuple<int, int, int> >, std::greater<std::tuple<int, int, int> > >::value_type&' {aka 'const std::tuple<int, int, int>&'}
738 | push(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/12.2.1/bits/stl_queue.h:746:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::tuple<int, int, int>; _Sequence = std::vector<std::tuple<int, int, int> >; _Compare = std::greater<std::tuple<int, int, int> >; value_type = std::tuple<int, int, int>]'
746 | push(value_type&& __x)
| ^~~~
/usr/include/c++/12.2.1/bits/stl_queue.h:746:25: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<std::tuple<int, int, int>, std::vector<std::tuple<int, int, int> >, std::greater<std::tuple<int, int, int> > >::value_type&&' {aka 'std::tuple<int, int, int>&&'}
746 | push(value_type&& __x)
| ~~~~~~~~~~~~~^~~
main.cpp:38:37: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
38 | while(!pq.empty() && mst.size() < n-1)
| ~~~~~~~~~~~^~~~~
main.cpp:40:14: error: 'std::tuple<int, int, int> <structured bindings>' has incomplete type
40 | auto [cost, a, b] = pq.top();
| ^~~~~~~~~~~~
main.cpp:45:26: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)'
45 | mst.push_back({a, b});
| ~~~~~~~~~~~~~^~~~~~~~
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:1276:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
1276 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:1276:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
1276 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/12.2.1/bits/stl_vector.h:1293:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
1293 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h:1293:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
1293 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
main.cpp:50:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
50 | for(int i=0;i<mst.size();i++)
| ~^~~~~~~~~~~
/usr/include/c++/12.2.1/bits/stl_vector.h: In instantiation of 'constexpr std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]':
/usr/include/c++/12.2.1/bits/stl_vector.h:526:7: required from 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue() [with _Seq = std::vector<std::tuple<int, int, int> >; _Requires = void; _Tp = std::tuple<int, int, int>; _Sequence = std::vector<std::tuple<int, int, int> >; _Compare = std::greater<std::tuple<int, int, int> >]'
main.cpp:7:99: required from here
/usr/include/c++/12.2.1/bits/stl_vector.h:367:49: error: invalid use of incomplete type 'class std::tuple<int, int, int>'
367 | _M_impl._M_end_of_storage - _M_impl._M_start);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !