
图论
傻不拉叽
这个作者很懒,什么都没留下…
展开
-
POJ2135:Farm Tour
Description When FJ’s friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which contains his house and the Nth of whic转载 2017-11-06 23:13:42 · 451 阅读 · 0 评论 -
Asteroids
Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveni转载 2017-11-05 15:20:31 · 177 阅读 · 0 评论 -
POJ3469:Dual Core CPU
Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft Corporation, decided to update their famous product - SWODNIW. The routine转载 2017-11-05 22:46:50 · 159 阅读 · 0 评论 -
算法训练:安慰奶牛
解题思路 此题很明显是一个求最小生成树的问题,关键在于如果处理图上边的权值。因为我从七点出发,最终还要沿原路返回起点,所以树上的边皆走过两次。因为每走过一条边都要经过由该边相连的两邻接点,所以最终的权值还要加上两邻接点的权值。一开始我很疑惑点和边同样也要遍历两次为什么不需要乘2。后来发现我们在计算每一条边时都加上了邻接点的权值,所以实际上所有的分支结点都算了两次。通过模拟我们也可以知道在遍历过程原创 2018-01-23 18:50:52 · 237 阅读 · 0 评论