首页 > 代码库 > ZOJ 3765 Lights Splay Tree的几种基本操作
ZOJ 3765 Lights Splay Tree的几种基本操作
区间的查询,点修改,插入和删除。先姑且当作模板吧,略挫,慢慢补充,慢慢优化。
#include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <queue> #include <cmath> #include <stack> #include <map> #pragma comment(linker, "/STACK:1024000000"); #define EPS (1e-8) #define LL long long #define ULL unsigned long long #define _LL __int64 #define _INF 0x3f3f3f3f #define Mod 9999991 using namespace std; const int MAXN = 700100; struct N { //info int son[2],pre; //data int sta,ls,rs,s; int w,g[2]; bool mark[2]; }st[MAXN]; struct W { int sta,w; }num[200100]; void Output(int root) { if(root == -1) return ; Output(st[root].son[0]); printf("root = %d pre = %d data = http://www.mamicode.com/%2d lg = %2d rg = %2d sta = %2d ls = %d rs = %d s = %d/n",root,st[root].pre,st[root].w,st[root].g[0],st[root].g[1],st[root].sta,st[root].ls,st[root].rs,st[root].s);>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。