Borderou de evaluare (job #3337050)

Utilizator anon123andrei popescu anon123 Data 26 ianuarie 2026 21:25:30
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:51:14: error: 'std::tuple<int, int, int> <structured bindings>' has incomplete type 51 | auto [cost, u, v] = pq.top(); | ^~~~~~~~~~~~ main.cpp:55:26: error: no matching function for call to 'std::vector<Edge>::push_back(<brace-enclosed initializer list>)' 55 | rez.push_back({u,v,cost}); | ~~~~~~~~~~~~~^~~~~~~~~~~~ In file included from /usr/include/c++/12.2.1/vector:64, from /usr/include/c++/12.2.1/queue:61, from main.cpp:4: /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 = Edge; _Alloc = std::allocator<Edge>; value_type = Edge]' 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<Edge>::value_type&' {aka 'const Edge&'} 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 = Edge; _Alloc = std::allocator<Edge>; value_type = Edge]' 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<Edge>::value_type&&' {aka 'Edge&&'} 1293 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ /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<void>]' main.cpp:46:81: 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); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/12.2.1/bits/stl_algobase.h:64, from /usr/include/c++/12.2.1/algorithm:60, from main.cpp:1: /usr/include/c++/12.2.1/bits/stl_pair.h:90:11: note: declaration of 'class std::tuple<int, int, int>' 90 | class tuple; | ^~~~~ In file included from /usr/include/c++/12.2.1/bits/stl_pair.h:60: /usr/include/c++/12.2.1/type_traits: In substitution of 'template<class _Tp, class ... _Args> using __is_nothrow_constructible_impl = std::__bool_constant<__is_nothrow_constructible(_Tp)> [with _Tp = std::tuple<int, int, int>; _Args = {int&, int&, int&}]': /usr/include/c++/12.2.1/type_traits:1047:12: required from 'struct std::is_nothrow_constructible<std::tuple<int, int, int>, int&, int&, int&>' /usr/include/c++/12.2.1/bits/alloc_traits.h:513:57: required from 'static constexpr void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::tuple<int, int, int>; _Args = {int&, int&, int&}; _Tp = std::tuple<int, int, int>; allocator_type = std::allocator<std::tuple<int, int, int> >]' /usr/include/c++/12.2.1/bits/vector.tcc:117:30: required from 'constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&, int&}; _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; reference = std::tuple<int, int, int>&]' /usr/include/c++/12.2.1/bits/stl_queue.h:756:18: required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::emplace(_Args&& ...) [with _Args = {int&, int&, int&}; _Tp = std::tuple<int, int, int>; _Sequence = std::vector<std::tuple<int, int, int> >; _Compare = std::greater<void>]' main.cpp:48:19: required from here /usr/include/c++/12.2.1/type_traits:1042:25: error: invalid use of incomplete type 'class std::tuple<int, int, int>' 1042 | = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/stl_pair.h:90:11: note: declaration of 'class std::tuple<int, int, int>' 90 | class tuple; | ^~~~~ /usr/include/c++/12.2.1/type_traits: In instantiation of 'struct std::is_nothrow_constructible<std::tuple<int, int, int>, int&, int&, int&>': /usr/include/c++/12.2.1/bits/alloc_traits.h:513:57: required from 'static constexpr void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::tuple<int, int, int>; _Args = {int&, int&, int&}; _Tp = std::tuple<int, int, int>; allocator_type = std::allocator<std::tuple<int, int, int> >]' /usr/include/c++/12.2.1/bits/vector.tcc:117:30: required from 'constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&, int&}; _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; reference = std::tuple<int, int, int>&]' Non zero exit status: 1

Ceva nu functioneaza?