XXX is puzzled with the question below: 1, 2, 3, ..., n (1<=n<=400000) are placed in a line. There are m (1<=m<=1000) operations of two kinds. Operation 1: among the x-th number to the y-th number (inclusive), get the sum of the numbers which…
Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description XXX is puzzled with the question below: 1, 2, 3, ..., n (1<=n<=400000) are placed in a line. There are m (1<=m<=1000) operations of two…
How many integers can you find Time Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5664 Accepted Submission(s): 1630 Problem Description Now you get a number N, and a M-integers set, you shoul…
Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2974 Accepted Submission(s): 843 Problem Description XXX is puzzled with the question below: 1, 2, 3, ..., n (1<=n<=400000) are placed in…
Codeforces Round #258 (Div. 2) Devu and Flowers E. Devu and Flowers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Devu wants to decorate his garden with flowers. He has purchased n boxes…
状压DP :F(S)=Sum*F(S)+p(x1)*F(S^(1<<x1))+p(x2)*F(S^(1<<x2))...+1; F(S)表示取状态为S的牌的期望次数,Sum表示什么都不取得概率,p(x1)表示的是取x1的概率,最后要加一因为有又多拿了一次.整理一下就可以了. #include <cstdio> ; <<Maxn],p[Maxn]; int n; int main() { while (scanf("%d",&n)!…
How many integers can you find Time Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7439 Accepted Submission(s): 2200 Problem Description Now you get a number N, and a M-integers set, you shoul…
G - Coprime Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5072 Description There are n people standing in a line. Each of them has a unique id number. Now the Ragnarok is coming. We should ch…
E - The Boss on Mars Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4059 Description On Mars, there is a huge company called ACM (A huge Company on Mars), and it’s owned by a younger boss. Due…
In most professional sporting events, cheerleaders play a major role in entertaining the spectators. Theirroles are substantial during breaks and prior to start of play. The world cup soccer is no exception.Usually the cheerleaders form a group and p…
http://acm.split.hdu.edu.cn/showproblem.php?pid=4336 Card Collector Special Judge Problem Description In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people i…
Number Sequence Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description Given a number sequence b1,b2…bn. Please count how many number sequences a1,a2,...,an satisfy the condition that a1*a2*...*an=b1*…
The Boss on Mars Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1528 Accepted Submission(s): 452 Problem Description On Mars, there is a huge company called ACM (A huge Company on Mars), and…
容斥原理入门题吧. Happy 2006 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 9798 Accepted: 3341 Description Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7,…