摘要:
题意:依次找第i大的数下标pos[i],然后将区间[i,pos[i]]翻转分析:splay树区间翻转// File Name: ACM/HDU/1890.cpp// Author: Zlbing// Created Time: 2013年08月10日 星期六 20时26分39秒#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define CL(x,v); memset(x,v,sizeof(x));#defin 阅读全文
摘要:
区间更新求和主要用来练习splay树区间更新问题//splay树的题解// File Name: 3468-splay.cpp// Author: Zlbing// Created Time: 2013年08月09日 星期五 16时30分32秒#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define CL(x,v); memset(x,v,sizeof(x));#define INF 0x3f3f3f3f# 阅读全文
摘要:
题意:给出一个n个数的数列a,对于第i个元素ai定义fi=min(abs(ai-aj)),(1#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define CL(x,v); memset(x,v,sizeof(x));#define INF 0x3f3f3f3f#define LL long long#define REP(i,r,n) for(int i=r;i=r;i--)const int MAXN=200010;con 阅读全文
摘要:
这个题也是单点维护,不管来的是人还是狗,只要num=0就插入,否则就删除。// File Name: ACM/bzoj/1208.cpp// Author: Zlbing// Created Time: 2013年08月08日 星期四 16时33分53秒#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define CL(x,v); memset(x,v,sizeof(x));#define INF 0x3f3f 阅读全文