Problem makingparallelograms
User Hengweezy
Submission Time 2024-01-31 17:00:40
Score 0
Max Time N/A
Max Memory N/A

Compile Error

makingparallelograms.cpp: In function ‘int main()’:
makingparallelograms.cpp:19:17: error: no match for ‘operator[]’ (operand types are ‘std::map<int, int>’ and ‘std::pair<const int, int>’)
19 | pairs += lines[*cur] /2;
| ^
In file included from /usr/include/c++/9/map:61,
from makingparallelograms.cpp:2:
/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 = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]’
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conversion for argument 1 from ‘std::pai