随笔分类 -  图论--树--点分治

摘要:n<=200000的边权树上问长度=K<=1000000的链中边数最少的。 点分治。开个桶统计各个长度的答案。 1 #include<string.h> 2 #include<stdlib.h> 3 #include<stdio.h> 4 #include<math.h> 5 #include<al 阅读全文
posted @ 2018-01-25 12:31 Blue233333 阅读(159) 评论(0) 推荐(0) 编辑
摘要:n<=100000的树,每个点上有个字母a-t之一,问有多少这样的链经过每个点:它的某一个排列的字母串起来是回文的。 就是有最多一个字母是奇数个啦。。这样点分算一波即可。。细节较多详见代码 1 #include<string.h> 2 #include<stdlib.h> 3 #include<st 阅读全文
posted @ 2018-01-24 23:32 Blue233333 阅读(855) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示