#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<queue>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
struct in
{
	string name;
	int id;
	int dex;
	in(string s,int d,int x):name(s),id(d), dex(x) { };
};
bool operator < (const in a,const in b)
{
   return a.dex>b.dex;	
}
priority_queue< in > q;
int main()
{
	string S;
	int Id,Dex;
	while(cin>>S)
	{
		if(S=="GET"){
			if(q.empty()) cout<<"EMPTY QUEUE!"<<endl;
			else {
				in t=q.top();q.pop();
				cout<<t.name<<" "<<t.id<<endl;
			}
		}
		else {
			cin>>S>>Id>>Dex;
			q.push(in(S,Id,Dex));
		}
	}
	return 0;
}

相关文章:

  • 2021-09-29
  • 2021-10-10
  • 2022-12-23
  • 2022-01-13
  • 2021-12-18
  • 2021-10-07
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案