随笔分类 -  树链剖分

摘要:D. Happy Tree Partytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBogdan has a birthday today a... 阅读全文
posted @ 2015-11-05 15:16 __560 阅读(304) 评论(0) 推荐(0)
摘要:2015沈阳网络赛1003 Minimum Cut 树链剖分 数组维护前缀和进行区间增减Minimum CutTime Limit: 3000/2000 MS (Java/Others)Memory Limit: 65535/102400 K (Java/Others)Total Submissi... 阅读全文
posted @ 2015-09-19 19:14 __560 阅读(550) 评论(5) 推荐(0)
摘要:HDU5029 Relief grain 树链剖分+线段树离线Relief grainTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 100000/100000 K (Java/Others)Total Submission(s): 1715... 阅读全文
posted @ 2015-09-10 13:54 __560 阅读(264) 评论(0) 推荐(0)
摘要:树链剖分 模版#include#define lson l,m,rt G[maxn];int dep[maxn],son[maxn],fa[maxn],siz[maxn];int top[maxn];int id[maxn];int num;int val[maxn];struct Tree{ ... 阅读全文
posted @ 2015-09-01 23:25 __560 阅读(264) 评论(0) 推荐(0)
摘要:SPOJ375 Query on a tree 树链剖分no tagsYou are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ... 阅读全文
posted @ 2015-09-01 23:19 __560 阅读(248) 评论(0) 推荐(0)