上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 79 下一页
摘要: 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 雪溯 阅读(190) 评论(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 雪溯 阅读(167) 评论(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 雪溯 阅读(182) 评论(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 雪溯 阅读(168) 评论(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 雪溯 阅读(148) 评论(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 雪溯 阅读(108) 评论(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 雪溯 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1321注意是在'#'的地方放棋子矩阵大小不过8*8,即使是8!的时间复杂度也足以承受,可以直接dfs求解dfs时标注当前点的行和列已被访问,接着搜索行列都未被访问的新点,注意搜索完毕之后标注当前点的行和列未被访问#include #include... 阅读全文
posted @ 2015-03-14 13:42 雪溯 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://www.spoj.com/problems/VLATTICE/明显,当gcd(x,y,z)=k,k!=1时,(x,y,z)被(x/k,y/k,z/k)遮挡,所以这道题要求的是gcd(x,y,z)==1的个数+{(x,y,0)|gcd(x,y)==1}的个数+3{(0,0,1),(0,1... 阅读全文
posted @ 2015-03-11 23:26 雪溯 阅读(195) 评论(0) 推荐(0) 编辑
摘要: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2640http://www.spoj.com/problems/SPOINTS/en/htt... 阅读全文
posted @ 2015-03-11 08:34 雪溯 阅读(281) 评论(0) 推荐(0) 编辑
上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 79 下一页