Welcome Party Time Limit: 4000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 875 Accepted Submission(s): 194 Problem Description The annual welcome party of the Department of Computer Science and Technolo…
solved 7/11 2016 Multi-University Training Contest 10 题解链接 分类讨论 1001 Median(BH) 题意: 有长度为n排好序的序列,给两段子序列[l1,r1],[l2,r2]构成新的序列,问中间的数字. 思路: 根据不同情况分类讨论即可.时间复杂度O(1). 代码: #include <bits/stdc++.h> const int N = 1e5 + 5; int a[N]; int n, m; int l1, r1, l2, r…
CRB and Apple Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 421 Accepted Submission(s): 131 Problem Description In Codeland there are many apple trees.One day CRB and his girlfriend decide…
CRB and Queries Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 533 Accepted Submission(s): 125 Problem DescriptionThere are N boys in CodeLand.Boy i has his coding skill Ai.CRB wants to k…
目录 Contest Info Solutions C - Valentine's Day D - Play Games with Rounddog E - Welcome Party G - Closest Pair of Segments H - Coins I - Block Breaker K - Make Rounddog Happy Contest Info Practice Link Solved A B C D E F G H I J K 7/11 - - O Ø O - Ø O…
Valentine's Day Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Special Judge Problem Description Oipotato loves his girlfriend very much. Since Valentine's Day i…
Block Breaker Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0 Problem Description Given a rectangle frame of size n×m. Initially, the frame is strewn with n×m sq…
Problem Description Given a rectangle frame of size n×m. Initially, the frame is strewn with n×m square blocks of size 1×1. Due to the friction with the frame and each other, the blocks are stable and will not drop. However, the blocks can be knocked…
CRB and Candies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 453 Accepted Submission(s): 222 Problem Description CRB has N different candies. He is going to eat K candies.He wonders how…
CRB and Puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 301 Accepted Submission(s): 127 Problem DescriptionCRB is now playing Jigsaw Puzzle.There are N kinds of pieces with infinite su…
官方解题报告:http://blog.sina.com.cn/s/blog_6bddecdc0102v01l.html A simple brute force problem. http://acm.hdu.edu.cn/showproblem.php?pid=4971 有n个项目,m个问题,解决某个项目会需要解决一些问题,解决项目挣钱,解决问题花钱,某些问题解决之前需解决其他问题.a之前要做b,b之前要做a,也就是会出现环,需要先缩点,参考有向图强连通分量缩点.对于缩点之后的图,参考最大权闭…
1001 CRB and Apple 1002 CRB and Candies 1003 CRB and Farm 1004 CRB and Graph 1005 CRB and His Birthday 加一维0和1表示有没有拿过这种糖. 然后完全背包滚动数组过去就可以了. 然而实际上不用加这一维.直接先0-1再完全就可以了. 因为第一个的时候收益是a+b.后面的收益是a. 如果第一个都不拿.后面自然不会拿了. # include <iostream> # include <cstdi…
Y Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 304 Accepted Submission(s): 104 Problem Description Sample Input 4 1 2 1 3 1 4 Sample Output 1 Hint 1. The only set is {2,3,4}. 2. Ple…
Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 127 Accepted Submission(s): 60 Problem Description Sample Input 2 Sample Output 2 解题思路: 很容易看得出,这是个组合数学的插板问题,答案为2^(n-1); 由于n特别大,则(2^(…
A - Problem A.Alkane 留坑. B - Problem B. Beads 留坑. C - Problem C. Calculate 留坑. D - Problem D. Permutation 留坑. E - Problem E. TeaTree 题意:每个点会存下任意两个以他为LCA的点对的GCD,求每个点存的GCD的最大值 思路:DSU on tree 用 set 维护子树中的因子,对于重儿子不要处理多次 每次查找的时候,枚举轻儿子中的因子 还有一种线段树合并的写法 #i…