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 ...
随机推荐
- 第3阶段——内核启动分析之make menuconfig内核配置(2)
目标: 分析make menuconfig内核配置过程 在上1小结中(内核编译试验)讲到了3种不同的配置: (1)通过make menuconfig 直接从头到尾配置.config文件 (2) 通过m ...
- 记一次wiki数据爬取过程
最近有个爬取各国领导人信息的奇怪需求,要求百度和维基两种版本的数据,最要命的还要保持数据的结构不变.正好印象中隐约记得维基有专门的领导人列表页,不考虑爬取下来的格式不变的话应该很好爬的样子. 首先思路 ...
- 全平台轻量级 Verilog 编译器 & 仿真环境
一直苦于 modelsim 没有Mac版本,且其体量过大,在学习verilog 时不方便使用. 终于找到一组轻量级且全平台 ( Linux+Windows+macOS ) 的编译仿真工具组. Icar ...
- CSS3动画效果之animation
先解决上一篇的遗留问题. div { width: 300px; height: 200px; background-color: red; -webkit-animation: test1 2s; ...
- JavaScript 的使用基础总结②DOM
HTML DOM 通过 HTML DOM,可访问 JavaScript HTML 文档的所有元素. 当网页被加载时,浏览器会创建页面的文档对象模型(Document Object Model). HT ...
- 【Alpha阶段】第三次scrum meeting
每日任务: ·1.本次会议为第三次Meeting会议: ·2.本次会议于今日上午08:30第五社区五号楼下召开,会议时长15min. 二.每个人的工作: 三.工作中遇到的困难: 由于对编程语言的学习不 ...
- 201521123089 《Java程序设计》第7周学习总结
一.本周学习总结 1.以你喜欢的方式(思维导图或其他)归纳总结集合相关内容. 二.书面作业 1.ArrayList代码分析 1.1 解释ArrayList的contains源代码 如果对象为空,ele ...
- 201521123100 《Java程序设计》 第1周学习总结
1. 本章学习总结 1.简单了解学习了Java及其开发环境,学习使用了Notepad++&eclipse开发软件的使用 2.熟练完成了使用Notepad++运行第一个Java程序"H ...
- Java报文或者同步的数据有个别乱码情况的处理.
从其它系统获取到的用户数据,1万多条数据有其中有2条数据是乱码形式,这种形式表现为最后一个字符和本身的分隔符组成了一个乱码 错误数据 : 220296|+|黄燕 鄚+|7|+|7|+|02220 ...
- window10简单安装MongoDB
文章参考 在Windows上安装MongoDB 首先,在官网下载安装包.下载地址 内容如下所示: 配置 1. 创建数据目录 E:\MongoDB\data\db 2. 配置环境变量 运行 1. 命令行 ...