Problem perm2
User shenshiqi
Submission Time 2026-07-24 15:08:29
Score 0
Max Time N/A
Max Memory N/A

Compile Error

encode.cpp: In function ‘std::vector<std::pair<int, int> > encode(std::vector<int>)’:
encode.cpp:24:34: error: ‘p’ was not declared in this scope
24 | if (i == 0) G.push_back({p[i], n});
| ^
encode.cpp:24:42: error: no matching function for call to ‘std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)’
24 | if (i == 0) G.push_back({p[i], n});
| ^
In file included from /usr/include/c++/9/vector:67,
from encode.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]’
1184 | push_back(const value_type& __x)
|