Files
python/GESP/Level4/GESP202409/20240906_4_2.cpp

30 lines
380 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 10010;
int a[N];
/*
5
3 4 5 2 1
3
4 5
3 4
1 3
*/
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
int T;
cin >> T;
while (T--) {
int l, r;
cin >> l >> r;
sort(a + l, a + r + 1);
}
for (int i = 1; i <= n; i++)
cout << a[i] << " ";
return 0;
}