摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3063 题意:中文题,说的很清楚,不解释 题解:公式题,具体看代码 1 #include<stdio.h> 2 #include<string.h> 3 #define mod 4*9999 4 /* 5 阅读全文
posted @ 2016-05-09 00:07 bin_gege 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3062/ 题意:2-SAT的裸题 题解:直接上模版 1 #include<cstdio> 2 #include<cstring> 3 const int MAXN = 2020; 4 const int 阅读全文
posted @ 2016-05-08 23:06 bin_gege 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5677 题意:给你N个串,问能否选出小于K个回文字符串使得选出的字符串的长度之和为L。 题解:很容易想到求一下回文字符串的个数和长度,然后就背包处理一下,数据比较水,用了manacher和二进制背包加速, 阅读全文
posted @ 2016-05-08 21:22 bin_gege 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3294 题意:给你一个字符和一个字符串,第一个字符表示该字符代表a,然后让你求变换后的最长回文区间并输出(这里的回文长度要大于1) 题解:直接上马拉车,然后记录一下区间 1 #include<cstdio 阅读全文
posted @ 2016-05-07 19:24 bin_gege 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3068 题意:给你一个字符串,让你求最长的回文子串。 题解:数据量比较大,暴力O(n2)会超时,直接上马拉车,模版题。 1 #include<cstdio> 2 #include<cstring> 3 # 阅读全文
posted @ 2016-05-07 16:44 bin_gege 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2111 题意:给你n个物品的单位体积价值和体积,求装满容量v的背包的最大价值。 题解:乍一看还以为是背包问题,结果给的是单位体积的价值,一个简单的贪心就能水过 1 #include<cstdio> 2 # 阅读全文
posted @ 2016-05-07 12:47 bin_gege 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2110 题意:给你N个价值和数目,求方案数,很裸的母函数。 1 #include<cstdio> 2 int c1[4000],c2[4000],all,pi[110],mi[110],su,i,j,k; 阅读全文
posted @ 2016-05-07 12:09 bin_gege 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1513 题意:给你一个字符串,问你最少插入多少个字符使其为回文字符。 题解:将字符串倒着保存,然后求一下原串和该串的最长公共子序列,然后字符串长度剪LCS就是答案 1 #include<cstdio> 2 阅读全文
posted @ 2016-05-06 22:47 bin_gege 阅读(189) 评论(0) 推荐(0) 编辑
摘要: D2. Magic Powder - 2 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The term of this pro 阅读全文
posted @ 2016-05-06 18:54 bin_gege 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2227 题意:给你一个集合,让你求递增子序列有多少个,和树状数组求逆序对差不多,不过数据比较大,要离散化一下。 1 #include<cstdio> 2 #include<algorithm> 3 #de 阅读全文
posted @ 2016-05-04 15:52 bin_gege 阅读(140) 评论(0) 推荐(0) 编辑