Borderou de evaluare (job #3135367)

Utilizator NashikAndrei Feodorov Nashik Data 2 iunie 2023 23:18:54
Problema BFS - Parcurgere in latime Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In member function 'void Graph::bfs(std::vector<int>)': main.cpp:85:18: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::vector<int>') 85 | reachable[source]=0; | ^ In file included from /usr/include/c++/12.2.1/vector:64, from main.cpp:6: /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 '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 '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?