题目链接: C2. Brain Network (medium) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Further research on zombie thought processes yielded interesting results. As we know from the previous prob…
H - Brain Network (medium) Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u CodeForces 690C2 Description Further research on zombie thought processes yielded interesting results. As we know from the previous problem, the…
Brain Network (medium) Further research on zombie thought processes yielded interesting results. As we know from the previous problem, the nervous system of a zombie consists of n brains and m brain connectors joining some pairs of brains together. I…
题目链接: C1. Brain Network (easy) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One particularly well-known fact about zombies is that they move and think terribly slowly. While we still do…
题目链接: C3. Brain Network (hard) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Breaking news from zombie neurology! It turns out that – contrary to previous beliefs – every zombie is born …
C3. Brain Network (hard)   Breaking news from zombie neurology! It turns out that – contrary to previous beliefs – every zombie is born with a single brain, and only later it evolves into a complicated brain structure. In fact, whenever a zombie cons…
Labyrinth Time Limit: 2000MS   Memory Limit: 32768K Total Submissions: 4004   Accepted: 1504 Description The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them eithe…
比较经典的老题 题目意思:给你一颗节点数为n的树,然后其中m个特殊点,再给你一个值d,问你在树中有多少个点到这m个点的距离都不大于d. 这题的写法有点像树的直径求法,先随便选择一个点(姑且设为点1)来遍历一遍树,存下所有点到点1的距离.然后在m个特殊点中找到距离点1最远的点a1. 然后以a1为初始点遍历一遍树,求每一个点到a1的距离,存在dp[i]中.并且再在m个点中找到到a1距离最大的点a2.最后再以a2为初始点遍历一遍树,求到每一个点到a2的距离dp1[i].然后for遍历所有点,如果dp[…
题目链接: Anton and Tree 题意:给出一棵树由0和1构成,一次操作可以将树上一块相同的数字转换为另一个(0->1 , 1->0),求最少几次操作可以把这棵数转化为只有一个数字的一棵数. 题解:首先一次可以改变一片数字,那么进行缩点后就变成了每次改变一个点.缩完点后这棵数变成了一棵相邻节点不同,0和1相交叉的一棵树.然后一棵树的直径上就是 这种情况,相当于从中间开始操作,总共操作(L+1)/2次.关于其他的分支一定会在直径的改变过程中完成改变. #include<bits/s…
E - We Need More Bosses CodeForces - 1000E Your friend is developing a computer game. He has already decided how the game world should look like - it should consist of nn locations connected by mm two-waypassages. The passages are designed in such a…