摘要: 思路: 考虑时光倒流 这不就是并查集裸题了…………….//By SiriusRen#include #include #include using namespace std;#define N 500500int n,q,xx,yy,v[N],first[N],next[N],t... 阅读全文
posted @ 2017-01-02 14:56 SiriusRen 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 记得当年省选的时候 这道题连暴力都没写对(尴尬ing) (当年天真的认为sort是左闭右闭的hhhhhh) 思路: 首先 二分答案线段树 首先二分答案,然后需要知道进行m次排序后p位置上的数字是否大于mid。 对于一个mid,我们可以把序列里的数字分为两类,即大于mid的数... 阅读全文
posted @ 2017-01-02 11:47 SiriusRen 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Treap://By SiriusRen#include #include using namespace std;int size,n,xx,root,ans,tmp;struct Treap{int ch[2],v,cnt,rnd,sz;}tr[500050];void Upd... 阅读全文
posted @ 2017-01-02 09:24 SiriusRen 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 思路: 当然是抄的黄学长的题解啦//By SiriusRen#include #include using namespace std;#define N 500005int n,m,rt,R,top,id[N],mx[N],pos[N];double a[N];char ch[1... 阅读全文
posted @ 2017-01-02 09:07 SiriusRen 阅读(97) 评论(0) 推荐(0) 编辑