Borderou de evaluare (job #3179674)

Utilizator ZahaZaharie Stefan Zaha Data 3 decembrie 2023 23:55:30
Problema Rusuoaica Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In constructor 'Graph::Graph(size_t, int)': main.cpp:14:30: warning: 'Graph::rank' will be initialized after [-Wreorder] 14 | std::vector<int> parent, rank; | ^~~~ main.cpp:14:22: warning: 'std::vector<int> Graph::parent' [-Wreorder] 14 | std::vector<int> parent, rank; | ^~~~~~ main.cpp:44:5: warning: when initialized here [-Wreorder] 44 | Graph(size_t num_stations, int build_price) | ^~~~~ main.cpp: In member function 'void Graph::add_tunnel(int, int, int)': main.cpp:50:48: error: invalid use of incomplete type 'edge' {aka 'class std::tuple<int, int, int>'} 50 | tunnels.emplace_back(edge({x, y, price})); | ^ 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 'edge' {aka 'class std::tuple<int, int, int>'} 90 | class tuple; | ^~~~~ main.cpp: In lambda function: main.cpp:56:76: error: no matching function for call to 'get<2>(const edge&)' 56 | [this](const edge &a, const edge &b) { return std::get<2>(a) > std::get<2>(b); }); | ~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:855:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)' 855 | get(pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:855:5: note: template argument deduction/substitution failed: main.cpp:56:76: note: types 'std::pair<_Tp1, _Tp2>' and 'const edge' {aka 'const std::tuple<int, int, int>'} have incompatible cv-qualifiers 56 | [this](const edge &a, const edge &b) { return std::get<2>(a) > std::get<2>(b); }); | ~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:860:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)' 860 | get(pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:860:5: note: template argument deduction/substitution failed: main.cpp:56:76: note: types 'std::pair<_Tp1, _Tp2>' and 'const edge' {aka 'const std::tuple<int, int, int>'} have incompatible cv-qualifiers 56 | [this](const edge &a, const edge &b) { return std::get<2>(a) > std::get<2>(b); }); | ~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:865:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)' 865 | get(const pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:865:5: note: template argument deduction/substitution failed: main.cpp:56:76: note: 'const edge' {aka 'const std::tuple<int, int, int>'} is not derived from 'const std::pair<_Tp1, _Tp2>' 56 | [this](const edge &a, const edge &b) { return std::get<2>(a) > std::get<2>(b); }); | ~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:870:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)' 870 | get(const pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/12.2.1/bits/stl_pair.h:870:5: note: template argument deduction/substitution failed: main.cpp:56:76: note: 'const edge' {aka 'const std::tuple<int, int, int>'} is not derived from 'const std::pair<_Tp1, _Tp2>' Non zero exit status: 1

Ceva nu functioneaza?