HDU1873
来源:互联网 发布:sql去重复列名 编辑:程序博客网 时间:2024/06/06 08:33
锻炼一下队列
#include<iostream>#include<functional>#include<queue>#include<string>#include<vector>#include<cstdio>#include<cstdlib>using namespace std;struct ren { int x; int quanzhong; bool operator < (const ren &a) const { if (quanzhong == a.quanzhong)return x > a.x; return quanzhong<a.quanzhong; }};int main(){ int n; while (cin >> n) { priority_queue<ren>que4[4]; long long pp = 0; while (n--) { char ssss[80]; cin >> ssss; if (ssss[0] == 'I') { pp++; int c, d; scanf("%d%d", &c, &d); ren w = { pp,d }; que4[c].push(w); } else { int e; cin >> e; if (que4[e].empty())puts("EMPTY"); else { cout << que4[e].top().x << endl; que4[e].pop(); } } } } return 0;}
0 0
- hdu1873
- hdu1873
- HDU1873
- HDU1873
- hdu1873
- hdu1873
- hdu1873 看病要排队
- HDU1873(队列应用)
- hdu1873 看病要排队
- hdu1873(看病要排队)
- hdu1873 看病要排队
- hdu1873(优先级排序)
- HDU1873 优先队列
- HDU1873 看病要排队
- hdu1873看病要排队
- HDU1873---看病要排队
- hdu1873~看病要排队~
- 【hdu1873】优先队列
- SODBASE运维----Linux下SODBASE CEP集群命令
- 求了一天的割点
- django 使用mysql 出现的 No module named MySQLdb
- Delphi-将ListView内容导出到文件
- 五大常用算法之三:贪心算法
- HDU1873
- 杂物
- [安卓学习小记]You need to use a Theme.AppCompat theme (or descendant) with this activity.
- 编号 枚举
- android和java中对线程的使用总结
- 路由器进行桥连的方法
- vb.net LINQ TO XML读写XML
- from one corner to another corner ,please get the shortest path numbers
- UVA-400 Unix ls