Borderou de evaluare (job #3202033)

Utilizator nicholas9onicaOnica Nicholas Andrei nicholas9onica Data 10 februarie 2024 13:23:31
Problema Sortare topologica 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:38:17: error: no match for 'operator[]' (operand types are 'std::vector<int>' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 38 | grad[g[nod]]--; | ^ 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:1121:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]' 1121 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1121:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1121 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1140:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]' 1140 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1140:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1140 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ main.cpp:39:20: error: no match for 'operator[]' (operand types are 'std::vector<int>' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 39 | if(grad[g[nod]]==0) | ^ /usr/include/c++/12.2.1/bits/stl_vector.h:1121:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]' 1121 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1121:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1121 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1140:7: note: candidate: 'constexpr std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]' 1140 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1140:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::vector<int>::size_type' {aka 'long unsigned int'} 1140 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ Non zero exit status: 1

Ceva nu functioneaza?