2013年8月12日
摘要: http://poj.org/problem?id=3580给一个长度为N(N 2 #include 3 #include 4 #include 5 using namespace std; 6 #define inf (1= nowsz) return 0; 63 int x = tree[0].chd[1]; 64 while(1) { 65 pushdown(x); 66 int u = tree[x].chd[0]; 67 int v = tree[x].chd[1]; 68 if(tree... 阅读全文
posted @ 2013-08-12 13:37 tobec 阅读(338) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1890给一个长度为N(N 2 #include 3 #include 4 #include 5 using namespace std; 6 #define inf (1<<29) 7 const int maxn = 100010; 8 int n , splaysz; 9 struct node {10 int p,chd[2],sz,flag;11 node (int P=0) {12 chd[0]=chd[1]=0;sz=0;13 p = P; f... 阅读全文
posted @ 2013-08-12 13:35 tobec 阅读(229) 评论(0) 推荐(0) 编辑