Problem swords
User boomphcoding
Submission Time 2024-01-29 16:22:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:18:3: error: ‘sort’ was not declared in this scope; did you mean ‘qsort’?
18 | sort(swords.begin(),swords.end());
| ^~~~
| qsort
swords.cpp:22:25: error: request for member ‘first’ in ‘swords.std::map<int, int>::operator[](i)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
22 | int key = swords[i].first;
| ^~~~~
swords.cpp:23:27: error: request for member ‘second’ in ‘swords.std::map<int, int>::operator[](i)’, which is of non-class type ‘std::map<int, int>::mapped_type’ {aka ‘int’}
23 | int value = swords[i].second;
| ^~~~~~