
搜索
纵马且长歌
贪心过样例,暴力出奇迹,骗分最神奇,打表进省一
展开
-
LightOJ_1337(第二种代码)
/ * 时隔一年多,重新做搜索,碰到以前做过的搜索水题竟然卡住迟迟过不了,真是惭愧啊!虽然此次重新做搜索准备用新的方式解决掉,但看来还是会碰到问题。不多说,说题。 * /新的思路是准备将已输入的二维的字符数组进行搜索,将每块区域内的 ‘ C ’统计出来,记在那块区域的每个点上。遍历一边即可。但问题就出在遍历之后的如何赋值上。一开始我是准备在递归返回后直接将该点赋值,样例能原创 2017-03-22 13:58:02 · 290 阅读 · 0 评论 -
hdu1312
这道题是搜索的水题,拿来做入门的题挺好的。题目:要求从‘@’点开始,走遍‘.’,不能越过‘#’点,要求输出走‘.’的数目。自己在做题的时候有两个代码,第一种是递归的思想,第二种是递推的思想,两种都可,但感觉后者要快那么一点点。如图,第二种快15ms,OvO~。#include #include #include #include using namespace原创 2017-03-13 22:54:47 · 432 阅读 · 0 评论 -
hdu1010 Tempter of the Bone
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 117845 Accepted Submission(s): 31882Problem DescriptionThe dog原创 2017-03-23 16:46:50 · 204 阅读 · 0 评论 -
LightOJ1337_ The Crystal Maze
DescriptionYou are in a plane and you are about to be dropped with a parasuit in a crystal maze. As the name suggests, the maze is full of crystals. Your task is to collect as many crystals as pos原创 2016-08-12 23:33:15 · 464 阅读 · 0 评论 -
hdu1241
不多说,搜索的水题。题目:要求你找有几摊油泊,‘@’表示油泊,油泊范围包括‘@’及周围八格内。#include #include #include #include #include using namespace std;const int maxn=105;int n,m;int x1,y1;char map[maxn][maxn];void bfs(int a原创 2017-03-14 20:55:21 · 428 阅读 · 0 评论