摘要:
http://poj.org/problem?id=3984典型的迷宫问题,记录最快到达某个点的是哪个点即可#include #include #include using namespace std;const int maxn=10;const int inf=0x3fffffff;struct... 阅读全文
posted @ 2015-03-14 20:21
雪溯
阅读(175)
评论(0)
推荐(0)
摘要:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2671首先对火进行一次bfs,得到着火时间,然后对人进行一次bfs,只允许进入还没有着火的点注意:出迷宫条件... 阅读全文
posted @ 2015-03-14 20:18
雪溯
阅读(148)
评论(0)
推荐(0)
摘要:
http://acm.fzu.edu.cn/problem.php?pid=2150注意这道题可以任选两个点作为起点,但是时间仍足以穷举两个点的所有可能#include #include #include using namespace std;const int maxn=11;const int... 阅读全文
posted @ 2015-03-14 20:13
雪溯
阅读(212)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=3414记录瓶子状态,广度优先搜索即可#include #include #include using namespace std;const int maxn=101;int n,m;typedef unsigned long long ull;... 阅读全文
posted @ 2015-03-14 20:10
雪溯
阅读(201)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=3087设:s1={A1,A2,A3,...Ac}s2={Ac+1,Ac+2,Ac+3,....A2c}则合在一起成为Ac+1,A1,Ac+2,A2......A2c,Ac经过一次转换之后变成s1={Ac+1,A1,Ac+2.....}s2={..... 阅读全文
posted @ 2015-03-14 20:07
雪溯
阅读(173)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=3126搜索的时候注意1:首位不能有02:可以暂时有没有出现在目标数中的数字#include #include #include using namespace std;const int maxn=1e4+5;const int inf=0x7f... 阅读全文
posted @ 2015-03-14 18:20
雪溯
阅读(188)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=1426测试了一番,从1-200的所有值都有long long下的解,所以可以直接用long long 存储从1出发,每次向10*s和10*s+1转移,只存储余数即可,对于余数i,肯定只有第一个余数为i的最有用,只记录这个值即可#include #... 阅读全文
posted @ 2015-03-14 18:18
雪溯
阅读(175)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=3279明显,每一位上只需要是0或者1,遍历第一行的所有取值可能,(1#include #include #include using namespace std;int maz[15][15];int op[15][15];int ans[15]... 阅读全文
posted @ 2015-03-14 13:55
雪溯
阅读(157)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=3278从n出发,向两边转移,为了不使数字无限制扩大,限制在2*k以内,注意不能限制在k以内,否则就缺少不断使用-1得到的一些结果#include #include #include #include using namespace std;con... 阅读全文
posted @ 2015-03-14 13:50
雪溯
阅读(114)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=2251bfs,把两维换成三维,但是30*30*30=9e3的空间时间复杂度仍然足以承受#include #include #include #include using namespace std;struct P{ int x,y... 阅读全文
posted @ 2015-03-14 13:45
雪溯
阅读(186)
评论(0)
推荐(0)

浙公网安备 33010602011771号