
ACM_搜索
PoemK
这个作者很懒,什么都没留下…
展开
-
poj 1753 Flip Game
Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34683 Accepted: 15184DescriptionFlip game is played on a rectangular 4x4 field with two-sided原创 2015-08-23 18:32:17 · 273 阅读 · 0 评论 -
uva 10047 The Monocycle BFS
题目:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=988题意:走m*n迷宫,从S到T,'#'是墙,'.'可走,不能出界,走一步花费1s,站着转90度花费1s,要求走过的步数是5的倍数。一开始面朝北。求最少时间。不同于一般的水题,把轮子的原创 2015-10-26 05:18:26 · 595 阅读 · 0 评论 -
poj 1164 The Castle 位运算+并查集/搜索
The CastleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6907 Accepted: 3877Description 1 2 3 4 5 6 7 #########################原创 2015-10-27 20:55:37 · 461 阅读 · 0 评论 -
poj 1176 Party Lamps 搜索
Party LampsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4119 Accepted: 1415DescriptionTo brighten up the gala dinner of the IOI'98 we have a set of N原创 2015-10-29 23:42:43 · 517 阅读 · 0 评论 -
hdu 4474 Yet Another Multiple Problem BFS+同余判重 ★★★★
Yet Another Multiple ProblemTime Limit: 40000/20000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4947 Accepted Submission(s): 1082Problem Descriptio原创 2015-10-29 14:38:30 · 571 阅读 · 0 评论 -
hdu 4751 Divide Groups bfs/dfs 连通性的问题 种子染色法
Divide GroupsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1954 Accepted Submission(s): 701Problem Description This ye原创 2016-05-25 22:07:07 · 398 阅读 · 0 评论 -
USACO 1.3 Wormholes 爆搜+模拟
WormholesFarmer John's hobby of conducting high-energy physics experiments on weekends has backfired, causing N wormholes (2 <= N <= 12, N even) to materialize on his farm, each located at a dis原创 2016-04-21 16:16:29 · 624 阅读 · 0 评论 -
USACO The Castle 种子染色法
Translate:USACO/castleTranslate:USACOThe Castle城堡IOI'94 - Day 1目录 [隐藏] 1 描述2 格式3 SAMPLE INPUT4 SAMPLE OUTPUT[编辑]描述我们憨厚的USACO主人公农夫约翰(Farmer John)以无法想象的原创 2016-04-24 23:28:07 · 528 阅读 · 0 评论 -
uva 11464 Even Parity 递推
题目链接:https://uva.onlinejudge.org/external/114/11464.pdf首先可以知道每个数字,可以改变或不改变(当然 依题意 ,是0才能够改变)这样暴力枚举会超时。那么既然暴力枚举不行,就证明有非暴力的解决方法:1. 贪心或规律,(直接找到解题策略)认为的找出改变方法,此策略对所有情况均适用。2.找出部分规律 ,定下解答的一部分原创 2015-09-06 16:43:13 · 401 阅读 · 0 评论 -
SGU134 Centroid 树形DP基础题,求树的重心
134. Centroidtime limit per test: 0.5 sec. memory limit per test: 4096 KBYou are given an undirected connected graph, with N vertices and N-1 edges (a tree). You must find the cent原创 2015-08-04 09:35:56 · 551 阅读 · 0 评论 -
hdu 4707 Pet 树形DP/DFS 简单题
PetTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1936 Accepted Submission(s): 942Problem DescriptionOne day, Lin Ji wake up原创 2015-08-25 19:41:11 · 497 阅读 · 0 评论 -
hdu 1043 A*算法解决八数码问题
EightTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23880 Accepted Submission(s): 6384Special JudgeProblem DescriptionThe 15-pu原创 2017-06-19 15:48:29 · 706 阅读 · 0 评论 -
poj 1166 The Clocks 暴力搜索
The ClocksTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15336 Accepted: 6219Description|-------| |-------| |-------|| | | |原创 2015-10-26 07:49:25 · 481 阅读 · 0 评论 -
poj 2308 Dearboy's Puzzle 连连看
Dearboy's PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1258 Accepted: 223DescriptionDearboy is a game lover. Recently, he loves playing the g原创 2015-08-03 23:37:06 · 1100 阅读 · 0 评论 -
poj 2965 The Pilots Brothers' refrigerator
The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20973 Accepted: 8109 Special JudgeDescriptionThe game “The Pilots原创 2015-08-24 20:28:41 · 350 阅读 · 0 评论 -
hdu 5379 Mahjong tree DFS 心塞,比赛时没取模 2015 Multi-University Training Contest 7
Mahjong treeTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 227 Accepted Submission(s): 66Problem DescriptionLittle sun is an原创 2015-08-11 20:46:05 · 495 阅读 · 0 评论 -
hdu 1198 Farm Irrigation 搜索/并查集
Farm IrrigationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7425 Accepted Submission(s): 3183Problem DescriptionBenny has原创 2015-08-25 19:22:25 · 524 阅读 · 0 评论 -
poj 3411 Paid Roads
poj 3411 Paid RoadsDescriptionA network of m roads connects N cities (numbered from 1 to N). There may be more than one road connecting one city with another. Some of the roads are原创 2015-08-03 13:51:54 · 906 阅读 · 0 评论 -
BestCoder Round #53 (div.2)1003 Rikka with Graph II 哈密顿路径 dfs
Rikka with Graph II Accepts: 27 Submissions: 614 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionAs we know, Rikka原创 2015-08-29 21:55:36 · 528 阅读 · 0 评论 -
poj 1167 The Buses
The BusesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5848 Accepted: 1617DescriptionA man arrives at a bus stop at 12:00. He remains there during 12:原创 2015-08-03 18:10:04 · 577 阅读 · 0 评论 -
uva 11624 大火蔓延的迷宫 BFS
题目链接:https://uva.onlinejudge.org/external/116/11624.pdf将火也加入BFS中去,人不能到达火已经到达的位置。#include#include#include#include#include#include#include#include#include#include#include#include#i原创 2015-08-31 15:12:24 · 1333 阅读 · 0 评论 -
POJ1465 Multiple BFS+同余判重
给你一个数n 然后给你m个数,让你求一个最小的数,这个数是n的倍数,并且由题目中提供的m个数组成。用BFS。此题可以用同余判断的方法来剪枝。假如 A%X == B%X (设A那么 (A*10+Ki)%X==(B*10+Ki)%X所以A,B之中我们只要取前面的A就行,因为题目要取最小的数,通过同余我们可以知道,A和B这两个数在末尾添加任何相同的数MOD X之后的转载 2015-08-04 21:06:19 · 404 阅读 · 0 评论 -
hdu 5348 MZL's endless loop 2015 Multi-University Training Contest 5
MZL's endless loopTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1830 Accepted Submission(s): 393Special JudgeProblem Descript原创 2015-08-06 08:26:21 · 371 阅读 · 0 评论 -
双向BFS(转)
(转)双向BFS(http://www.cppblog.com/Yuan/archive/2011/02/23/140553.aspx) 如果目标也已知的话,用双向BFS能很大提高速度单向时,是 b^len的扩展。双向的话,2*b^(len/2) 快了很多,特别是分支因子b较大时至于实现上,网上有些做法是用两个队列,交替节点搜索 ×,如下面的伪代码: while转载 2015-08-20 10:05:10 · 375 阅读 · 0 评论 -
uva 11210 Chinese Mahjong 中国麻将 dfs回溯
题目:https://uva.onlinejudge.org/external/112/11210.pdf详见注释:注意这道题的搜索方式,我之前虽然与答案一样,先找出将,再dfs,但是写的远远比答案麻烦。#include#include#include#include#include#include#include#include#include#原创 2015-09-26 23:53:36 · 567 阅读 · 0 评论 -
hdu 1010 Tempter of the Bone 简单带回溯的dfs+奇偶剪枝
题目链接:http://acm.hdu.edu.cn/status.php题意:有一只小狗需要从N*M迷宫里逃离,出发点标记为'S','X'为不可走,'D'为出口,出口是一扇门,只有在T时刻才打开。问小狗能否逃离迷宫?T (1 简单带回溯的dfs,很久以前做过,时隔两年,为了复习算法又遇此题。结果还超时了,一脸懵逼,然后果断看以前的代码(我好菜),加了一个奇偶剪枝,AC原创 2017-07-04 21:55:28 · 255 阅读 · 0 评论