HDU 5159 Card( 计数 期望 )】的更多相关文章

Card Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 191    Accepted Submission(s): 52Special Judge Problem Description There are x cards on the desk, they are numbered from 1 to x. The score o…
Problem Description There are x cards on the desk, they are numbered from 1 to x. The score of the card which is numbered i(1<=i<=x) is i. Every round BieBie picks one card out of the x cards,then puts it back. He does the same operation for b round…
B - Card Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description There are x cards on the desk, they are numbered from 1 to x. The score of the card which is numbered i(1<=i<=x) is i. Every round Bi…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4336 Card Collector Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) 问题描述 In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that,…
Problem Description In your childhood, people in the famous novel Water Margin, you will win an amazing award. As a smart boy, you notice that to win the award, you must buy much more snacks than it seems to be. To convince your friends not to waste…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5159 题解: 考虑没一个数的贡献,一个数一次都不出现的次数是(x-1)^b,而总的排列次数是x^b,所以每一个数有贡献的次数都是x^b-(x-1)^b,所以最后推导的公式就是: (x^b-(x-1)^b)*(1+2+...+x)/(x^b)=(1-((x-1)/x)^b)*(1+x)*x/2 代码: #include<iostream> #include<cstdio> #inclu…
题意:有N(1<=N<=20)张卡片,每包中含有这些卡片的概率,每包至多一张卡片,可能没有卡片.求需要买多少包才能拿到所以的N张卡片,求次数的期望. 析:期望DP,是很容易看出来的,然后由于得到每张卡片的状态不知道,所以用状态压缩,dp[i] 表示这个状态时,要全部收齐卡片的期望. 由于有可能是什么也没有,所以我们要特殊判断一下.然后就和剩下的就简单了. 另一个方法就是状态压缩+容斥,同样每个状态表示收集的状态,由于每张卡都是独立,所以,每个卡片的期望就是1.0/p,然后要做的就是要去重,既然…
Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 218    Accepted Submission(s): 106 Problem Description You may not know this but it's a fact that Xinghai Square is…
Birthday Toy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 644    Accepted Submission(s): 326 Problem Description AekdyCoin loves toys. It is AekdyCoin’s Birthday today and he gets a special “…
Card Collector(期望+min-max容斥) Card Collector woc居然在毫不知情的情况下写出一个min-max容斥 题意 买一包方便面有几率附赠一张卡,有\(n\)种卡,每种卡出现的概率是\(p_i\),保证\(\Sigma p_i \le 1\),集齐所有种类卡牌期望买多少包方便面? 解法 看次题解前,你必须要理解当只有一种卡,他出现的概率是\(p\),那么我期望购买$\frac 1 p $包方便面就可以获得这种卡. 否则请你右上角,因为博主不会解释... 唯一的解…