![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
BestCoder
文章平均质量分 73
弱菜zc
打完这场就回老家结婚!
展开
-
BestCoder Round #78 1001/ hdu 5655 CA Loves Stick
题意:给出一个四根木棍的长度,判断是否能组成四边形。 最长边小于三边和来判断四边形。坑点在于数据,可能出现长度为0的边,而且数据太大,三个数相加会超过longlong范围,要用减法。(这题居然wa了半个小时,死亡)#include #include #include #include using namespace std; unsigned long long a[10]; int m原创 2016-04-03 09:52:36 · 623 阅读 · 0 评论 -
BestCoder Round #78 1002/hdu 5656 CA Loves GCD 动态规划
题意:求n个数的全部子集的gcd之和。 我们令dp[i][j]表示在前i个数中,选出若干个数使得它们的gcd为j的方案数,于是只需要枚举第i+1个数是否被选中来转移就可以了。 令第i+1个数为v,当考虑dp[i][j]的时候,我们令dp[i+1][j] += dp[i][j],dp[i+1][gcd(j,v)] += dp[i][j]。 复杂度O(N*MaxV) MaxV 为出现过的数的最大原创 2016-04-03 20:05:07 · 590 阅读 · 0 评论 -
BestCoder Round #79 1001/hdu 5660 jrMz and angles
题目链接 题意:给出一个正n边形的角,一个正m边形的角。判断这些角能否组成360度。 注意取值非负。 #include #include using namespace std; int main() { int T; cin>>T; while(T--) { int n,m; cin>>n>>m; if(n原创 2016-04-11 10:50:22 · 527 阅读 · 0 评论 -
BestCoder Round #79 1002/hdu 5661 Claris and XOR 贪心
题目链接 题意:给出四个数a,b,c,d。选择a 考虑从高位到低位贪心,对于每一位,如果x,y只有唯一的取法,那么只能这么取;否则贪心地必须使答案的这一位等于1。如果x,y都是0,1都能取,则设这是从右向左数第len位,因为x,y能取的值一定都是连续的一段,因此x,y的后len位都能取0111...1(len-1个1)和1000...0(len-1个0)(否则做不到从右向左数第len位都能原创 2016-04-11 11:38:20 · 782 阅读 · 0 评论 -
BestCoder Round #83 1004 zxa and xor
题意:给出n个非负整数序列,异或值为对所有两两之和进行异或的结果。有m个操作,每个操作把第x个数的值改成y,求每次操作后的异或值。 直接暴力做居然过了。先初始化,计算出异或值,之后询问时,因为异或两次能够抵消,所有把原来的值都异或一次(消去原来的项),再异或一次得到新的值。 暴力出奇迹!! #include #include #include #include using n原创 2016-05-14 21:25:19 · 494 阅读 · 0 评论 -
BestCoder Round #83 1001 zxa and set
题意:给出n个数的集合,求所有奇子集的最小值之和与偶子集的最小值之和的差。 找一个元素为最小元素的集合,当集合元素大于1时,奇数和偶数子集的个数是相等的,所以差为0。如果只有一个元素,也就是找的元素是最大元素时,奇数子集个数为1,偶数子集个数为0。所以本题其实就是找集合中的最大值。 #include #include #include using namespace st原创 2016-05-14 21:27:51 · 664 阅读 · 0 评论 -
BestCoder 2nd Anniversary 1002/hdu5719 Arrange
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5719 题目: Problem Description Accidentally, Cupid, god of desire has hurt himself with his own dart and fallen in love with Psyche. This has drawn原创 2016-07-18 19:24:52 · 535 阅读 · 0 评论 -
BestCoder 2nd Anniversary 1001/hdu5718 Oracle
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5718 题目: Problem Description There is once a king and queen, rulers of an unnamed city, who have three daughters of conspicuous beauty. The younges原创 2016-07-18 19:22:36 · 520 阅读 · 0 评论 -
bestcoder 92
Skip the Class Accepts: 678 Submissions: 1285 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 终于又开学啦。呃喵最喜欢的就是开学了,因为这样她又可以愉快地翘课了(啊?) 呃喵接下来有n节课程原创 2017-02-28 19:34:16 · 619 阅读 · 0 评论