Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1217    Accepted Submission(s): 466 Problem Description Ignatius likes catching fish very much. He has a fishnet whose shape is a c…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1077 Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2636    Accepted Submission(s): 969 Problem Description Ignatius likes catching…
http://acm.hdu.edu.cn/showproblem.php?pid=1077 很明显这样的圆,必定有两个点在边界上.n平方枚举圆,再n立方暴力判断.由于没有给T,所以不知道行不行.…
/** 题目:hdu4106 区间k覆盖问题(连续m个数,最多选k个数) 最小费用最大流 建图巧妙 链接:http://acm.hdu.edu.cn/showproblem.php?pid=4106 题意:给你n个数,每连续m个数,最多选k个数,问可以选的数的权值和最大多少. 思路:可以转化为区间k覆盖问题.区间k覆盖问题是每个点最多被k个区间覆盖.本题是每个区间最多选k个点. 刚好相反.我的做法有点不同其他博客那种做法.当然本质一样. 我这里的i就是原来n个数的下标,现在作为图中该数的节点编号…
Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1052    Accepted Submission(s): 385 Problem DescriptionIgnatius likes catching fish very much. He has a fishnet whose shape is a ci…
描述 The Archeologists of the Current Millenium (ACM) now and then discover ancient artifacts located at vertices of regular polygons. The moving sand dunes of the desert render the excavations difficult and thus once three vertices of a polygon are di…
/* http://codeforces.com/contest/426/problem/C 最多交换k个数的顺序,求a[i]的最大连续和 爆解 思路:Lets backtrack interval that should contain maximal sum. To improve it we can swap not more then K minimal elements in fixed interval to not more K maximal elements not conta…
旋转卡壳求最小矩形覆盖的模板题. 因为最小矩形必定与凸包的一条边平行,则枚举凸包的边,通过旋转卡壳的思想去找到其他3个点,构成矩形,求出最小面积即可. #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<stack&g…
问题:求1~r中有多少个数与n互素. 对于这个问题由容斥原理,我们有3种写法,其实效率差不多.分别是:dfs,队列数组,位运算. 先说说位运算吧: 用二进制1,0来表示第几个素因子是否被用到,如m=3,三个因子是2,3,5,则i=3时二进制是011,表示第2.3个因子被用到 LL Solve(LL n,LL r) { vector<LL> p; for(LL i=2; i*i<=n; i++) { if(n%i==0) { p.push_back(i); while(n%i==0) n/…
题目链接:pid=1084">点击打开链接 寒假安排 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStatistic Next Problem Problem Description 寒假又快要到了,只是对于lzx来说,头疼的事又来了,由于众多的后宫都指望着能和lzx约会呢,lzx得安排好计划才行. 如果lzx的后宫团有n个人.寒假共同拥有m天,而每天仅仅能…