Problem swords
User nutzzzz
Submission Time 2025-01-21 21:00:44
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:44:18: error: cannot convert ‘std::map<int, int>::reverse_iterator’ {aka ‘std::reverse_iterator<std::_Rb_tree_iterator<std::pair<const int, int> > >’} to ‘int’ in initialization
44 | int p = a.rbegin();
| ~~~~~~~~^~
| |
| std::map<int, int>::reverse_iterator {aka std::reverse_iterator<std::_Rb_tree_iterator<std::pair<const int, int> > >}
swords.cpp:45:20: error: base operand of ‘->’ is not a pointer
45 | int start_x = p->second;
| ^~
swords.cpp:46:2: error: ‘start’ was not declared in this scope; did you mean ‘start_x’?
46 | start++;
| ^~~~~
| start_x
swords.cpp:47:16: error: no match for ‘operator!=’ (operand types are ‘int’ and ‘std::map<int, int>::reverse_iterator’ {aka ‘std::reverse_iterator<std::_Rb_tree_iterator<std