标签:rip iostream tor iter other sla imp 队列 game
#include<iostream>
#include<cmath>
#include<string>
#include<fstream>
#include<set>
using namespace std;
multiset <int> q;
multiset <int>::iterator it;
int main()
{
int m,n;
while(~scanf("%d%d",&n,&m))
{
q.clear();
char s[2];
while(n--)
{
int x;
scanf("%s",&s);
if(s[0]==‘I‘){
scanf("%d",&x);
q.insert(x);
if(q.size()>m){
q.erase(q.begin());
}
}
else{
it=q.begin();
printf("%d\n",*it);
}
}
}
}
标签:rip iostream tor iter other sla imp 队列 game
原文地址:http://www.cnblogs.com/ygtzds/p/7447169.html