POJ 3633
来源:互联网 发布:win10怎么优化内存 编辑:程序博客网 时间:2024/05/21 06:36
#include<algorithm>#include<cstdio>#include<cstdlib>#include<cstring>#include<cmath>#include<list>#include<iostream>#include<map>#include<queue>#include<set>#include<stack>#include<vector>using namespace std;#define MAX_Nconst int INF = 0x3f3f3f3f;struct node{ int id, time, p;}o;struct cmp{ bool operator()(node a, node b) { if(a.time == b.time) return a.id > b.id; return a.time > b.time; }};int main(){ priority_queue<node, vector<node>, cmp > pq; char str[20]; int n, m; while(scanf("%s", &str)) { if(str[0] == '#') break; scanf("%d%d", &n, &m); o.id = n; o.p = m; o.time = m; pq.push(o); } int k; scanf("%d", &k); while(k--) { node l = pq.top(); pq.pop(); cout<<l.id<<endl; l.time += l.p; pq.push(l); } return 0;}
0 0
- POJ 3633
- poj 3633 Costume Party
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- Aspose.Words使用教程之插入文档元素(三)
- java返回间隔时间(时分秒)
- 项目---考评系统排课算法分析
- 邓白氏号码(DUNS Number)查询
- Cluster概念详解
- POJ 3633
- Java中的序列化
- DOM(一)-10-(练习-广告弹窗)
- startActivityForResult、onActivityResult 、Intent
- SharePoint 2013 IT Professional——如何配置Anonymous Access
- DOM(一)-11-(document获取节点byId)
- main中int argc, char **argv 含义
- JQuery HTML之捕获、设置、元素添加、元素删除
- ETL kettle 工具使用例子