Problem DescriptionMiceren likes exploration and he found a huge labyrinth underground!This labyrinth hasNcaves and some tunnels connecting some pairs...
分类:
其他好文 时间:
2015-05-05 18:42:50
阅读次数:
205
解题报告 之 SOJ2414 Leapin' Lizards
Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of the rookies steps on an innocent-looking stone and the room's floor sudd...
Problem Description
The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth. To make the problem simply, we assume the labyrinth is a...
分类:
其他好文 时间:
2015-03-04 11:12:13
阅读次数:
201
Problem Description
度度熊是一只喜欢探险的熊,一次偶然落进了一个m*n矩阵的迷宫,该迷宫只能从矩阵左上角第一个方格开始走,只有走到右上角的第一个格子才算走出迷宫,每一次只能走一格,且只能向上向下向右走以前没有走过的格子,每一个格子中都有一些金币(或正或负,有可能遇到强盗拦路抢劫,度度熊身上金币可以为负,需要给强盗写欠条),度度熊刚开始时身上金币数为0,问度度熊走出迷宫时候身上最...
分类:
其他好文 时间:
2015-02-26 18:35:08
阅读次数:
188
Problem Description
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb...
分类:
Web程序 时间:
2015-02-22 14:40:33
阅读次数:
227
??LabyrinthTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1173Accepted Submission(s): 388Problem ...
分类:
其他好文 时间:
2015-02-17 15:15:45
阅读次数:
135
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial exploding time of the bomb is set to 6 minutes. To preve...
分类:
Web程序 时间:
2015-02-12 22:51:36
阅读次数:
188
首先我们要知道怎么求树的直径。
树的直径是指树的最长简单路。
求法: 两遍BFS :先任选一个起点BFS找到最长路的终点,再从终点进行BFS,则第二次BFS找到的最长路即为树的直径;
题意:给了个图,' . ' 可以走 ‘ # ’ 是墙。因为题目中规定了两点之间最多只有一条路可以走,而且必有一条路。可以见‘ . ’ 是一个树的结构。要求得距离最长的两点的距离。也就是求树的直径了。
做法: 找到节点,节点就是三面有‘ # ‘ 的 点。然后bfs 两遍求出直径就可以了。
注意:图很大,dfs 会超内存。...
分类:
其他好文 时间:
2015-02-12 12:33:23
阅读次数:
111
URAL 1145. Rope in the Labyrinth(两次BFS啊 )...
分类:
其他好文 时间:
2015-02-08 21:56:41
阅读次数:
262
Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uDescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with...
分类:
其他好文 时间:
2015-01-27 21:32:30
阅读次数:
171