Problem troubles
User shoryu386
Submission Time 2024-02-04 16:23:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

troubles.cpp: In function ‘void solve()’:
troubles.cpp:32:41: error: no match for ‘operator[]’ (operand types are ‘std::map<long long int, long long int>’ and ‘std::pair<long long int, long long int>’)
32 | if (hmm.count(arr[x].second) == 0) hmm[arr[x]].second = dp[x-1];
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from troubles.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 = long long int; _Tp = long long int; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = long long int; std::map<_Key, _Tp, _Compare, _Al