
搜索_DFS深搜
Chook_lxk
你前程有在,但须澄心猛省,不可自甘堕落。
展开
-
HDU - 5546 Ancient Go(DFS深搜)
点击打开题目链接Problem DescriptionYu Zhou likes to playGowith Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go.Here i原创 2017-04-06 17:31:15 · 677 阅读 · 0 评论 -
HDU - 3699 A hard Aoshu Problem(暴搜dfs)
点击打开题目链接A hard Aoshu ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 62768/32768 K (Java/Others)Total Submission(s): 1550Accepted Submission(s): 813Problem Descrip原创 2017-07-25 19:29:21 · 612 阅读 · 0 评论 -
UVA - 208 Firetruck(floyd+DFS)
点击打开题目链接题目大意:给出一个无向图及节点n,求解从节点1 到节点n的所有路径,按字典序从小到大输出。思路:先用floyd算法求解连通关系,然后dfs求解。(连通关系也可以用并查集)附上AC代码:#include#includeusing namespace std;int _map[25][25],path[25],used[25];int n,u,v;i原创 2017-08-09 10:47:49 · 505 阅读 · 0 评论 -
POJ - 3009 Curling(dfs)
点击打开题目链接Curling 2.0Time Limit:1000MSMemory Limit:65536KTotal Submissions:21409Accepted:8726DescriptionOn Planet MM-21, after their Olympic gam原创 2017-06-24 18:31:03 · 722 阅读 · 0 评论 -
二分图判定 (挑战程序设计竞赛)
题目:给定一个具有n个顶点的图,要给图上每个顶点染色,并且要使相邻的顶点颜色不同。问是否能最多用2种颜色进行染色?题目保证没有重边和自环。限制条件:1input:3 3(顶点数 边数)0 1(有一条0到1的边)0 2(有一条0到2的边)1 2(有一条1到2的边)output:no先用邻接表将点之间的关系存储下来,然后依次搜索每一个顶点,依次确定相邻顶点的颜色原创 2017-04-07 22:14:31 · 565 阅读 · 0 评论 -
POJ - 1041 John‘s trip(欧拉回路+dfs输出路径)
点击打开题目链接John's tripTime Limit:1000MSMemory Limit:65536KTotal Submissions:8998Accepted:3018Special JudgeDescriptionLittle Johnny has got a原创 2017-04-19 18:19:52 · 791 阅读 · 0 评论 -
HDU - 2894 DeBruijin(欧拉回路)
点击打开题目链接DeBruijinTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 855Accepted Submission(s): 486Problem Description旋转鼓的原创 2017-04-20 22:45:04 · 1051 阅读 · 0 评论 -
POJ - 2230 Watchcow(欧拉回路+dfs输出路径)
点击打开题目链接WatchcowTime Limit:3000MSMemory Limit:65536KTotal Submissions:7926Accepted:3462Special JudgeDescriptionBessie's been appointed th原创 2017-04-21 17:42:37 · 699 阅读 · 0 评论 -
POJ - 2337 Catenyms(欧拉回路+dfs输出路径)
点击打开题目链接CatenymsTime Limit:1000MSMemory Limit:65536KTotal Submissions:12004Accepted:3116DescriptionA catenym is a pair of words separated by a原创 2017-04-21 23:30:19 · 1300 阅读 · 0 评论 -
UVA - 307 Sticks(dfs + 剪枝)
点击打开题目链接 Sticks DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgo原创 2017-05-11 22:49:29 · 1096 阅读 · 0 评论 -
Gym - 100741B Personal programming language(dfs)
点击打开题目链接B. Personal programming languagetime limit per test1.0 smemory limit per test64 MBinputstandard inputoutputstandard outputEverybody knows that you原创 2017-08-23 15:33:48 · 364 阅读 · 0 评论