搜索
果7
曾就职于阿里巴巴,从事搜索推荐的应用算法工作。
展开
-
dfs HDU2553 N皇后问题
/* 题目大意: 这道题目跟前面的POJ棋盘问题一样。不过需要判断不能在同一对角线上。*/#include#include#includeusing namespace std;int res[12]; //保存需要的输出结果 int visi[12]; //每一列被访问的情况int ma[12]; //用来存储皇后的位置,以免在同一个对角线上int s原创 2013-07-03 21:52:07 · 1065 阅读 · 0 评论 -
HDU 1312Red and Black(简单搜索 bfs或dfs)
Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6908 Accepted Submission(s): 4387Problem DescriptionThere is a r原创 2013-10-18 15:19:53 · 1270 阅读 · 2 评论 -
HDU 4255A Famous Grid(裸BFS)
A Famous GridTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1152 Accepted Submission(s): 451Problem DescriptionMr. B has re原创 2013-10-24 21:46:34 · 1399 阅读 · 0 评论 -
hdu 3665Seaside(简单floyd)
SeasideTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1006 Accepted Submission(s): 722Problem DescriptionXiaoY is living in原创 2013-11-01 12:43:14 · 1163 阅读 · 0 评论 -
POJ 3134Power Calculus(IDA*)
Power CalculusTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1615 Accepted: 856DescriptionStarting with x and repeatedly multiplying by x, we can com原创 2014-01-09 15:35:10 · 1427 阅读 · 0 评论 -
POJ 3009Curling 2.0(DFS)
Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9531 Accepted: 4033DescriptionOn Planet MM-21, after their Olympic games this year, curling i原创 2014-01-09 09:28:55 · 946 阅读 · 0 评论 -
POJ 3669Meteor Shower(传说中的流星雨 BFS)
Meteor ShowerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6878 Accepted: 2001DescriptionBessie hears that an extraordinary meteor shower is coming; r原创 2014-01-09 10:38:19 · 2685 阅读 · 3 评论 -
POJ 1071Illusive Chase(DFS)
Illusive ChaseTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1003 Accepted: 455DescriptionTom the robocat is presented in a Robotics Exhibition for an原创 2014-01-09 20:10:50 · 1567 阅读 · 0 评论 -
HDU 1728逃离迷宫(DFS或者BFS)
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12273 Accepted Submission(s): 2964Problem Description 给定一个m × n (m行, n列)原创 2014-01-11 15:55:49 · 2609 阅读 · 3 评论 -
Ural 1500Pass Licenses(状态压缩dfs)
有k种执照,n个点,m条路,每条路都属于一些执照(拥有指定执照才能走)求从0走到1 最少需要多少执照 枚举 0到k-1 二进制的每一位代表是否拥有该执照,那么只用枚举状态0~(2^(k-1)-1)即可。表示执照是否存在的状态,然后就是dfs暴搜了,在搜的过程中,如果这个状态的需要执照个数>=可行解的最小值,那么不需要搜索,直接换另一种状态。详见代码:#include#incl原创 2014-01-12 14:40:35 · 1254 阅读 · 0 评论 -
数学建模简单bfs跳棋
题目一:总共七个格子,最左边有三颗棋子。用跳棋的规则,最少的步骤使得三个棋子走到七个格子的最右边。代码:#includeream>#include#include#include#includeusing namespace std;int a[8]; //保存信息,比如112保存为1110000int visi[1002]; //看某个状态有没有被访问in原创 2014-02-21 16:11:10 · 2179 阅读 · 0 评论 -
hdu 4739Zhuge Liang's Mines(简单dfs,需要注意重点)
Zhuge Liang's MinesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1166 Accepted Submission(s): 505Problem DescriptionIn the原创 2014-04-28 13:11:23 · 1314 阅读 · 0 评论 -
ZOJ 3681E - Cup 2(记忆化dfs)不好读
E - Cup 2Time Limit: 2 Seconds Memory Limit: 65536 KBThe European Cup final is coming. The past two World Cup winners, Spain and Italy, will contest the decider at Kiev's Olympic Stad原创 2014-05-13 17:14:41 · 1367 阅读 · 0 评论 -
HDU 1258Sum It Up(暴力dfs,记住相同的状态只保留一个)
Sum It UpTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3300 Accepted Submission(s): 1665Problem DescriptionGiven a specifie原创 2013-10-17 23:35:46 · 1218 阅读 · 0 评论 -
HDU 3220Alice’s Cube(按位压缩+BFS)
Alice’s CubeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1520 Accepted Submission(s): 455Problem DescriptionAlice has原创 2013-10-17 16:26:47 · 1446 阅读 · 0 评论 -
HDU 1035Robot Motion(不带回溯的DFS)
Robot MotionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5394 Accepted Submission(s): 2511Problem DescriptionA robot h原创 2013-10-16 15:01:27 · 1104 阅读 · 0 评论 -
dfs棋盘问题,皇后 POJ1321
/* 题目大意:皇后问题,棋盘问题,简单dfs。只是需要注意一个细节 解题思路:直接用行来遍历。 不过dfs(i+1,pos); 用他给的第一个测试数据可以找出这个漏洞。*/#include#include#includeusing namespace std;int a[10]原创 2013-07-03 21:02:24 · 1106 阅读 · 0 评论 -
暴力dfs POJ1426
/* 题目地址:http://poj.org/problem?id=1426 题目大意:找出仅用0和1 组成的十进制的数构成是出入n的倍数(n 解题思路:有人直接打表打了200个,因为并不像想的那样数据那么大,有的直接用数学原理。 当然我用了dfs深搜从第一位1开始往下搜,而且是暴原创 2013-07-02 21:38:14 · 991 阅读 · 0 评论 -
蓝桥杯2012 第五题搜索题
/* “数独”是当下炙手可热的智力游戏。一般认为它的起源是“拉丁方块”,是大数学家欧拉于1783年发明的。 如图[1.jpg]所示:6x6的小格被分为6个部分(图中用不同的颜色区分),每个部分含有6个小格(以下也称为分组)。 开始的时候,某些小格中已经填写了字母(ABCDEF之一)。需要在所有剩下的小格中补填字母。 全部填好后,必须满足如下约束:原创 2013-07-17 10:34:42 · 1845 阅读 · 0 评论 -
HDU 4474 Yet Another Multiple Problem (bfs+mod运算)
题目大意:给你一个数n,找一个最小的是n的倍数的数。但是会给定几个数字不能选。 解题思路:BFS解决,把MOD全部保存起来,不访问已经访问过MOD相同的。 新的mod=(mod*10+i)%n不断再后面加值。 题目地址: Yet Another Multiple Problem#include#include#incl原创 2013-07-23 10:43:36 · 1107 阅读 · 0 评论 -
HDU 1241Oil Deposits(简单搜索题)
Oil DepositsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8471 Accepted Submission(s): 4949Problem DescriptionThe GeoSurvCo原创 2013-09-05 22:33:23 · 1274 阅读 · 0 评论 -
HDU 1372Knight Moves(简单的BFS)
Knight MovesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5121 Accepted Submission(s): 3137Problem DescriptionA friend of y原创 2013-09-06 23:58:08 · 1367 阅读 · 0 评论 -
HDU 1010Tempter of the Bone(奇偶剪枝回溯dfs)
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 55541 Accepted Submission(s): 14983Problem DescriptionThe原创 2013-09-09 23:43:47 · 1402 阅读 · 0 评论 -
HDOJ 搜索题(总共100题)
DFS(Depth First Search )一般是不用hash的,所以很多时候称之为”暴力”,也就是穷举所有情况,一般看几个我们OJ的dfs的版本的题目就可以模仿着做了,因为牵涉到递归,初学者学的时候最好能举一反三,理解其中真谛.DFS --- EASY(15) Tempter of the Bone Safecracker Prime Ring Pro转载 2013-09-10 08:26:32 · 1743 阅读 · 0 评论 -
HDU 1015Safecracker(算是很简单的dfs了,却debug了很久很久)
SafecrackerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6663 Accepted Submission(s): 3330Problem Description=== Op tech br原创 2013-09-10 10:30:06 · 1916 阅读 · 0 评论 -
HDU 1728逃离迷宫(简单dfs)
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11863 Accepted Submission(s): 2858Problem Description 给定一个m × n (m行, n列)原创 2013-09-04 21:37:17 · 1222 阅读 · 0 评论 -
HDU 4460Friend Chains(对每个点BFS)
Friend ChainsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2040 Accepted Submission(s): 712Problem DescriptionFor a group o原创 2013-10-10 12:07:37 · 1540 阅读 · 1 评论 -
HDU 1045Fire Net(暴力DFS)
Fire NetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5191 Accepted Submission(s): 2918Problem DescriptionSuppose that we h原创 2013-10-15 18:53:10 · 1418 阅读 · 0 评论 -
推箱子游戏 最短路径 python实现
推箱子游戏 最短路径 python实现原创 2017-08-11 00:14:43 · 10724 阅读 · 4 评论