摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5620 题意:给你一个n长的钢管,要分的尽可能多,且任意三条不能构成三角形 题解:看hint就知道用递推来解 1 #include<cstdio> 2 #define F(i,a,b) for(int i 阅读全文
posted @ 2016-05-27 00:41 bin_gege 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://codeforces.com/contest/676/problem/B 题意:给你一个N层的杯子堆成的金字塔,倒k个杯子的酒,问倒完后有多少个杯子的酒是满的 题解:由于数据不是很大,直接模拟就行了 1 #include<cstdio> 2 #include<cstring> 阅读全文
posted @ 2016-05-26 21:03 bin_gege 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1348 题意:让你求n个点的凸包,凸包离点的距离为l 题解:就凸包周长+一个半径为l的圆周长 1 #include<cstdio> 2 #include<cmath> 3 #include<algorit 阅读全文
posted @ 2016-05-26 17:08 bin_gege 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1392 题意:求凸包,不知道的百度 题解:模版题 1 #include<cstdio> 2 #include<cmath> 3 #include<algorithm> 4 using namespace 阅读全文
posted @ 2016-05-26 09:58 bin_gege 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1115 题意:给你N个点围成的一个多边形,让你求这个多边形的重心。 题解: 1 #include<cstdio> 2 3 struct node{int x,y;}a,b,c; 4 int t,n;dou 阅读全文
posted @ 2016-05-26 08:41 bin_gege 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://codeforces.com/contest/676/problem/C 题意:一串字符串,最多改变k次,求最大的相同子串 题解:很明显直接尺取法 1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 #incl 阅读全文
posted @ 2016-05-26 01:38 bin_gege 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1558 题意:P为画线段,Q为询问当前这条线段所在的集合有多少线段 题解:如果两条线段有交点,那么就连接这两个集合 1 #include<cstdio> 2 #define FFC(i,a,b) for( 阅读全文
posted @ 2016-05-25 22:10 bin_gege 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3001 题意:给你N个点,M条边,每个点最多走两次,问走完N个点最短的路程为多少。 题解:注意这题有重边,因为最多走两次,所以要用3进制来压缩状态,处理一下就行 1 #include<cstdio> 2 阅读全文
posted @ 2016-05-25 13:48 bin_gege 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4529 题意:中文,不解释 题解:状压DP,dp[i][j][k][s]表示第i行当前用了j个骑士,i-1行的压缩状态为k,i行的压缩状态为j,然后用滚动数组优化了一下,注意如果不预处理不可存放位置会超时 阅读全文
posted @ 2016-05-24 22:06 bin_gege 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4539 题意:中文,不解释 题解:将每一行的状态压缩,然后进行DP,也可以用最大团做。这里我用的DP 1 #include<cstdio> 2 #include<cstring> 3 #define ma 阅读全文
posted @ 2016-05-23 23:09 bin_gege 阅读(187) 评论(0) 推荐(0) 编辑