DFS
文章平均质量分 85
kyoma
这个kyoma就是逊啦
展开
-
hdu5925 Coconuts 离散化 dfs搜索 TWT Tokyo Olympic 1combo-1
#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long ll;const int N = 1000;int zx[N], zy[N];int gx[N]原创 2016-10-06 20:43:51 · 519 阅读 · 0 评论 -
uva11882 Biggest Number dfs搜索 剪很多枝
奶奶的有一天mirror58229提起一道dfs题 还是我们学校oj的,她说写的很麻烦 我就凑过去看,啊!这么标准的dfs究竟哪里会麻烦了呢? 。 。 。 。 于是就自己写了。。。 真的好麻烦啊!!! TLE到WA到TLE。。。。 去网上搜题解都说要dfs走一步bfs一下,奶奶的好麻烦啊!! 我就是不想写bfs啊!!! 另外一个方法(当前结果已为最长,若此时搜索的第一个字比当原创 2016-11-18 01:23:16 · 443 阅读 · 0 评论 -
2016年首届南航-河海联合程序设计竞赛暨第十一届南航程序设计竞赛 题解
问题 A: Unhappy sion时间限制: 1 Sec 内存限制: 128 MB提交: 335 解决: 153[提交][状态][讨论版]题目描述After 2rd ccpc,UNCLE RAN give sion a task,sion have to set 10 questions for this contest.But as a acm fan,原创 2016-12-04 23:27:01 · 1170 阅读 · 0 评论 -
hdu2016校赛1002递增数 dfs搜索
递增数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 921 Accepted Submission(s): 196Problem Description若一个正整数A,相邻位总是满足低位大于等于高位,原创 2016-12-26 21:49:13 · 731 阅读 · 0 评论 -
poj1426 Find The Multiple dfs搜索答案
Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28704 Accepted: 11898 Special JudgeDescriptionGiven a positive integer n, write a原创 2017-01-07 10:13:39 · 265 阅读 · 0 评论 -
poj3279 Fliptile dfs暴力枚举状态
FliptileTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8632 Accepted: 3230DescriptionFarmer John knows that an intellectually satisfied cow is a happ原创 2017-01-21 00:44:59 · 696 阅读 · 1 评论 -
Hdu1539 Shredding Company dfs搜索
Shredding CompanyTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 679 Accepted Submission(s): 222Problem DescriptionYou have j原创 2017-03-01 20:35:35 · 341 阅读 · 0 评论 -
hdu1010 Tempter of the Bone dfs搜索 剪枝
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 116519 Accepted Submission(s): 31594Problem DescriptionThe原创 2017-03-02 18:03:38 · 266 阅读 · 0 评论 -
hdu2553 n皇后问题 dfs搜索 记忆化
N皇后问题Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21710 Accepted Submission(s): 9709Problem Description在N*N的方格棋盘放置了N个皇后,使得原创 2017-03-02 23:06:37 · 318 阅读 · 0 评论 -
hdu1728 逃离迷宫 dfs搜索剪枝
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25424 Accepted Submission(s): 6204Problem Description 给定一个m × n (m行, n列)原创 2017-03-03 20:02:13 · 379 阅读 · 0 评论 -
Codeforces 780C Andryusha and Colored Balloons 搜索dfs
C. Andryusha and Colored Balloonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha goes through a原创 2017-03-11 14:58:31 · 464 阅读 · 0 评论 -
poj2965 The Pilots Brothers' refrigerator dfs+枚举
The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24732 Accepted: 9535 Special JudgeDescriptionThe game “The Pilo原创 2016-11-02 18:00:03 · 361 阅读 · 0 评论 -
poj1753 Flip Game dfs 枚举 待补完 位运算
Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41219 Accepted: 17896DescriptionFlip game is played on a rectangular 4x4 field with two-sided原创 2016-11-02 17:30:10 · 430 阅读 · 0 评论 -
HHUOJ LCM and Walk 数学 逆推 gcd&lcm DFS TWT Tokyo Olympic 2Combo -1
问题 D: LCM and Walk时间限制: 1 Sec 内存限制: 128 MB提交: 7 解决: 4[提交][状态][讨论版]题目描述Jerry has just learned some number theory, and can't wait to show his ability to Tom.Now Jerry is sitting on a grid原创 2016-09-09 16:35:31 · 1229 阅读 · 0 评论 -
poj2386 Lake Counting dfs入门 TWT Tokyo Olympic 2combo-2
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 30099 Accepted: 15044DescriptionDue to recent rains, water has pooled in various places i原创 2016-09-23 14:19:36 · 448 阅读 · 0 评论 -
蓝桥杯 振兴中华 dfs入门 TWT Tokyo Olympic 2combo-3
/* ━━━━━┒ ┓┏┓┏┓┃μ'sic foever!! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃┃ ┻┻┻┻┻┻ */#include #include #include #include #include #include原创 2016-09-23 15:26:10 · 327 阅读 · 0 评论 -
poj1321 棋盘问题 dfs入门 TWT Tokyo Olympic 1combo-1
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 36938 Accepted: 18203Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编原创 2016-09-25 22:56:28 · 366 阅读 · 0 评论 -
hdu1241 Oil Deposits dfs水题 TWT Tokyo Olympic 2combo-3
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原创 2016-09-26 19:04:33 · 383 阅读 · 0 评论 -
hdu1285 确定比赛名次 拓扑排序学习 待补完
确定比赛名次Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23153 Accepted Submission(s): 9378Problem Description有N个比赛队(1原创 2016-10-20 17:21:39 · 290 阅读 · 0 评论 -
POJ3414 Pots BFS搜索 TWT TokyoOlympic 4combo-2
/* ━━━━━┒ ┓┏┓┏┓┃μ'sic foever!! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃┃ ┻┻┻┻┻┻ */#include #include #include #include #include #include原创 2016-09-28 18:19:09 · 462 阅读 · 0 评论 -
hdu5546 Ancient Go DFS搜索 国庆咸鱼
Ancient GoTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1660 Accepted Submission(s): 528Problem DescriptionYu Zhou likes to原创 2016-10-05 17:00:13 · 689 阅读 · 0 评论 -
poj1416 Shredding Company dfs 记录路径
Shredding CompanyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5657 Accepted: 3175DescriptionYou have just been put in charge of developing a new sh原创 2016-10-28 15:41:25 · 379 阅读 · 0 评论 -
UVA10305 Ordering Tasks 拓扑排序
用了dfs模版写居然wa了。。。抓狂。。。。两道拓扑排序都和我有仇。。。还以为自己写错了。。。。看了好几遍还是没啥问题。。。结果居然。。。这题的m可能等于0.。。。。我的判断是m==0的话就停止输入。。。呵呵。。。代码:#include #include #include #include #include #include #include #inclu原创 2016-10-20 17:50:58 · 373 阅读 · 0 评论 -
[kuangbin带你飞]专题二 搜索进阶 题解(康托展开、映射、迭代加深)
专题链接A:Eight经典的八数码问题,这题直接bfs是不行的,时限不够,主要是在每个状态判重的时候使用map,在这里的复杂度可以通过康托展开来达到查重O(1),那么!什么是康托展开呢?! 我觉得这个博客写的很好,总之康托展开用来看当前状态中在全排列中是第几个,可以把问题的全部状态不用map来表示 这题hdu是多组样例输入,poj则单组。 本来网上写做这题要有八境界,把代码写八遍原创 2017-12-01 15:22:49 · 498 阅读 · 0 评论