ID 5937155
Пользователь Борцов Роман Александрович
Время 19:31<< 26.12.2021 19:33 (22 д. 19:33) 27.12.2021 13:05>>
Обработка 19:33 ... 19:33 (3,04 сек.)
Файл 5937155.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 3, осень 2021
Задача D: Graph visitor
Набор тестов
Ограничения Время: 1с Память: 4000Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
main.cpp: In function 'int main()':
main.cpp:58:3: error: static assertion failed
   static_assert(sizeof(BfsVisitor<char>) <= 2*sizeof(char*));
   ^~~~~~~~~~~~~
In file included from main.cpp:55:0:
visitor.h: In instantiation of 'size_t BfsVisitor<Vertex>::DistanceTo(const Vertex&) const [with Vertex = int; size_t = long unsigned int]':
main.cpp:65:29:   required from here
visitor.h:20:48: error: passing 'const std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >' as 'this' argument discards qualifiers [-fpermissive]
               Vertex parent_of_target = parent_[current_target];
                                         ~~~~~~~^
In file included from /usr/include/c++/7/map:61:0,
                 from visitor.h:1,
                 from main.cpp:55:
/usr/include/c++/7/bits/stl_map.h:484:7: note:   in call to 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
       operator[](const key_type& __k)
       ^~~~~~~~
In file included from main.cpp:55:0:
visitor.h: In instantiation of 'Vertex BfsVisitor<Vertex>::Parent(const Vertex&) const [with Vertex = int]':
main.cpp:68:25:   required from here
visitor.h:30:25: error: passing 'const std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >' as 'this' argument discards qualifiers [-fpermissive]
           return parent_[vertex];
                  ~~~~~~~^
In file included from /usr/include/c++/7/map:61:0,
                 from visitor.h:1,
                 from main.cpp:55:
/usr/include/c++/7/bits/stl_map.h:484:7: note:   in call to 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
       operator[](const key_type& __k)
       ^~~~~~~~
0.103s 0.011s 9