Problem longesttrip
User Informatics271
Submission Time 2026-05-21 09:07:30
Score 0
Max Time N/A
Max Memory N/A

Compile Error

In file included from /usr/include/c++/9/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:33,
from longesttrip.cpp:2:
longesttrip.cpp: In function ‘std::vector<int> longest_trip(int, int)’:
longesttrip.cpp:54:69: error: could not convert ‘{anonymous}::pa.std::vector<int>::operator[](((std::vector<int>::size_type)i))’ from ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} to ‘std::vector<int>’
54 | for (int i=0;i<pa.size()-1;i++) assert(are_connected(pa[i],pa[i+1]));
| ^
| |
| __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}