- 博客(5)
- 资源 (3)
- 收藏
- 关注
原创 Splay解决区间问题[区间更新,区间求和]
/*http://poj.org/problem?id=3468*/ /*区间更新,区间求和*/ /*注意各种编码细节,特别是splay buildTree和 rotateTo*/ /*仔细体会与线段树解决区间问题的不同点,如结点记录的信息是不同的*/ /*lazy思想*/ #include #include #include using namespace std; const int MAXN
2013-01-31 22:50:29 946
原创 Splay解决区间问题[单点更新,区间最值询问]
/*http://acm.hdu.edu.cn/showproblem.php?pid=1754*/ /*单点更新,区间询问 splay实现*/ /*注意写rotateTo的时候。。*/ #include #include #include #include using namespace std; const int MAXN = 222222; class SplayTree{ #de
2013-01-31 21:20:54 929
原创 SplayTree实现_简化版
(1) template class SplayTree{ #define MAXN 1000010 private: int ch[MAXN][2],pre[MAXN],pool[MAXN]; DataType key[MAXN]; int top,root,tot; int malloc(DataType dt){ int x;
2013-01-31 18:54:32 450
原创 SplayTree实现
template class SplayTree{ #define null 0 private: int MAXSIZE; int *l,*r,*p,*pool,*depth; int top,root,tot; DataType *key; int malloc(DataType k){ int node; if(top
2013-01-30 23:41:49 452
原创 Codeforces #163 Div2 E
传送门:http://codeforces.com/contest/266/problem/E 代码: #include #include #include using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define mid(x,y) (x+y)>>1 #define mod
2013-01-27 15:09:01 532
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人