hdu 1873 看病要排队
来源:互联网 发布:淘宝卖家旺旺号怎么看 编辑:程序博客网 时间:2024/05/22 05:15
优先队列简单题
#include <iostream>#include <stdio.h>#include <iostream>#include <string.h>#include <queue>#include <vector>using namespace std;struct node{ int n; int i; friend bool operator < (node a, node b) { if(a.n==b.n) return a.i>b.i; else return a.n<b.n; }};int main(){ int n,A,B; node t; int k; char s[4]; while(scanf("%d",&n)!=EOF) { k=1; priority_queue<node> Q[4]; while(n--) { scanf("%s",s); if(s[0]=='I') { scanf("%d%d",&A,&B); t.n=B; t.i=k++; Q[A].push(t); } else { scanf("%d",&A); if(!Q[A].empty()) { t=Q[A].top(); Q[A].pop(); printf("%d\n",t.i); } else { printf("EMPTY\n"); } } } } return 0;}
- hdu 1873 看病要排队
- hdu 1873 看病要排队
- hdu 1873(看病要排队)
- HDU 1873 看病要排队
- hdu 1873 看病要排队
- HDU 1873 看病要排队
- HDU 1873看病要排队
- hdu 1873 看病要排队
- HDU 1873 看病要排队
- HDU-1873-看病要排队
- HDU 1873 看病要排队
- HDU 1873 看病要排队
- hdu 1873 看病要排队
- HDU 1873 看病要排队
- hdu 1873 看病要排队
- HDU 1873 看病要排队
- hdu 1873 看病要排队
- HDU 1873 看病要排队
- 【转】 POJ分类
- XML基础5(XML 元素)
- 动态规划
- Windows下SVN的备份方案 .
- Spring MVC读书笔记
- hdu 1873 看病要排队
- java 进制之间相互转换
- linux添加用户,挂载点
- 关于2010_CVPR_Locality-constrained Linear Coding for Image Classification
- java多态
- TortoiseSVN菜单项功能说明
- 在Debian Linux上快速安装LAMP环境
- windows cmd 命令行下 删除 只读属性
- subversion(SVN)常见问题及其解决方法 .