一开始看错题了,后来发现原来是在一颗带权的树上面求出距离每一个点的最长距离,做两次dfs就好,具体的看注释?#include #include #include #include #include #include #include #include #include #include #inclu...
分类:
其他好文 时间:
2014-08-08 15:35:06
阅读次数:
236
POJ 2196 Computer(搜索-深度优先搜索)
题目大意:
告诉你一棵树,问你某个点最远能到达多远?
解题思路:
先从1号点出发,找出各个点到1号点的距离,最远的那个点必然是树的主枝干上的一点。
从树的主干上的那点出发,距离最远的另一点必然是树主枝干的另一点。
接下来的答案就是每个点到两个主干点的距离取大。...
分类:
其他好文 时间:
2014-08-07 19:07:50
阅读次数:
305
A system switches between non-secure and secure modes by making processes, applications, and data for the non-secure mode unavailable to the secure mo...
分类:
其他好文 时间:
2014-08-07 12:55:00
阅读次数:
318
A computer system with read/write access to storage devices creates a snapshot of a data volume at a point in time while continuing to accept access r...
分类:
其他好文 时间:
2014-08-07 12:03:00
阅读次数:
258
DescriptionUnidirectional TSPBackgroundProblems that require minimum paths through some domain appear in many different areas of computer science. For...
分类:
其他好文 时间:
2014-08-06 14:16:41
阅读次数:
336
DescriptionStacking BoxesBackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when ...
分类:
其他好文 时间:
2014-08-06 01:32:20
阅读次数:
275
A Different TaskThe (Three peg) Tower of Hanoi problem is a popular one in computer science. Briefly the problem is to transfer all the disks from peg...
分类:
其他好文 时间:
2014-08-05 00:31:38
阅读次数:
295
Executing a Next Instruction Access Intent instruction by a computer. The processor obtains an access intent instruction indicating an access intent. ...
分类:
数据库 时间:
2014-08-05 00:25:58
阅读次数:
424
A method, apparatus, and computer usable program code for logical partitioning and virtualization in heterogeneous computer architecture. In one illus...
分类:
其他好文 时间:
2014-08-05 00:15:08
阅读次数:
491
题目:初始给你一个1,然后每一次1变成01,0变成10求变化n步后,有多少个00。
分析:数学题。我们观察变化。
00 -> 1010 出现 10、01
01 -> 1001 出现 10、00、01
10 -> 0110 出现 01、11、10
11 -> 0101 出现 01、10...
分类:
其他好文 时间:
2014-08-04 14:27:57
阅读次数:
188