
DFS&BFS
Mei废话
这个作者很懒,什么都没留下…
展开
-
PKU 1166 The Clocks
题目:http://poj.org/problem?id=1166题意:给出9个时钟的状态和9种操作,每种操作可以改变不同的时钟的状态,每次只能改变90度,输出最少的有序的操作序列思路:枚举出每种操作的次数,最多为3次,保存在num数组中,判断每个时钟经过9种,每种num[j]次操作,是否为0.#include #include int flag;int state[9],原创 2012-07-31 18:38:54 · 677 阅读 · 0 评论 -
PKU 1014 Dividing
题目:http://poj.org/problem?id=1014题意:有6个物品,价值分别为1、2、3、4、5、6,输入6个数,代表相应的物品的个数,问的是 能不能物品分成两份,每份的价值总和相同。思路:深搜或多重背包~~~好久没写了 生啊~~~//深搜#include #include int array[10];int a, b, c, d, e, f;int原创 2013-03-27 19:50:21 · 782 阅读 · 0 评论 -
HDU 1026 Ignatius and the Princess I
题目 http://acm.hdu.edu.cn/showproblem.php?pid=1026BFS+优先队列,需要记录路径。#include #include #include using namespace std;const int maxn=100;const int inf=0x7fffffff;struct map{ int f,原创 2014-03-18 14:08:24 · 671 阅读 · 0 评论