Borderou de evaluare (job #3284301)

Utilizator alecu2008Alecu Alexandru alecu2008 Data 11 martie 2025 13:46:21
Problema Diametrul unui arbore Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:26:6: error: redefinition of 'void dfs(int, int)' 26 | void dfs(int nod,int niv){ | ^~~ main.cpp:16:6: note: 'void dfs(int, int)' previously defined here 16 | void dfs(int nod,int niv){ | ^~~ main.cpp: In function 'int main()': main.cpp:43:17: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int') 43 | graf[x]=y; | ^ In file included from /usr/include/c++/12.2.1/vector:70, from /usr/include/c++/12.2.1/functional:62, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:71, from main.cpp:2: /usr/include/c++/12.2.1/bits/vector.tcc:204:5: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 204 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/vector.tcc:205:42: note: no known conversion for argument 1 from 'int' to 'const std::vector<int>&' 205 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/12.2.1/vector:64: /usr/include/c++/12.2.1/bits/stl_vector.h:761:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 761 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:761:26: note: no known conversion for argument 1 from 'int' to 'std::vector<int>&&' 761 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:783:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 783 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:783:46: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<int>' 783 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ main.cpp:44:17: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int') 44 | graf[y]=x; | ^ /usr/include/c++/12.2.1/bits/vector.tcc:204:5: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 204 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/vector.tcc:205:42: note: no known conversion for argument 1 from 'int' to 'const std::vector<int>&' 205 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:761:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 761 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:761:26: note: no known conversion for argument 1 from 'int' to 'std::vector<int>&&' 761 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:783:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 783 | operator=(initializer_list<value_type> __l) Non zero exit status: 1

Ceva nu functioneaza?