hdoj 4006The kth great number(优先级队列)
来源:互联网 发布:jackson json转对象 编辑:程序博客网 时间:2024/04/30 06:40
很水的一道题……
#include<iostream>#include<cstdio>#include<queue>using namespace std;class cmp{public: bool operator()(const int &a,const int &b) const { return a>b; } };int main(){ int n, k, temp; int i, j; char c; priority_queue<int, vector<int>, cmp> q; while( scanf("%d %d",&n, &k)!=EOF ) { for( i=0;i<n;i++) { getchar(); scanf("%c",&c); if( c=='I') { scanf("%d",&temp); q.push(temp); if( q.size()>k ) q.pop(); } else if( c=='Q') { printf("%d\n",q.top()); } } while( !q.empty()) q.pop(); }}
- hdoj 4006The kth great number(优先级队列)
- hdu 4006 The kth great number 优先级队列
- HDOJ 4006 The kth great number(优先队列)
- HDOJ 4006 - The kth great number 优先队列水
- hdoj 4006 The kth great number(优先队列)
- HDOJ 4006 The kth great number(优先队列)
- hdoj 4006 The kth great number【优先队列】
- HDOJ 4006 The kth great number(优先队列)
- hdoj 4006 The kth great number
- HDOJ 4006 The kth great number
- HDOJ 4006 The kth great number
- hdoj 4006 The kth great number
- hdoj-4006-The kth great number
- HDOJ 4006 The kth great number
- hdoj 4006 The kth great number 【栈】
- HDU 4006 The kth great number 【队列】
- HDU4006(The kth great number)优先级队列/SBT
- [HDOJ] problem_4006 【The kth great number】 优先队列
- 两道动态规划(DP)题目解析
- 小成本实现多台机器宽带上网
- 解决ORA-12560: TNS: 协议适配器错误
- POJ题目分类
- windows7专业版的特点
- hdoj 4006The kth great number(优先级队列)
- 用ubuntu破解Windows(以及防御措施)
- 在关闭页面时自动清除Session
- GOF学习笔记之:遇到的问题(1)
- hdoj 4004 The Frog's Games(二分+搜索+剪枝)
- MFC Socket学习易错四点
- asp.net文本编辑器FCKeditor使用方法详解
- 笔记--2011/9/4 9:28
- ubuntu安装Ice-3.4.2记录