求助
查看原帖
求助
228745
AllenKING_RED楼主2020/11/15 10:58

蒟蒻本地没事,交上去就CE了

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<queue>
using namespace std;
priority_queue<int>heap;

int main(void)
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int op;
		cin>>op;
		if(op==1)
		{
			int temp;
			cin>>temp;
			heap.push(-temp);
		}
		if(op==2)
		{
			int temp=heap.top();
			cout<<-temp<<endl;
		}
		if(op==3)
		{
			heap.pop();
		}
	}
	return 0;
}
2020/11/15 10:58
加载中...