Problem swords
User thelusidian
Submission Time 2025-01-22 16:45:10
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:10:10: error: ‘class std::vector<std::pair<int, int> >’ has no member named ‘pushback’; did you mean ‘push_back’?
10 | swords.pushback({atk,def});
| ^~~~~~~~
| push_back
swords.cpp:13:25: error: no match for ‘operator+’ (operand types are ‘std::vector<std::pair<int, int> >’ and ‘long int’)
13 | sort(swords, swords + n, greater<int>());
| ~~~~~~ ^ ~
| | |
| | long int
| std::vector<std::pair<int, int> >
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from swords.cpp:1:
/usr/include/c++/