Description描述Famous Berland ACM-ICPC team Anisovka consists of three programmers: Andrew, Michael and Ilya. A long time ago, during the first few mont...
分类:
其他好文 时间:
2015-03-07 10:09:49
阅读次数:
149
#include
#include
typedef __int64 LL;
LL dp[10][1<<10];
int n, m;
int st, flag;
void dfs(int i, int s, int ns, int j, LL num)
{
if(j == m)
{
dp[i+1][ns] += num;
return;
}
if((s&(1<<j)) == 0)...
分类:
其他好文 时间:
2015-03-02 14:51:37
阅读次数:
115
题意:
有N个箱子放有礼物,M个人依次取。如果取到的箱子有礼物,则拿走礼物。无论有没有拿到礼物,都将箱子原状放回。(所以就有可能后面的人拿到前面的人拿过的箱子,然后就没得到奖品)。问,最后能拿走的礼物数量的期望。
两种思路,给跪了,,,还是没有想出来。。。。
m个人是独立的。
对于每个礼物不被人选中的概率为((n-1)/n)^m
那么不被选中的礼物数的期望就是 n*((n-1)/n)^m...
分类:
其他好文 时间:
2015-02-26 01:23:18
阅读次数:
207
Description描述Let f(n) be a sum of digits for positive integer n. If f(n) is one-digit number then it is a digital root for n and otherwise digital roo...
分类:
其他好文 时间:
2015-02-24 16:20:33
阅读次数:
180
Description描述Find amount of numbers for given sequence of integer numbers such that after raising them to theM-th power they will be divided byK.求出给定一...
分类:
其他好文 时间:
2015-02-24 15:02:35
阅读次数:
149
Description描述You want to arrange the window of your flower shop in a most pleasant way. You haveFbunches of flowers, each being of a different kind, a...
分类:
其他好文 时间:
2015-02-24 13:47:45
阅读次数:
230
Description描述Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its fac...
分类:
其他好文 时间:
2015-02-22 15:46:50
阅读次数:
172
Description描述His Royal Highness King of Berland Berl XV was a very wise man and had a very accomplished wife, who was aware of the fact, that prominen...
分类:
其他好文 时间:
2015-02-22 13:27:23
阅读次数:
171
Description描述Find coordinates of any triangle ABC if it is know that |AB|=c, |AC|=b, |AM|=m, AM is a median of triangle.找到任何一个三角形ABC,使得它满足|AB| = c,|AC...
分类:
其他好文 时间:
2015-02-22 13:20:04
阅读次数:
140