Problem GSS
User Junxian
Submission Time 2026-07-11 09:36:26
Score 0
Max Time N/A
Max Memory N/A

Compile Error

GSS.cpp: In function ‘int main()’:
GSS.cpp:11:8: error: invalid types ‘int[long long int]’ for array subscript
11 | arr[i] = x;
| ^
GSS.cpp:13:33: error: no matching function for call to ‘sort(int&, long long int, std::greater<int>)’
13 | sort(arr, arr+n, greater<int>());
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from GSS.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:4863:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
4863 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/9/bits/stl_algo.h:4863:5: note: template argument deduction/substitution failed:
GSS.cpp:13:33: note: deduced conflicting types for parameter ‘_RAIter’ (‘int’ and ‘long long int’)
13 | sort(arr, ar