railroad.cpp: In function 'll plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:22:10: error: no match for 'operator[]' (operand types are 'std::map<long long int, long long int>' and 'std::_Rb_tree_iterator<std::pair<const long long int, long long int> >')
22 | m[iter] = -1000;
| ^
In file included from /usr/include/c++/10/map:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from railroad.cpp:1:
/usr/include/c++/10/bits/stl_map.h:492: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, _Alloc>::key_type = long long int]'
492 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_map.h:492:34: note: no known conversion for argument 1 from 'std::_Rb_tree_iterator<std::pair<const long long int, long long int> >' to 'const key_type&' {aka 'const long long int&'}
492 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_map.h:512:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::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, _Alloc>::key_type = long long int]'
512 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_map.h:512:29: note: no known conversion for argument 1 from 'std::_Rb_tree_iterator<std::pair<const long long int, long long int> >' to 'std::map<long long int, long long int>::key_type&&' {aka 'long long int&&'}
512 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
railroad.cpp:17:8: warning: unused variable 'res' [-Wunused-variable]
17 | ll res = 0;
| ^~~