ZOJ2724 Windows Message Queue 裸queue的模拟
题目要求FIFO
#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;
}
ZOJ2724 Windows Message Queue 裸queue的模拟的更多相关文章
- zoj 2724 Windows Message Queue(使用priority_queue容器模拟消息队列)
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2724 题目描述: Message queue is the b ...
- hdu 1509 Windows Message Queue
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1509 Windows Message Queue Description Message queue ...
- Windows Message Queue
Windows Message Queue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Other ...
- hdoj 1509 Windows Message Queue【优先队列】
Windows Message Queue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Ot ...
- Windows Message Queue(优先队列)
欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励) Windows Message Queue Time Limit: 2000/1000 MS (Java/Others) Mem ...
- HDU 1509 Windows Message Queue(队列)
题目链接 Problem Description Message queue is the basic fundamental of windows system. For each process, ...
- D - Windows Message Queue
来源hdu1509 Message queue is the basic fundamental of windows system. For each process, the system mai ...
- H - Windows Message Queue
Message queue is the basic fundamental of windows system. For each process, the system maintains a m ...
- hdu1509(Windows Message Queue) 优先队列
点击打开链接 Problem Description Message queue is the basic fundamental of windows system. For each proces ...
随机推荐
- 汇编指令-MOV与ldr区别(7)
MOV 1.可以寄存器与寄存器之间传递数据 2.可以常数传递到寄存器中(常数不能超过32位) LDR 1.可以地址与寄存器之间的数据传递 2.也可以常数传递到寄存器中 实例: 1.r1与r2之间传递就 ...
- 【C++小白成长撸】--(续)双偶数N阶魔阵
原理: 把双偶数N阶魔阵均分为(N/4)^2个4阶魔阵(4*4) 每个魔阵的对角线都标为"-1",其余位置标为"0" 从第一个位置(a[0][0])从左到右,从 ...
- jenkins+gitlab+sonar+testng构建持续集成测试环境(配置干货篇)
几个工具的安装部分就不在此介绍了! jenkins配置: 1.插件安装 2.root私钥配置 3.构建job配置 4.部署job配置 5.测试job配置 7.jenkins全局工具配置 8.jenki ...
- 游戏平台代表--PS4【推荐】
目前市上专业的游戏主机三足鼎立,分别是任天堂的wii,微软的xbox,已经索尼的PlayStation系列,这其中的老大当然是索尼PS4啦,因为即使美国佬也是优选ps4而不是自家的Xbox.小编历经千 ...
- Mybatis源码解析-BoundSql
mybatis作为持久层,其操作数据库离不开sql语句.而BoundSql则是其保存Sql语句的对象 前提 针对mybatis的配置文件的节点解析,比如where/if/trim的节点解析可见文章Sp ...
- 201521123037 《Java程序设计》第6周学习总结
1. 本周学习总结 1.1 面向对象学习暂告一段落,请使用思维导图,以封装.继承.多态为核心概念画一张思维导图,对面向对象思想进行一个总结. 1.2 可选:使用常规方法总结其他上课内容. 接口与抽象类 ...
- 201521123068《Java程序设计》第2周学习总结
1.本周学习总结 认识了各种类型与变量的使用 学习运算符的基本使用 变量命名不可以使用数字和一些特殊字符(如*.&.%等)作为开头: 变量名称不可以与Java关键词同名 学习了类与对象的区别 ...
- Python的变量参数
- Java-Properties用法-入门
对于应用程序的配置,通常的做法是将其保存在独立的配置文件中,程序启动时加载,修改时保存.Java中Properties类就提供了这样一种机制,配置项以Key-Value的数据结构存储在文本文件中,扩展 ...
- HTML结构
HTML:超文本标记语言. 可以放除了文本之外的内容,像图片.音频.视频等 由很多标签组成 html基本结构: <html> <head> 头标签存放网页信息,编码格式等 &l ...