Problem swords
User tanish
Submission Time 2024-02-23 21:10:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

swords.cpp: In function ‘int main()’:
swords.cpp:12:9: error: ‘struct std::pair<int, int>’ has no member named ‘push_back’
12 | sword.push_back(make_pair(a,d));
| ^~~~~~~~~
swords.cpp:16:18: error: no match for ‘operator+’ (operand types are ‘std::pair<int, int>’ and ‘int’)
16 | sort(sword,sword+n);
| ~~~~~^~
| | |
| | int
| std::pair<int, int>
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from swords.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:423:5: note: candidate: ‘template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typ