8~11 TLE 大佬求调!
查看原帖
8~11 TLE 大佬求调!
1058596
DeepNight_楼主2024/8/11 22:11
#include <bits/stdc++.h>

using namespace std;

const int N = 1e+6;
int n, idx = 0, q[N];

int main(){
	cin >> n;
	while(n --){
		 int x;
		 cin >> x;
		 if(x == 1) {
		 	int y;
		 	cin >> y;
		 	q[idx ++ ] = y;
		 }
		 else if(x == 2){
		 	sort(q, q + idx);
		 	cout << q[0] << endl;
		 }
		 else{
		 	sort(q, q + idx, greater<int>());
			 idx --;
		 }
	}
}
2024/8/11 22:11
加载中...