poj 3481 Double Queue 数据结构 STL
摘要:
题意:定义3种操作1 x y 把编号为x,权值为y的人加入队列2 询问权值最大的人的编号3 询问权值最小的人的编号思路:(1) Splay (2)STL set 1 #include<iostream> 2 using namespace std; 3 #define MAXN 1000001 4 struct node 5 { 6 int left,right,father; 7 int key; 8 int leftnum,rightnum; 9 }; 10 node tree[MAXN]; 11 int root=0; 12 void up... 阅读全文
posted @ 2012-02-10 21:36 myoi 阅读(346) 评论(0) 推荐(0) 编辑