摘要: 题面 Problem description. You are given a tree. If we select 2 distinct nodes uniformly at random, what's the probability that the distance between thes 阅读全文
posted @ 2020-01-17 17:44 Artoriax 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题面 Description There is a skyscraping tree standing on the playground of Nanjing University of Science and Technology. On each branch of the tree is a 阅读全文
posted @ 2020-01-17 17:34 Artoriax 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题面 又是一堆废话,不挂了 题目链接https://vjudge.net/problem/HDU 5977 数据规模 Each of the following n 1 lines contains two integers u and v,meaning there is one edge bet 阅读全文
posted @ 2020-01-17 17:12 Artoriax 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 题面 Description 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游 阅读全文
posted @ 2020-01-17 16:51 Artoriax 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题面 太长了不放了 链接:https://vjudge.net/problem/POJ 2114 题意 给定一颗树,m次询问,每次询问是否有路径长度为k的树 题解 和上题差不多,我们可以顺便把路径长度等于k的路径有多少条也算出来,大于0就有,等于0就没有 方法也是和上题一样,这题可以先合并长度相等的 阅读全文
posted @ 2020-01-17 16:40 Artoriax 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 题面 Description 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 a 阅读全文
posted @ 2020-01-17 16:25 Artoriax 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 点分治入门 转载于:https://blog.csdn.net/qq_39553725/article/details/77542223 点分治,是处理树上路径的一个极好的工具。 一般如果需要大规模处理树上路径,点分治是一个不错的选择。 这里我就来讲一讲我自己对于点分治的一点理解和感悟(帮助新手入坑 阅读全文
posted @ 2020-01-17 16:06 Artoriax 阅读(106) 评论(0) 推荐(0) 编辑