
动态树LCT
u010660276
这个作者很懒,什么都没留下…
展开
-
动态树hdu4010 - Query on The Trees
Query on The TreesTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3027 Accepted Submission(s): 1380Problem DescriptionWe have me原创 2015-03-20 19:41:45 · 462 阅读 · 0 评论 -
LCT+最小生成树+并查集+离线(BZOJ2594)
2594: [Wc2006]水管局长数据加强版Time Limit: 25 Sec Memory Limit: 128 MBSubmit: 1278 Solved: 404[Submit][Status][Discuss]DescriptionSC省MY市有着庞大的地下水管网络,嘟嘟是MY市的水管局长(就是管水管的啦),嘟嘟作为水管局长的工作就是:每天供水公司可能要原创 2015-04-05 11:47:52 · 844 阅读 · 0 评论 -
动态树LCT(SPOJ 6779 Can you answer these queries VII)
GSS7 - Can you answer these queries VIIno tags Given a tree with N ( N ) nodes. Each node has a interger value x_i ( |x_i|<=10000).You have to apply Q ( Q ) operations:1. 1 a b : ans原创 2015-04-04 11:32:44 · 934 阅读 · 0 评论 -
动态树||树链剖分(BZOJ1036)
1036: [ZJOI2008]树的统计CountTime Limit: 10 Sec Memory Limit: 162 MBSubmit: 7051 Solved: 2872[Submit][Status][Discuss]Description一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I.原创 2015-04-03 16:27:56 · 450 阅读 · 0 评论 -
动态树LCT(SPOJ375)
原来用树链剖分写过,最近学动态树,从写一遍题意:改变边权值,询问连点之间边权的最大值思路:这个题维护的是边权,我是吧边权转化为点权,这样需要注意的是不能换根,因为换根之后权值就变了那么如何解决那,就要用到LCA了,LCA的时候先Access(v),使得v到根的路径暴露出来,形成一颗Splay,然后u沿着pre向上走,知道走到v到根的脸上,说明找到了LCA,因为这个时候Splay(LCA原创 2015-03-24 14:57:24 · 832 阅读 · 0 评论 -
LCT(模板题)BZOJ2049
2049: [Sdoi2008]Cave 洞穴勘测Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 3769 Solved: 1680[Submit][Status][Discuss]Description辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(原创 2015-03-22 10:52:01 · 665 阅读 · 0 评论 -
动态树模板
数组版(kuangbin):#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const int maxn=300010;int ch[maxn][2],pre[maxn],key[maxn];int原创 2015-03-20 17:40:00 · 496 阅读 · 0 评论 -
动态树LCT(SPOJ QTREE2 - Query on a tree II)
QTREE2 - Query on a tree IIno tags You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. Each edge has an integer value assigned to i原创 2015-03-27 17:21:35 · 623 阅读 · 0 评论 -
动态树LCT||树链剖分+线段树(SPOJ QTREE3 - Query on a tree again!)
QTREE3 - Query on a tree again!no tags EnglishVietnameseYou are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to N.原创 2015-03-28 14:02:04 · 923 阅读 · 0 评论 -
动态树LCT||分块(BZOJ2002)
2002: [Hnoi2010]Bounce 弹飞绵羊Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 4721 Solved: 2503[Submit][Status][Discuss]Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始原创 2015-03-23 17:55:35 · 517 阅读 · 0 评论