[tree] poj 3481
来源:互联网 发布:人工智能行业投资机会 编辑:程序博客网 时间:2024/05/21 09:26
/**[tree] poj 3481 动态添加删除数组元素,查询最大最小值。STL set 轻松水过。 */#include <stdio.h>#include <set>#include <algorithm>#include <vector>using namespace std;#define MK make_pair#define Pii pair<int,int>int main(){ set< Pii > st; set< Pii >::iterator it; int ask,p,k; while(scanf("%d",&ask) && ask) { if(ask == 1) { scanf("%d%d",&k,&p); st.insert(MK(p,k)); continue; } if(st.empty()) { printf("0\n"); continue; } if(ask == 2) { it = st.end(); --it; } else it = st.begin(); printf("%d\n",(*it).second); st.erase(it); } return 0;}
- [tree] poj 3481
- POJ Tree
- Tree POJ
- poj-2255-Tree Recovery(tree)
- POJ 3321 Apple Tree
- poj 2255 Tree Recovery
- POJ 1848 Tree
- POJ 1145 Tree Summing
- POJ 3321 Apple Tree
- Tree Recovery---POJ--2255
- POJ 2255 Tree Recovery
- poj 1848 Tree
- poj 1145 Tree Summing
- POJ 2255 Tree Recovery
- poj 3321 Apple Tree
- poj 2367 Genealogical tree
- poj 2367 Genealogical tree
- poj 2367 Genealogical tree
- cmd命令大全整理
- POJ1811 Prime Test
- libgdx游戏引擎教程
- NGINX配置多域名
- Android OpenGL es 纹理坐标设定与贴图规则
- [tree] poj 3481
- a和span组合定义按钮样式
- 如何运行时(动态)加载js脚本|JavaScript
- HDU 2524 矩形A + B
- 模拟录制模式和低级录制模式的区别与规则
- MIT OS lab3--小结续 系统调用与用户接口 (cprintf..)
- QTP 如何增強Debug View 功能
- lr_save_string 和 sprintf 的使用 http://www.cnblogs.com/sirrah/articles/2349089.html
- 简明 Vim 练级攻略