2014年10月25日

Hdu3966( Aragorn's Story ) 树链剖分

摘要: 点更新树链剖分入门题,诶 错了好多发,提到同一点时没更新,边数组开小了一倍。#include #include #include #include using namespace std;#define lson l,mid,rt size[son[x]]) son[x] = cc; }}vo... 阅读全文

posted @ 2014-10-25 16:46 一个西瓜 阅读(271) 评论(0) 推荐(0)

spoj375Query on a tree树链剖分

摘要: 学了下树链剖分,这个链接讲的很详细http://blog.sina.com.cn/s/blog_6974c8b20100zc61.html就是把一颗树划分轻重链,然后标号,对应到一颗线段树上。更新a到b的路径时,就把在下面的向上提 直到在一条重链上或者两点重合。#include #include #... 阅读全文

posted @ 2014-10-25 16:43 一个西瓜 阅读(142) 评论(0) 推荐(0)

导航