![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索算法
sdau20163940
努力学习,天天向上!
展开
-
D-04
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及原创 2017-05-14 13:34:43 · 240 阅读 · 0 评论 -
Prime Path (广搜)
Prime Path Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 7Problem DescriptionThe ministers of the cabinet原创 2017-08-01 11:44:58 · 234 阅读 · 0 评论 -
Shredding Company (dfs)
Shredding Company Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 37 Accepted Submission(s) : 17Problem DescriptionYou have just been pu原创 2017-08-08 09:41:55 · 1628 阅读 · 0 评论 -
昂贵的聘礼 (dfs)
昂贵的聘礼 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 68 Accepted Submission(s) : 21Problem Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于原创 2017-08-08 20:38:07 · 222 阅读 · 0 评论 -
Dungeon Master (广搜)
Dungeon Master Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 38 Accepted Submission(s) : 13Problem DescriptionYou are trapped in a 3D原创 2017-08-02 10:14:26 · 280 阅读 · 0 评论 -
Shuffle'm Up
Shuffle'm Up Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 23 Accepted Submission(s) : 11Problem DescriptionA common pastime for po原创 2017-08-02 15:53:54 · 190 阅读 · 0 评论 -
Sudoku (深搜)
Sudoku Time Limit : 4000/2000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 30 Accepted Submission(s) : 14Special Judge Problem DescriptionSudoku is a ver原创 2017-08-02 17:53:41 · 814 阅读 · 0 评论 -
Channel Allocation (深搜)
Channel Allocation Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 13 Accepted Submission(s) : 6Problem DescriptionWhen a radio station原创 2017-08-02 21:30:59 · 1297 阅读 · 0 评论 -
Pots
Pots Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 57 Accepted Submission(s) : 16Special Judge Problem DescriptionYou are given t原创 2017-08-03 11:34:02 · 218 阅读 · 0 评论 -
Satellite Photographs(dfs)
Satellite PhotographsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6092 Accepted: 2874DescriptionFarmer John purchased satellite photos of W x H pixel原创 2017-08-10 19:21:01 · 239 阅读 · 0 评论 -
Hopscotch(dfs)
HopscotchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4453 Accepted: 2973DescriptionThe cows play the child's game of hopscotch in a non-traditional原创 2017-08-10 19:30:45 · 188 阅读 · 0 评论 -
Securing the Barn(dfs)
Securing the BarnTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2304 Accepted: 1466DescriptionFarmer John has installed a new security system on the ba原创 2017-08-10 19:36:53 · 249 阅读 · 0 评论 -
计蒜客第四场 A(搜索)
商汤科技致力于引领人工智能核心“深度学习”技术突破,构建人工智能、大数据分析行业解决方案。作为一家人工智能公司,用机器自动地解决各类实际问题自然不在话下。近日,商汤科技推出了一套安全令牌,令牌如下图所示:安全令牌上的小孔有 nn 行 mm 列,不过有些行和有些列已经用导线整体焊接了,共有 kk 根导线。我们可以在安全令牌上 不重叠 地焊接若干个小芯片,每个芯片需要在相邻(不能斜着相邻,原创 2017-05-28 23:20:39 · 307 阅读 · 0 评论 -
Network Saboteur (深搜)
Network Saboteur Time Limit : 4000/2000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 27 Accepted Submission(s) : 11Problem DescriptionA university network原创 2017-08-03 21:35:57 · 402 阅读 · 0 评论 -
Scales(dfs背包+剪枝)
ScalesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3148 Accepted: 851DescriptionFarmer John has a balance for weighing the cows. He also has a set of原创 2017-08-17 21:36:51 · 288 阅读 · 0 评论 -
Curling 2.0 (深搜)
Curling 2.0 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 38 Accepted Submission(s) : 9Problem DescriptionOn Planet MM-21, after th原创 2017-08-04 11:28:27 · 359 阅读 · 0 评论 -
Children of the Candy Corn (dfs+bfs)
Children of the Candy Corn Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 72 Accepted Submission(s) : 27Problem DescriptionThe cornfie原创 2017-08-05 10:46:42 · 353 阅读 · 0 评论 -
Find The Multiple (深度搜索)
Find The Multiple Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 31 Accepted Submission(s) : 11Special Judge Problem DescriptionGiven原创 2017-08-01 10:09:23 · 434 阅读 · 0 评论 -
A Knight's Journey (深度搜索+字典序)
A Knight's Journey Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 125 Accepted Submission(s) : 26Problem DescriptionBackgroundThe kn原创 2017-08-01 09:12:35 · 1424 阅读 · 1 评论 -
棋盘问题
wa一路。。。蒙圈了,到最后还是a了,很简单一个题,只不过脑子混乱了。思路:用sensou原创 2017-07-31 23:06:24 · 190 阅读 · 0 评论 -
P - 16
DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid原创 2017-05-14 13:44:05 · 193 阅读 · 0 评论 -
G-07
DescriptionFarmer 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,000) on a number line and the cow is at a point原创 2017-05-14 13:59:42 · 167 阅读 · 0 评论 -
Q - 17 深度搜索
DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. No原创 2017-05-16 23:47:10 · 222 阅读 · 0 评论 -
L - 12(BFS)
DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one原创 2017-05-27 22:59:19 · 277 阅读 · 0 评论 -
H - 08
题意:就是给你几组测试数据,一个n代表一个,让你寻找n的倍数只含0 1,输出其中任意一个即可!思路:采用搜索的方法,如果搜索到m则退出,否则搜索m*10和m*10+1这两种路径!!细节:使用int ,long long int 会爆,需要使用unsigned long long来进行存储,还有就是,一开始不知道到底要搜到多少位是才return,看了题解。。。19位!!!!代原创 2017-05-10 00:28:50 · 249 阅读 · 0 评论 -
B - 02
DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is原创 2017-05-20 19:44:55 · 195 阅读 · 0 评论 -
O - 15(二分)
DescriptionInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It wa原创 2017-05-20 19:57:49 · 187 阅读 · 0 评论 -
T - 20(BFS)
DescriptionBackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The ProblemYour ta原创 2017-05-20 21:41:33 · 197 阅读 · 0 评论 -
I - 09(广搜)
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It原创 2017-05-21 16:48:33 · 294 阅读 · 0 评论 -
Kill the monster(深搜)
Problem DescriptionThere is a mountain near yifenfei’s hometown. On the mountain lived a big monster. As a hero in hometown, yifenfei wants to kill it. Now we know yifenfei have n spells, and th原创 2017-06-17 16:56:44 · 572 阅读 · 0 评论 -
Sudoku Killer(深搜)
Problem Description自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔签名以及同hdu acm team合影留念的机会。所以全球人民前仆后继,为了奖品日夜训练茶饭不思。当然也包括初学者原创 2017-06-17 23:06:53 · 672 阅读 · 0 评论 -
Sequence one(深搜)
Problem DescriptionSearch is important in the acm algorithm. When you want to solve a problem by using the search method, try to cut is very important.Now give you a number sequence, include n (转载 2017-06-18 00:36:39 · 245 阅读 · 0 评论 -
F - 06(深)
DescriptionTechnicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an obj原创 2017-05-22 15:07:05 · 267 阅读 · 0 评论 -
knight moves(典型广搜)
题意:已知国际象棋中骑士得走法(如图),。现给定棋盘大小与起始位置,问一个骑士从起点走到终点,至少需要多少步?思路:BFS。一般要求最少步数用广搜。由于问的是最少步数,而且又是棋盘遍历题,所以优先考虑BFS。对于一个点,扫描其8个方向,若该方向上的下一个点未走过,则将该点入队,标记。最终就是检验一下最终步数即可。由于是广度优先,所以第一次找到得步数一定是最小的。代码:#incl原创 2017-07-31 17:18:31 · 964 阅读 · 0 评论 -
简单搜索(基础)
任何一个大于1得自然数n,总可以拆分成若干个小于n得自然数之和!代码:#include using namespace std;int a[10001]={1},n,total;int search(int ,int );int print(int);int main(){ cin>>n; search(n,1); //将要拆分的数传递给s cou原创 2017-07-31 20:24:25 · 224 阅读 · 0 评论 -
Catch That Cow
Catch That CowTime Limit : 4000/2000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 89 Accepted Submission(s) : 24Problem DescriptionFarmer John has been i原创 2017-07-31 21:48:17 · 224 阅读 · 0 评论 -
Knights of Ni(两次bfs)
Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In order to pass through safely, the Knights have demanded that原创 2017-08-15 19:00:40 · 341 阅读 · 0 评论