BFS(广搜+队列)
文章平均质量分 79
idealistic
编程渣渣~~
展开
-
【杭电1242】广搜+队列
RescueTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The pr原创 2016-07-29 16:29:31 · 234 阅读 · 0 评论 -
***玲珑1072- Capture
1072 - CaptureTime Limit:15s Memory Limit:1024MByteSubmissions:539Solved:178DESCRIPTIONIn a city capture game, Mr. Van owns a Empire with a capital city ( marked 1 ). Initi转载 2017-01-20 16:59:03 · 155 阅读 · 0 评论 -
【杭电】2717-bfs
Catch That CowTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12916 Accepted Submission(s): 3986Problem DescriptionFarmer John ha原创 2016-11-19 11:03:50 · 274 阅读 · 0 评论 -
字符矩阵中是否存在环
B. Fox And Two Dotstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a mobile puzzle gam原创 2016-08-13 19:58:22 · 475 阅读 · 0 评论 -
【POJ1383】BFS,迷宫,最长路
LabyrinthTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe northern part of the Pyramid contains a very large and complicated原创 2016-08-02 20:38:29 · 1195 阅读 · 0 评论 -
树的直径模板~~最长路径
两次bfs:①任意从一个点u出发bfs,设其能到的最远点为v②从v出发重新bfs,设其能到达的最远点为s③则树的直径就是v->s证明:若能证明从任意一个点出发,bfs到的最远点一定在树的直径的端点上,那么第二次bfs就可以证明一定正确了,下面来证明第一次bfs正确性:①若选择的点u在直径上,那么能到的最远点v一定是树的直径的端点之一反证:若v不是树的直径的端点,原创 2016-08-02 17:30:18 · 812 阅读 · 0 评论 -
【poj2631】Roads in the North
Roads in the NorthTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionBuilding and maintaining roads among communities in the far No原创 2016-08-02 19:08:43 · 412 阅读 · 0 评论 -
【POJ1985】Cow Marathon(基础 树的直径)
Cow MarathonTime Limit:2000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John原创 2016-08-02 11:42:49 · 314 阅读 · 0 评论 -
【POJ3984】迷宫问题
迷宫问题Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice POJ 3984Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1,转载 2016-07-29 21:07:50 · 218 阅读 · 0 评论 -
【牛客网】bfs广度搜索
题目描述小易总是感觉饥饿,所以作为章鱼的小易经常出去寻找贝壳吃。最开始小易在一个初始位置x_0。对于小易所处的当前位置x,他只能通过神秘的力量移动到 4 * x + 3或者8 * x + 7。因为使用神秘力量要耗费太多体力,所以它只能使用神秘力量最多100,000次。贝壳总生长在能被1,000,000,007整除的位置(比如:位置0,位置1,000,000,007,位置2,000,000,原创 2017-11-19 19:52:05 · 236 阅读 · 0 评论