Problem gotoschool
User nmluan
Submission Time 2025-01-16 12:34:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gotoschool.cpp: In function ‘int main()’:
gotoschool.cpp:8:17: error: no match for ‘operator[]’ (operand types are ‘std::pair<int, int>’ and ‘int’)
8 | cin >> a[i].first();
| ^
gotoschool.cpp:9:10: error: no match for ‘operator[]’ (operand types are ‘std::pair<int, int>’ and ‘int’)
9 | a[i].second = i;
| ^
gotoschool.cpp:11:11: error: no match for ‘operator+’ (operand types are ‘std::pair<int, int>’ and ‘int’)
11 | sort(a+1,a+n+1);
| ~^~
| | |
| | int
| 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 gotoschool.cpp:1:
/usr/include/c++