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 · 5514 阅读 · 4 评论 -
POJ 3126-Prime Path(BFS-素数变换一位)
Prime Path Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 19095 Accepted: 10711 Description The ministers of the cabinet were quite upset by the message原创 2017-02-18 16:49:31 · 914 阅读 · 0 评论 -
POJ 2676-Sudoku(DFS-数独)
Sudoku Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19638 Accepted: 9408 Special Judge Description Sudoku is a very simple task. A square table with原创 2017-02-19 14:04:16 · 617 阅读 · 0 评论 -
POJ 3278-Catch That Cow(BFS-一维广搜)
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 82618 Accepted: 25955 Description Farmer John has been informed of the location of a fugitiv原创 2017-01-24 13:45:54 · 606 阅读 · 0 评论 -
POJ 1416-Shredding Company(DFS-分割数字)
Shredding Company Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6035 Accepted: 3299 Description You have just been put in charge of developing a new shre原创 2017-03-02 17:47:39 · 647 阅读 · 0 评论 -
POJ 2251-Dungeon Master(BFS-三维迷宫)
Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30842 Accepted: 11948 Description You are trapped in a 3D dungeon and need to find the quick原创 2017-03-03 14:35:35 · 769 阅读 · 0 评论 -
POJ 3414-Pots(BFS-模拟倒水)
Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15785 Accepted: 6661 Special Judge Description You are given two pots, having the volume of A and原创 2017-02-24 14:35:34 · 939 阅读 · 0 评论 -
POJ 2488-A Knight's Journey(DFS-象棋中的马)
A Knight's Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 43947 Accepted: 14931 Description Background The knight is getting bored of seeing the原创 2017-03-09 19:33:09 · 623 阅读 · 0 评论 -
POJ 3009-Curling 2.0(DFS-滑动撞击)
Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20305 Accepted: 8282 Description On Planet MM-21, after their Olympic games this year, curling原创 2017-03-10 11:01:06 · 465 阅读 · 0 评论 -
POJ 1562-Oil Deposits-油田搜索
问题及代码: Problem C Oil Deposits Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 6 Accepted Submission(s) : 3 Font: Times Ne原创 2015-02-27 22:05:59 · 1445 阅读 · 0 评论 -
POJ 1657-Distance on Chessboard(BFS-多种方向不限步数)
Distance on Chessboard Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 26931 Accepted: 9124 Description 国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示: 王、后、车、象原创 2017-05-01 14:13:00 · 814 阅读 · 0 评论 -
蓝桥杯-算法提高 学霸的迷宫(BFS-倒向追踪输出移动方向)
算法提高 学霸的迷宫 时间限制:1.0s 内存限制:256.0MB 问题描述 学霸抢走了大家的作业,班长为了帮同学们找回作业,决定去找学霸决斗。但学霸为了不要别人打扰,住在一个城堡里,城堡外面是一个二维的格子迷宫,要进城堡必须得先通过迷宫。因为班长还有妹子要陪,磨刀不误砍柴功,他为了节约时间,从线人那里搞到了迷宫的地图,准备提前计算最短的路线。原创 2017-04-06 17:03:51 · 1112 阅读 · 0 评论 -
POJ 1915-Knight Moves(BFS-跳马)
Knight Moves Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 26034 Accepted: 12276 Description Background Mr Somurolov, fabulous chess-gamer indeed, asse原创 2017-04-27 10:49:05 · 628 阅读 · 0 评论 -
POJ 2243-Knight Moves(DFS-跳马)
Knight Moves Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 13444 Accepted: 7525 Description A friend of you is doing research on the Traveling Knight Pro原创 2016-07-29 16:00:13 · 971 阅读 · 0 评论 -
POJ 1465-Multiple(BFS-最小整倍数)
Multiple Time Limit: 1000MS Memory Limit: 32768K Total Submissions: 7106 Accepted: 1524 Description a program that, given a natural number N between 0 and 4999 (inclusi原创 2016-07-29 12:23:10 · 829 阅读 · 0 评论 -
POJ-1979 Red and Black-走方砖
Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 26092 Accepted: 14163 Description There is a rectangular room, covered with square tiles. Eac原创 2015-08-08 08:33:42 · 635 阅读 · 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 · 1442 阅读 · 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 · 644 阅读 · 0 评论 -
POJ-1664 放苹果
放苹果 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28356 Accepted: 17939 Description 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。原创 2015-08-08 17:45:09 · 622 阅读 · 0 评论 -
HDU-a strange lift-BFS
问题及代码: Problem G a strange lift Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 3 Accepted Submission(s) : 3 Font: Times New Rom原创 2015-03-05 10:46:12 · 845 阅读 · 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) : 2 Font: Times New Roman | Verda原创 2015-03-03 13:31:58 · 1154 阅读 · 0 评论 -
HDU-Tempter of the Bone-小狗走迷宫(DFS&&剪枝||奇偶剪枝)
问题及代码: Problem E Tempter of the Bone Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 7 Accepted Submission(s) : 4 Font: Times New原创 2015-02-27 22:20:32 · 1696 阅读 · 0 评论 -
HDU-Red and Black- 走方砖
问题及代码: Problem B Red and Black Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 10 Accepted Submission(s) : 5 Font: Times New Roma原创 2015-02-25 11:04:21 · 1112 阅读 · 0 评论 -
HDU-Robot Motion-机器人移动
问题及代码: Problem A Robot Motion Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 7 Accepted Submission(s) : 5 Font: Times New Roman |原创 2015-02-25 10:58:36 · 1152 阅读 · 2 评论 -
HDU-Tri Tiling-铺方格
问题及代码: Tri Tiling Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 3 Accepted Submission(s) : 2 Font: Times New Roman | Verdana | Ge原创 2015-02-08 23:52:16 · 1174 阅读 · 0 评论 -
POJ 1753-Flip Game(枚举&&DFS)
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 38472 Accepted: 16721 Description Flip game is played on a rectangular 4x4 field with two-sided p原创 2016-04-26 20:46:35 · 739 阅读 · 0 评论 -
POJ 2965-The Pilots Brothers' refrigerator(枚举&&DFS&&输出过程)
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23018 Accepted: 8862 Special Judge Description The game “The Pilots原创 2016-04-26 21:46:48 · 617 阅读 · 0 评论 -
象棋 马 遍历情况
#include #include #include #include #include #include #include using namespace std; #define MAXN 1000010 #define MOD 1000000000 int vis[3][4],map[3][4]; int dir[8][2]= {{-2,-1},{-2,1},{-1,-2},{-1,2},{原创 2016-05-27 09:35:06 · 2283 阅读 · 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 · 1375 阅读 · 0 评论
分享