自爆魂

博客园 首页 新随笔 联系 订阅 管理

2014年10月15日 #

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5012模拟出骰子四种反转方式,bfs,最多不会走超过6步#include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2014-10-15 19:27 自爆魂 阅读(139) 评论(0) 推荐(1) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5014从最大的一个数开始找能配对使他们的异或值最大的一个数最后输出#include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2014-10-15 19:25 自爆魂 阅读(152) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5015需要构造一个 n+2 维的矩阵。就是要增加一维去维护2333这样的序列。可以发现 2333 = 233*10 + 3所以增加了一维就 是1, 然后就可以全部转移了。10 0 0 0 0 ... 1 1 1 0... 阅读全文
posted @ 2014-10-15 19:24 自爆魂 阅读(139) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5017求椭圆上离圆心最近的点的距离。模拟退火和三分套三分都能解决#include #include #include #include using namespace std;const double eps = ... 阅读全文
posted @ 2014-10-15 19:18 自爆魂 阅读(263) 评论(0) 推荐(1) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5018任意给你三个数,让你判断第三个数是否在以前两个数为开头组成的Fibonacci 数列中。直接暴力#include #include #include #include #include #include #i... 阅读全文
posted @ 2014-10-15 18:31 自爆魂 阅读(128) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5019给出X 和Y,求出第K 大的 X 和Y 的公约数。暴力求出所有公约数#include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2014-10-15 18:27 自爆魂 阅读(145) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5020求3点共线的组合数极角排序然后组合数相加#include #include #include #include #include #include #include #include#include #inc... 阅读全文
posted @ 2014-10-15 18:24 自爆魂 阅读(186) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5023在片段上着色,有两种操作,如下:第一种:P a b c 把 a 片段至 b 片段的颜色都变为 c 。第二种:Q a b 询问 a 片段至 b 片段有哪些颜色,把这些颜色按从小到大的编号输出,不要有重复片段上默... 阅读全文
posted @ 2014-10-15 18:20 自爆魂 阅读(147) 评论(0) 推荐(1) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5024找到一个最长的L型,L可以是斜着的简单的模拟#include #include #include #include #include #include #include #include #include u... 阅读全文
posted @ 2014-10-15 17:11 自爆魂 阅读(137) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5025N*N矩阵 M个钥匙K起点,T终点,S点需多花费1点且只需要一次,1-9表示9把钥匙,只有当前有I号钥匙才能拿I+1号钥匙,可以不拿钥匙只从上面走过BFS+优先队列。蛇最多只有5条,状压即可。#include... 阅读全文
posted @ 2014-10-15 17:05 自爆魂 阅读(174) 评论(0) 推荐(1) 编辑