56分,求调
查看原帖
56分,求调
725133
gzy0215楼主2023/8/14 11:14
#include<bits/stdc++.h>
using namespace std;
std::priority_queue<int,vector<int>,greater<int> >a;
int main()
{
	int b,c[100001],d[500001];
	cin>>b;
	for(int i=1;i<=b;i++)
	{
		cin>>c[i];
		if(c[i]==1)
		{
			cin>>d[i];
		}
	}
	for(int i=1;i<=b;i++)
	{
		if(c[i]==1)
		{
			a.push(d[i]);
		}
		if(c[i]==2)
		{
			std::cout<<a.top()<<endl;
		}
		if(c[i]==3)
		{
			a.pop();
		}
	}
	return 0;
}
2023/8/14 11:14
加载中...