
搜索
文章平均质量分 83
Twenty_seven
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj3187 穷竭搜索
如题:http://lol.duowan.com/1501/286125181396.html Backward Digit Sums Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4705 Accepted: 2703 Description FJ an原创 2015-02-21 19:57:21 · 387 阅读 · 0 评论 -
蓝桥2014-9 地宫取宝
如题: 标题:地宫取宝 X 国王有一个地宫宝库。是 n x m 个格子的矩阵。每个格子放一件宝贝。每个宝贝贴着价值标签。 地宫的入口在左上角,出口在右下角。 小明被带到地宫的入口,国王要求他只能向右或向下行走。 走过某个格子时,如果那个格子中的宝贝价值比小明手中任意宝贝价值都大,小明就可以拿起它(当然,也可以不拿)。 当小明走到出口时,如果他原创 2015-02-09 12:12:36 · 427 阅读 · 0 评论 -
蓝桥2014 六角填数
如题: 标题:六角填数 如图【1.png】所示六角形中,填入1~12的数字。 使得每条直线上的数字之和都相同。 图中,已经替你填好了3个数字,请你计算星号位置所代表的数字是多少? 请通过浏览器提交答案,不要填写多余的内容。 思路: 按照提议列出6个值,让他们相等。 x0-x8是2,4,5,6,7,9,10,11,12原创 2015-02-07 20:46:36 · 603 阅读 · 0 评论 -
poj2488
如题:http://poj.org/problem?id=2488 马踏棋盘问题,原创 2014-11-05 20:25:38 · 545 阅读 · 0 评论 -
poj 1129 四色原理DFS
如题: 用中继器(repeater)给每个接受者(receiver)发送信号,为了防止信号干扰,两个相邻的广播站之间的中继器要不相同。问至少需要多少个中继器。原创 2014-11-02 10:41:52 · 1083 阅读 · 0 评论 -
蓝桥2013 带分数
很好的全排列算法,清晰的递归思路,值得好好学习! 时间限制:1.0s 内存限制:256.0MB 问题描述 100 可以表示为带分数的形式:100 = 3 + 69258 / 714。 还可以表示为:100 = 82 + 3546 / 197。 注意特征:带分数中,数字1~9分别出现且只出现一次(不包含0)。 类似这样的带分数,100 有转载 2015-02-05 20:36:28 · 679 阅读 · 0 评论 -
poj1011 搜索
如题:http://poj.org/problem?id=1011 Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 125397 Accepted: 29215 Description George took sticks of the same l原创 2015-03-30 16:18:06 · 442 阅读 · 0 评论 -
poj1020 搜索
如题:http://poj.org/problem?id=1020 Anniversary Cake Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15696 Accepted: 5120 Description Nahid Khaleh decides to原创 2015-04-24 23:53:44 · 598 阅读 · 0 评论 -
poj1022 图的bfs
如题:http://poj.org/problem?id=1022 Packing Unit 4D Cubes Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 1964 Accepted: 626 Description We usually原创 2015-04-26 16:54:39 · 643 阅读 · 0 评论 -
poj1027 模拟 坑..
如题:http://poj.org/problem?id=1027 The Same Game Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4963 Accepted: 1859 Description The game named "Sa原创 2015-05-02 21:49:52 · 463 阅读 · 0 评论 -
poj1753 枚举
http://poj.org/problem?id=1753原创 2014-10-26 11:09:42 · 514 阅读 · 0 评论 -
POJ 1011 搜索剪枝
#include #include using namespace std; int len[68]; //小木棍的长度 int visited[68]; //小木棍是否被访问过 int N; int cmp(const void * a,const void * b) //升序 { return *(int *)b-*(int *)a; } int DFS(int原创 2014-10-31 22:51:17 · 667 阅读 · 0 评论 -
poj 3278 bfs
如图:http://poj.org/problem?id=3278 广搜 #include using namespace std; #include int visited[100004]; struct node { int num; int count; node(int n,int m) { num=原创 2014-12-03 18:48:45 · 461 阅读 · 0 评论 -
poj2718 穷举
POJ 2718 Smallest Difference 将一个数切一刀拆成两个数,两个数每一位数字的顺序都可改变,但是不能有前导0。求这两个数之差的最小值。 我使用了搜索并且避免了递归,自认为是比较好的算法。 一开始我想到的是枚举,并且很快给出了实现: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16转载 2015-02-21 14:29:23 · 494 阅读 · 0 评论 -
poj3669 BFS
如题:http://poj.org/problem?id=3669 Meteor Shower Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9809 Accepted: 2741 Description Bessie hears that an原创 2015-02-13 19:03:32 · 396 阅读 · 0 评论 -
poj3126 BFS
如题:http://poj.org/problem?id=3126 Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit roo原创 2015-02-13 01:06:49 · 373 阅读 · 0 评论 -
poj 3414 广搜
如题:http://poj.org/problem?id=3414 题目要求输入3个数A,B,C,分别代表第一个杯子可以装水的容量A,第二个杯子可以装水的容量B,要求输出通过6种操作,是否而已让2个杯子中出现C升水。 给出6种操作。"FILL(1)","FILL(2)","DROP(1)","DROP(2)","POUR(1,2)","POUR(2,1)"。 要求输出最原创 2015-01-03 21:21:07 · 410 阅读 · 0 评论 -
poj 3009 深搜
如题:http://poj.org/problem?id=3009 题目给出一个迷宫,2是开始,3代表结束,规定了走法。可以沿一个方向一直走,碰到石头(1)后停下,石头消失,然后再选择一个方向走。要注意的是,如果下一步可以走的格子是石头,是不可以走那个方向,并且移除石头的。 让求出最短的步数。 一开始看到最短步数想到广搜,但是每搜索一个状态时,地图会发生原创 2015-01-02 23:42:18 · 439 阅读 · 0 评论 -
poj 3083 深搜+广搜
如题:http://poj.org/problem?id=3083 今天可是元旦,好想找妹纸出去玩啊...算了 还是敲代码吧............~~~~ 题目给出一个迷宫,'#'是墙,不能走,‘.’是路,能走,要从起点‘S’走到终点'E'。 题目要分别输出3中走法的步数,第一种左转优先,第二种右转优先。注意,如果是第一种,当前这一步是右转得来的,下一原创 2015-01-01 20:30:31 · 524 阅读 · 0 评论 -
poj 2488 深搜
如题:http://poj.org/problem?id=2488 开始搜索专题的系统学习,注意搜索结束标志,以及搜索状态,别忘记回溯 。 题目要求从任意一点走日字,是否可以走完整个棋盘,改动的地方在于字典序,横坐标是从A开始的字母,纵坐标是从1开始的数字,q是数字的个数,p是字母的个数。 还要注意这一题答案应该不是唯一的才对,为什么没有special judge呢?原创 2014-12-29 16:36:48 · 467 阅读 · 0 评论 -
poj2531 深搜
如题:http://poj.org/problem?id=2531 题目要求给出一个n*n的矩阵,要求输出任意分割成2部分,连接边的最大值。 DFS(x,sum)将点x加入集合,并求出这时的sum,如果》max,更新,然后搜索图中有x的所有子问题。 #include #include #define N 105 //元素要么加入集合,要么不加入集合 in原创 2014-12-29 15:07:47 · 511 阅读 · 0 评论 -
poj 1088 记忆化搜索
如题:http://poj.org/problem?id=1088 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子原创 2014-12-18 16:36:02 · 352 阅读 · 0 评论 -
poj1024 bfs
如题:http://poj.org/problem?id=1024 Tester Program Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 2360 Accepted: 830 Description Tester Program For this原创 2015-04-27 23:26:49 · 868 阅读 · 0 评论