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

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:44:22: 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 start = a.rbegin();
| ~~~~~~~~^~
| |
| std::map<int, int>::reverse_iterator {aka std::reverse_iterator<std::_Rb_tree_iterator<std::pair<const int, int> > >}
swords.cpp:45:24: error: base operand of ‘->’ is not a pointer
45 | int start_x = start->second;
| ^~
swords.cpp:46:9: error: expected ‘;’ before ‘for’
46 | start++
| ^
| ;
47 | for (start; p != a.rend(); p++) {
| ~~~
swords.cpp:47:14: error: ‘p’ was not declared in this scope
47 | for (start; p != a.rend(); p++) {
|