Problem duckhunt25
User JoshJuice
Submission Time 2025-12-22 13:39:16
Score 0
Max Time N/A
Max Memory N/A

Compile Error

duckhunt25.cpp: In function ‘int main()’:
duckhunt25.cpp:30:36: error: no match for ‘operator[]’ (operand types are ‘std::map<std::vector<int>, std::vector<int> >’ and ‘__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type’ {aka ‘std::vector<long long int>’})
30 | for (int i = 0; i < n; ++i) where[b[i]].pb(i);
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from duckhunt25.cpp:1:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::vector<int>; _Tp = std::vector<int>; _Compare = std::less<std::vector<int> >; _Alloc = std::allocator<std::p