自爆魂

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

2014年10月15日 #

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5062模拟筛出对称单峰数(12321)的个数,水题#include #include #include #include #include #include #include #include #include u... 阅读全文
posted @ 2014-10-15 23:22 自爆魂 阅读(167) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4888添加一个源点与汇点,建图如下:1. 源点 -> 每一行对应的点,流量限制为该行的和2. 每一行对应的点 -> 每一列对应的点,流量限制为 K3. 每一列对应的点 -> 汇点,流量限制为该列的和求一遍最大流,若... 阅读全文
posted @ 2014-10-15 19:53 自爆魂 阅读(122) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4946给你n个点的坐标和速度,如果一个点能够到达无穷远处,且花费的时间是最少的,则此点输出1,否则输出0.每个点向外都是以圆的形式向外拓展的,所以只有速度最大的才能到达无穷远处,但是并不是所有速度为最大的点都能到到... 阅读全文
posted @ 2014-10-15 19:50 自爆魂 阅读(319) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4956首先给出一个范围 [l, r],问能否从中找到一个数证明Hanamichi’s solution 的解法(对于某个数 X,偶数位的数字之和 - 奇数位的数字之和 = 3 而且 这个 X 满足 X mod 11... 阅读全文
posted @ 2014-10-15 19:47 自爆魂 阅读(148) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5000每只羊有n个属性下面n个数字表示每个属性的值范围为[ 0, T[i] ]对于羊圈里的a羊和b羊,若a羊的每个属性都>=b羊,则a羊会杀死b羊。问羊圈里最多存活多少只羊。sum相同的羊不会互相杀死。sum不同的... 阅读全文
posted @ 2014-10-15 19:39 自爆魂 阅读(130) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5003记得排序后输出#include #include #include #include #include #include #include #include #include using namespace ... 阅读全文
posted @ 2014-10-15 19:34 自爆魂 阅读(132) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5001给定n个点m条边的无向图问从任意点出发任意走d步,从不经过某个点的概率本想先算路过每个点的概率然后用1减去这个概率 但是由于可以重复路过 所以无法判断是不是第一次经过这个点所以我们应该直接做不路过的概率 即类... 阅读全文
posted @ 2014-10-15 19:34 自爆魂 阅读(148) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5007字符串处理暴力#include #include #include #include #include #include #include #include #include using namespace ... 阅读全文
posted @ 2014-10-15 19:33 自爆魂 阅读(167) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5009有一段序列,涂连续一段子序列的代价为该子序列出现不同数字个数的平方,求最小代价涂完整个序列。ai有10^9,所以先进行离散化复杂度有n^2,需要剪枝,就是如果答案大于了dp[n]就不用往后继续转移了,这样复杂... 阅读全文
posted @ 2014-10-15 19:31 自爆魂 阅读(127) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5011有N堆珠子,两个人轮流拿,最少拿一个,可以全拿,每次只能从一个堆里拿,不能从多堆同时拿;拿完之后该人还有一个操作,对操作的堆要么不动要么将该堆分成两部分(不一定均分),谁最后一个拿完谁获胜。而无论怎么划分,划... 阅读全文
posted @ 2014-10-15 19:29 自爆魂 阅读(128) 评论(0) 推荐(0) 编辑

摘要: 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) 编辑