
分治
xing_mo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Tree,2017 ACM-ICPC 亚洲区(西安赛区)网络赛A,点分治
2017 ACM-ICPC 亚洲区(西安赛区)网络赛 A Tree https://nanti.jisuanke.com/t/A1267 There is a tree with nn nodes, at which attach a binary 64*6464∗64 matrix M_i (1 \le i \le n)M i (1≤i≤n). There are qq queries f...原创 2020-02-18 21:54:25 · 264 阅读 · 0 评论 -
HDU - 6035,点分治,组合计数
Colorful Tree https://vjudge.net/problem/938230/origin There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci. The path between each...原创 2020-01-18 18:43:37 · 454 阅读 · 0 评论 -
HDU - 4812,点分治
D Tree https://vjudge.net/problem/48318/origin There is a skyscraping tree standing on the playground of Nanjing University of Science and Technology. On each branch of the tree is an integer (The tre...原创 2020-01-18 12:43:22 · 751 阅读 · 1 评论 -
HDU - 5469,点分治,hash,先处理子树
Antonidas https://vjudge.net/problem/HDU-5469 Given a tree with N vertices and N−1 edges. Each vertex has a single letter Ci. Given a string S, you are to choose two vertices A and B, and make sure th...原创 2020-01-18 10:29:32 · 399 阅读 · 0 评论 -
CodeChef PRIMEDST,点分治,FFT
Prime Distance On Tree https://vjudge.net/problem/149908/origin Problem description. You are given a tree. If we select 2 distinct nodes uniformly at random, what’s the probability that the distance b...原创 2020-01-17 11:06:35 · 229 阅读 · 0 评论 -
HDU - 5977,点分治,状压
Garden of Eden https://vjudge.net/problem/550645/origin When God made the first man, he put him on a beautiful garden, the Garden of Eden. Here Adam lived with all animals. God gave Adam eternal life....原创 2020-01-16 21:20:49 · 229 阅读 · 0 评论 -
HYSBZ 2152,点分治
聪聪可可 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由爸爸在纸上画n个“点”,并用n-1条“边”把这n个“点”恰好连通(其实这就是一棵树)。并且每条“边”上都有一个数。...原创 2020-01-16 17:21:56 · 161 阅读 · 0 评论 -
POJ - 2114,点分治
Boatherds Boatherds Inc. is a sailing company operating in the country of Trabantustan and offering boat trips on Trabantian rivers. All the rivers originate somewhere in the mountains and on their wa...原创 2020-01-16 17:00:53 · 187 阅读 · 0 评论 -
POJ - 1741,点分治
A - Tree Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an integer k,for every pair (u,v) of vertices...原创 2020-01-16 16:11:01 · 169 阅读 · 0 评论 -
P3806 【模板】点分治1
P3806 【模板】点分治1 给定一棵有 nn 个点的树。 询问树上距离为 kk 的点对是否存在。 思路:点分治,先选取一个重心root,算出每个点到它的距离,从而可以通过枚举两条路径能够组成的 询问距离 的次数,但是这样会将同一子树上的两条路径算上(即路径长度加上了两倍子节点到root的距离),将这种情况的贡献减去即可,这样就O(n)计算出了一颗经过root点的路径贡献,之后同样的对root的每...原创 2020-01-16 15:39:56 · 189 阅读 · 0 评论