摘要:
也是旧题重做,本次是splay,原来写的treap版本请移步:http://www.cnblogs.com/evan-oi/archive/2012/02/03/2337324.html也是splay水题不多说了。View Code #include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>using namespace std;#define MaxN 10010#define INF 2000000int n,tot=0,root=0,ans=0;struct at 阅读全文
摘要:
题目大意啥的自便吧,本问是题目的splay做法,之前发过用set写的 ,有兴趣可以转http://www.cnblogs.com/evan-oi/archive/2012/03/24/2415297.html简单slpay题,其实一个NB的操作都没有...话说人挑狗个狗挑人都是一样的,splay tree里有人存人,没人存狗...查找就一边递归一遍打擂台然后更新就好了。代码:View Code #include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>using nam 阅读全文