
ACM_搜索
kewlgrl
好大一只咸鱼哇
展开
-
深度优先搜索DFS(迷宫问题)
问题及代码:给出迷宫的图纸和初始终点位置,用DFS求最小步数。#include using namespace std;int n,m,p,q,MIN=99999999;int a[51][51],book[51][51];void dfs(int x,int y,int step){ int next[4][2]= {{0,1},{1,0},{0,-1},{-1,0}原创 2016-03-30 08:46:31 · 5426 阅读 · 4 评论 -
POJ 3126-Prime Path(BFS-素数变换一位)
Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19095 Accepted: 10711DescriptionThe ministers of the cabinet were quite upset by the message原创 2017-02-18 16:49:31 · 859 阅读 · 0 评论 -
POJ 2676-Sudoku(DFS-数独)
SudokuTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 19638 Accepted: 9408 Special JudgeDescriptionSudoku is a very simple task. A square table with原创 2017-02-19 14:04:16 · 580 阅读 · 0 评论 -
POJ 3278-Catch That Cow(BFS-一维广搜)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 82618 Accepted: 25955DescriptionFarmer John has been informed of the location of a fugitiv原创 2017-01-24 13:45:54 · 563 阅读 · 0 评论 -
POJ 1416-Shredding Company(DFS-分割数字)
Shredding CompanyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6035 Accepted: 3299DescriptionYou have just been put in charge of developing a new shre原创 2017-03-02 17:47:39 · 567 阅读 · 0 评论 -
POJ 2251-Dungeon Master(BFS-三维迷宫)
Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 30842 Accepted: 11948DescriptionYou are trapped in a 3D dungeon and need to find the quick原创 2017-03-03 14:35:35 · 737 阅读 · 0 评论 -
POJ 3414-Pots(BFS-模拟倒水)
PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15785 Accepted: 6661 Special JudgeDescriptionYou are given two pots, having the volume of A and原创 2017-02-24 14:35:34 · 896 阅读 · 0 评论 -
POJ 2488-A Knight's Journey(DFS-象棋中的马)
A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 43947 Accepted: 14931DescriptionBackground The knight is getting bored of seeing the原创 2017-03-09 19:33:09 · 596 阅读 · 0 评论 -
POJ 3009-Curling 2.0(DFS-滑动撞击)
Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20305 Accepted: 8282DescriptionOn Planet MM-21, after their Olympic games this year, curling原创 2017-03-10 11:01:06 · 441 阅读 · 0 评论 -
POJ 1562-Oil Deposits-油田搜索
问题及代码:Problem C Oil DepositsTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 3Font: Times Ne原创 2015-02-27 22:05:59 · 1412 阅读 · 0 评论 -
POJ 1657-Distance on Chessboard(BFS-多种方向不限步数)
Distance on ChessboardTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26931 Accepted: 9124Description国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示: 王、后、车、象原创 2017-05-01 14:13:00 · 763 阅读 · 0 评论 -
蓝桥杯-算法提高 学霸的迷宫(BFS-倒向追踪输出移动方向)
算法提高 学霸的迷宫 时间限制:1.0s 内存限制:256.0MB 问题描述 学霸抢走了大家的作业,班长为了帮同学们找回作业,决定去找学霸决斗。但学霸为了不要别人打扰,住在一个城堡里,城堡外面是一个二维的格子迷宫,要进城堡必须得先通过迷宫。因为班长还有妹子要陪,磨刀不误砍柴功,他为了节约时间,从线人那里搞到了迷宫的地图,准备提前计算最短的路线。原创 2017-04-06 17:03:51 · 1007 阅读 · 0 评论 -
POJ 1915-Knight Moves(BFS-跳马)
Knight MovesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 26034 Accepted: 12276DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asse原创 2017-04-27 10:49:05 · 582 阅读 · 0 评论 -
POJ 2243-Knight Moves(DFS-跳马)
Knight MovesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13444 Accepted: 7525DescriptionA friend of you is doing research on the Traveling Knight Pro原创 2016-07-29 16:00:13 · 920 阅读 · 0 评论 -
POJ 1465-Multiple(BFS-最小整倍数)
MultipleTime Limit: 1000MS Memory Limit: 32768KTotal Submissions: 7106 Accepted: 1524Descriptiona program that, given a natural number N between 0 and 4999 (inclusi原创 2016-07-29 12:23:10 · 790 阅读 · 0 评论 -
POJ-1979 Red and Black-走方砖
Red and BlackTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 26092 Accepted: 14163DescriptionThere is a rectangular room, covered with square tiles. Eac原创 2015-08-08 08:33:42 · 602 阅读 · 0 评论 -
广度优先搜索BFS(迷宫问题)
问题及代码:给出迷宫的图纸和初始终点位置,用DFS求最小步数。#include #include using namespace std;int a[51][51],book[51][51];int sx,sy,n,m,p,q;struct note{ int x,y,f,s;//坐标、父亲在队列中的编号(不求路径,可省略)、步数} que[2501];原创 2016-03-30 09:23:46 · 1398 阅读 · 0 评论 -
山东省第一届ACM大学生程序设计竞赛-Balloons(搜索)
问题及代码:Balloons Time Limit: 1000MS Memory limit: 65536K 题目描述Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly bal原创 2016-04-01 19:54:15 · 614 阅读 · 0 评论 -
POJ-1664 放苹果
放苹果Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28356 Accepted: 17939Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。原创 2015-08-08 17:45:09 · 586 阅读 · 0 评论 -
HDU-a strange lift-BFS
问题及代码:Problem G a strange liftTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 3 Accepted Submission(s) : 3Font: Times New Rom原创 2015-03-05 10:46:12 · 812 阅读 · 0 评论 -
HDU-N皇后问题-DFS深度搜索
问题及代码:Problem D N皇后问题Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 3 Accepted Submission(s) : 2Font: Times New Roman | Verda原创 2015-03-03 13:31:58 · 1108 阅读 · 0 评论 -
HDU-Tempter of the Bone-小狗走迷宫(DFS&&剪枝||奇偶剪枝)
问题及代码:Problem E Tempter of the BoneTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 4Font: Times New原创 2015-02-27 22:20:32 · 1647 阅读 · 0 评论 -
HDU-Red and Black- 走方砖
问题及代码:Problem B Red and BlackTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 10 Accepted Submission(s) : 5Font: Times New Roma原创 2015-02-25 11:04:21 · 1070 阅读 · 0 评论 -
HDU-Robot Motion-机器人移动
问题及代码:Problem A Robot MotionTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 5Font: Times New Roman |原创 2015-02-25 10:58:36 · 1119 阅读 · 2 评论 -
HDU-Tri Tiling-铺方格
问题及代码:Tri TilingTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 3 Accepted Submission(s) : 2Font: Times New Roman | Verdana | Ge原创 2015-02-08 23:52:16 · 1145 阅读 · 0 评论 -
POJ 1753-Flip Game(枚举&&DFS)
Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 38472 Accepted: 16721DescriptionFlip game is played on a rectangular 4x4 field with two-sided p原创 2016-04-26 20:46:35 · 692 阅读 · 0 评论 -
POJ 2965-The Pilots Brothers' refrigerator(枚举&&DFS&&输出过程)
The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23018 Accepted: 8862 Special JudgeDescriptionThe game “The Pilots原创 2016-04-26 21:46:48 · 578 阅读 · 0 评论 -
象棋 马 遍历情况
#include#include#include#include#include#include#includeusing namespace std;#define MAXN 1000010#define MOD 1000000000int vis[3][4],map[3][4];int dir[8][2]= {{-2,-1},{-2,1},{-1,-2},{-1,2},{原创 2016-05-27 09:35:06 · 2242 阅读 · 0 评论 -
C4top-肿瘤诊断(BFS-三维搜索)
肿瘤诊断 在诊断肿瘤疾病时,计算肿瘤体积是很重要的一环。给定病灶扫描切片中标注出的疑似肿瘤区域,请你计算肿瘤的体积。输入格式:输入第一行给出4个正整数:MM、NN、LL、TT,其中MM和NN是每张切片的尺寸(即每张切片是一个M\times NM×N的像素矩阵。最大分辨率是1286\times 1281286×128);LL(\le 60≤60)是切片的张数;TT是一个整数阈值(若疑似肿瘤的连通...原创 2017-03-24 16:24:52 · 1338 阅读 · 0 评论