自爆魂

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

2014年10月19日 #

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5067贴题解由于Harry的dig machine是无限大的,而装载石头和卸载石头是不费时间的,所以问题可以转化成:从某一点出发,遍历网格上的一些点,每个点至少访问一次需要的最小时间是多少。这就是经典的旅行商问题,... 阅读全文
posted @ 2014-10-19 21:17 自爆魂 阅读(176) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5066中学物理题#include #include #include #include #include #include #include #include #include using namespace st... 阅读全文
posted @ 2014-10-19 19:21 自爆魂 阅读(161) 评论(0) 推荐(0) 编辑

摘要: #include #include #include #include #include using namespace std;int a,b;int main(){ while(scanf("%d%d",&a,&b) != EOF) { printf("%d\n",(a... 阅读全文
posted @ 2014-10-19 19:15 自爆魂 阅读(158) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2222就是裸的多串匹配的问题,AC自动机模板题http://www.cppblog.com/MatoNo1/archive/2011/10/19/158635.html用了yang_7_46的模板#include ... 阅读全文
posted @ 2014-10-19 16:19 自爆魂 阅读(275) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3664求1~n的排列个数,使得逆序数(ai>i ) 为给定的k.dp[i][j]表示前1~i的排列中,有j个数是逆序数的个数.#include #include #include #include #include... 阅读全文
posted @ 2014-10-19 15:58 自爆魂 阅读(241) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4268A想用手里的牌尽量多地覆盖掉B手中的牌..牌有h和w问A手中的牌最多能覆盖B多少张牌iterator lower_bound( const key_type &key ): 返回一个迭代器,指向键值>= ke... 阅读全文
posted @ 2014-10-19 15:40 自爆魂 阅读(179) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4004一条线段长度为L,线段上有n个点,最多选取 m-1 个点,使得包括线段端点在内的相邻点之间的最大距离值最小。最大值最小化问题,显然二分judge每次选最远点,选出点数不超过m即可#include #inclu... 阅读全文
posted @ 2014-10-19 15:08 自爆魂 阅读(148) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2544直接搞存份模板http://blog.csdn.net/niushuai666/article/details/7292722#include #include #include #include #incl... 阅读全文
posted @ 2014-10-19 14:58 自爆魂 阅读(124) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1711判断b是不是a字串,输出b在a位置下标kmp模板题#include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2014-10-19 14:51 自爆魂 阅读(112) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2063男女配对最大数匈牙利算法模板#include #include #include #include #include #include #include #include #include using nam... 阅读全文
posted @ 2014-10-19 14:22 自爆魂 阅读(149) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1348造城墙问题,求出凸包加上一圈圆的周长即可凸包模板题#include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2014-10-19 13:57 自爆魂 阅读(121) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4950给定怪兽血量h,你攻击力a,怪物回血力b,你攻击k次要休息一次,问能否杀死怪兽特判一次打死怪兽的情况和第k次前打死怪兽的情况,否则只要能磨死怪兽即可#include #include #include #in... 阅读全文
posted @ 2014-10-19 11:24 自爆魂 阅读(187) 评论(0) 推荐(0) 编辑

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4952给定x,k,i从1到k,每次a[i]要是i的倍数,并且a[i]大于等于a[i-1],x为a0递推到下一个a==之前的a即可跳出循环#include #include #include #include #in... 阅读全文
posted @ 2014-10-19 11:11 自爆魂 阅读(188) 评论(0) 推荐(0) 编辑