题意:略 思路,先说如何建树吧.广搜很简单,就是一个队列+一个检测数组.但是本质还是对搜索树的构建. 这里的构建就是一个节点有4个孩子,每个孩子代表4个方向就构成了一个搜索树.根据题目的就离公式转化一下,就是未被搜索的距离=最相邻已经被搜索的节点+1 代码: #include<iostream> #include<cstring> #include<string> using namespace std; int n, m; struct node{ int x, y;…
这个题我看了,都是推荐的神马双向广搜,难道这个深搜你们都木有发现?还是特意留个机会给我装逼? Open the Lock Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3014 Accepted Submission(s): 1323 Problem Description Now an emergent task for you…
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 45648 Accepted: 14310 Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00…
POJ 3126 Prime Path Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16204 Accepted: 9153 Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change…
POJ 1426 Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 25734 Accepted: 10613 Special Judge Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representati…