1. sort
Constraints :

For 30% data : BF
#include
using namespace std;
bool cmp1(int a, int b) {
return ab;
}
int main() {
int N, M;cin >> N >> M;
int A[N];
for (int i=0;i> A[i];
for (int i=0;i> opt >> L >> R;
if (opt==0) sort(A+L-1, A+R, cmp1);
else sort(A+L-1, A+R, cmp2);
}
int Q;cin >> Q;
cout << A[Q-1];
return 0;
}
Complexity : O(n^2)
Expected : 30/70

(However, for most contestants, their score are 80.)