Pet BFS】的更多相关文章

一天早上小明醒来时发现他的宠物仓鼠不见了. 他在房间寻找但是没找到仓鼠. 他想用奶酪诱饵去找回仓鼠. 他把奶酪诱饵放在房间并且等待了好几天. 但是可怜的小明除了老鼠和蟑螂没见到任何东西. 他找到学校的地图发现地图上没有环路,并且学校里的每个站点都可以从他的房间到达. 奶酪诱饵的手册提到在距离D之内宠物必定会被吸引回来. 你的任务是帮助小明从给定的地图中有多少可能的站点是仓鼠的藏身处. 假定仓鼠一直藏在学校的某个站点并且两个相邻站点间的距离都是1个单位. Input输入包含多组数据. 第一行一个整…
Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2052    Accepted Submission(s): 1007 Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He sear…
Pet Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 535 Accepted Submission(s): 258 Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in…
Pet                                                          Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)                                                                          Total Submission(s): 1909    Acc…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4707 题目大意:在一个无环的,从0开始发散状的地图里,找出各个距离0大于d的点的个数 Sample Input 1 10 2 0 1 0 2 0 3 1 4 1 5 2 6 3 7 4 8 6 9   Sample Output 2 分析:从0点开始BFS,给每个点一个距离0点标记,再算出大于距离d一共多少个 代码如下: # include<iostream> # include<cstdi…
Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13911    Accepted Submission(s): 4370 Special Judge Problem Description The Princess has been abducted by the BEelzeb…
http://acm.hdu.edu.cn/showproblem.php?pid=4707 Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in th…
Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2248    Accepted Submission(s): 1098 Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He sea…
Pet Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 472 Accepted Submission(s): 229 Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in…
Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 181    Accepted Submission(s): 55 Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searche…