BFS/DFS
文章平均质量分 69
无语_
无语
展开
-
HUST——1110雪碧(简单DFS)
1110: 雪碧 时间限制: 1 Sec 内存限制: 128 MB 提交: 18 解决: 6 题目描述 杨神最近特别喜雪碧,他现在有两瓶,他大晚上的在街上走,他逢店加一倍(雪碧),逢摊吃大虾并喝一瓶(雪碧)。这一路走过去,遇到店n次,大排档m次,已知最后1次是小摊,大伙正好把雪碧喝完。请你计算杨神遇到店和小摊的次序,合理的次序一共有多少种? 输入原创 2016-05-15 19:55:13 · 547 阅读 · 0 评论 -
GDUT——1169: Krito的讨伐(优先队列BFS)
1169: Krito的讨伐 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 619 Solved: 102 Description Krito终于干掉了99层的boss,来到了第100层。第100层可以表示成一颗树,这棵树有n个节点(编号从0到n-1),树上每一个节点可能有很多只怪物。 Krito现在在0号节点,现在它想要原创 2016-07-16 15:22:10 · 483 阅读 · 0 评论 -
HDU 2181 哈密顿绕行世界问题(经典DFS+回溯)
哈密顿绕行世界问题 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3105 Accepted Submission(s): 1918 Problem Description 一个规则的实心十二面体,它的 2原创 2016-07-27 16:22:47 · 844 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem(经典DFS+回溯)
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 42600 Accepted Submission(s): 18885 Problem Description A rin原创 2016-07-27 17:57:02 · 441 阅读 · 0 评论 -
Codeforces Round #358 (Div. 2)——C. Alyona and the Tree(树的DFS+逆向思维)
C. Alyona and the Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alyona decided to go on a diet and we原创 2016-06-20 23:23:57 · 730 阅读 · 0 评论 -
Codeforces Round #361 (Div. 2)——B. Mike and Shortcuts(BFS+小坑)
B. Mike and Shortcuts time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently, Mike was very busy with stu原创 2016-07-08 09:44:41 · 531 阅读 · 0 评论 -
NOJ——1628Alex’s Game(III)(DFS+回溯)
[1628] Alex’s Game(III) 时间限制: 1000 ms 内存限制: 65535 K 问题描述 Alex likes to play with one and zero as you know . But Alex does’t have a girlfriend now because his girlfriend is trapped in Alc原创 2016-07-08 23:44:24 · 528 阅读 · 0 评论 -
HDU 1044 Collect More Jewels(BFS+DFS)
Collect More Jewels Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6713 Accepted Submission(s): 1558 Problem Description It is原创 2016-07-29 18:00:45 · 511 阅读 · 0 评论 -
UVa 11624 Fire!(BFS)
Fire! Time Limit: 5000MS Memory Limit: 262144KB 64bit IO Format: %lld & %llu Description Joe works in a maze. Unfortunately, portions of the maze have caught on fire,原创 2016-08-02 00:15:30 · 437 阅读 · 0 评论 -
暑假训练round 3 题解
今天做题运气出奇的好,除了几处小错误调试之后忘记改掉了……最后还AK了……虽然题目不难,学长也说是福利局,但是对个人的鼓励作用还是挺大的……至此暑假训练就结束了,也算没有遗憾……。 题解如下: Problem A: 苦逼的MCA Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO f原创 2016-07-31 21:41:30 · 611 阅读 · 0 评论 -
POJ 3255 Roadblocks(A*求次短路)
Roadblocks Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12167 Accepted: 4300 Description Bessie has moved to a small farm and sometimes enjoys returni原创 2016-08-09 13:11:20 · 615 阅读 · 0 评论 -
POJ 1573 Robot Motion(BFS)
Robot Motion Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12856 Accepted: 6240 Description A robot has been programmed to follow the instructions原创 2016-08-11 11:42:07 · 518 阅读 · 0 评论 -
OpenJ_Bailian——4115鸣人和佐助(带状态的A*)
鸣人和佐助 Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Submit Status Description 佐助被大蛇丸诱骗走了,鸣人在多少时间内能追上他呢? 已知一张地图(以二维矩阵的形式表示)以及佐助和鸣人的位置。地图上的每个位置原创 2016-07-13 11:52:57 · 890 阅读 · 0 评论 -
HDU——2612Find a way(多起点多终点BFS)
Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9698 Accepted Submission(s): 3165 Problem Description Pass a year lea原创 2016-07-01 16:28:05 · 748 阅读 · 0 评论 -
PAT天梯赛练习题——L3-008. 喊山(邻接表+BFS)
L3-008. 喊山 时间限制 150 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 喊山,是人双手围在嘴边成喇叭状,对着远方高山发出“喂—喂喂—喂喂喂……”的呼唤。呼唤声通过空气的传递,回荡于深谷之间,传送到人们耳中,发出约定俗成的“讯号”,达到声讯传递交流的目的。原来它是彝族先民用来求援呼救的“讯号”,慢慢地人们在生活原创 2016-06-24 23:49:19 · 2473 阅读 · 0 评论 -
POJ——3984迷宫问题(BFS+回溯)
迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14568 Accepted: 8711 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0,原创 2016-06-27 19:46:55 · 749 阅读 · 0 评论 -
POJ——2251Dungeon Master(三维BFS)
Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25379 Accepted: 9856 Description You are trapped in a 3D dungeon and need to find the quic原创 2016-06-27 18:37:11 · 517 阅读 · 0 评论 -
LightOJ——1066Gathering Food(BFS)
1066 - Gathering Food PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Winter is approaching! The weather is getting co原创 2016-06-28 14:56:10 · 650 阅读 · 0 评论 -
HDU——1195Open the Lock(双向BFS)
Open the Lock Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6016 Accepted Submission(s): 2680 Problem Description Now an emerg原创 2016-06-29 21:41:35 · 445 阅读 · 0 评论 -
POJ——2449Remmarguts' Date(A*+SPFA)
Remmarguts' Date Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 26504 Accepted: 7203 Description "Good man never makes girls wait or breaks an appointme原创 2016-07-11 11:12:02 · 511 阅读 · 0 评论 -
HDU——3786找出直系亲属(DFS+回溯)
找出直系亲属 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1541 Accepted Submission(s): 621 Problem Description 如果A,B是C的父母亲,则A,B是C的p原创 2016-07-01 19:22:13 · 650 阅读 · 0 评论 -
UVA——1600Patrol Robot(A*或普通BFS)
Patrol Robot Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Description A robot has to patrol around a rectangular area which is in a form o原创 2016-07-12 12:28:43 · 654 阅读 · 0 评论 -
HDU——1242Rescue(BFS+优先队列求点图最短路)
Rescue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25203 Accepted Submission(s): 8936 Problem Description Angel was caught b原创 2016-07-01 11:26:32 · 513 阅读 · 0 评论 -
POJ——3126Prime Path(双向BFS+素数筛打表)
Prime Path Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16272 Accepted: 9195 Description The ministers of the cabinet were quite upset by the message原创 2016-06-30 20:32:46 · 575 阅读 · 0 评论 -
NOJ——1642简单的图论问题?(BFS+优先队列)
[1642] 简单的图论问题? 时间限制: 5000 ms 内存限制: 65535 K 问题描述 给一个 n 行 m 列的迷宫,每个格子要么是障碍物要么是空地。每个空地里都有一个权值。你的 任务是从找一条(r1,c1)到(r2,c2)的路径,使得经过的空地的权值之和最小。每一步可以往上下 左右四个方向之一移动一格,但不能斜着移动,也不能原创 2016-07-01 00:52:01 · 635 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1003 Emergency(SPFA+DFS)
1003. Emergency (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emergency rescue team leader of a city, yo原创 2016-08-16 11:13:50 · 648 阅读 · 0 评论