Priority Queue

优先队列模版题,没什么好说的
`#include<stdio.h>

include<stdlib.h>

include<string.h>

include<bits/stdc++.h>

using namespace std;

int main(){
priority_queue q;
char a,b,c;
int k=7;
while(1){
scanf("%c",&a);
if(a'i'){
while(1){
scanf("%c",&c);
if(c
' ') break;
}
scanf("%d",&k);
getchar();
q.push(k);
}
else{
scanf("%c",&b);
if(b'n') break;
else{
printf("%d\n",q.top());
q.pop();
while(1){
scanf("%c",&c);
if(c
'\n') break;
}
}
}
}
return 0;
} `

posted @ 2025-02-07 14:22  十柒*  阅读(3)  评论(0编辑  收藏  举报