Problem gotoschool
User nmluan
Submission Time 2025-01-16 12:33:36
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:7: error: ‘struct std::pair<int, int>’ has no member named ‘sort’
11 | a.sort(a+1,a+n+1);
| ^~~~
gotoschool.cpp:11:13: error: no match for ‘operator+’ (operand types are ‘std::pair<int, int>’ and ‘int’)
11 | a.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/