传送门
每个队之间是独立的
f[i][j]表示当前队伍前i个题答对j个的概率
满足条件的概率 == 全部方案(除去答对0)的概率 不满足条件的概率(每个队伍答对1~n1)
#include <cstdio>#include <cstring>#define N 101int m, t, n;double sum, p1, p2, f[N][N];int main()}sum = 0;for(j = 1; j < n; j++) sum += f[m][j];p1 *= 1.0 f[m][0];p2 *= sum;}printf("%.3lf\n", p1 p2);}return 0;}
上一篇:[BZOJ4989] [Usaco2017 Feb]Why Did the Cow Cross the Road(树状数组)
下一篇:[BZOJ4776] [Usaco2017 Open]Modern Art(差分 + 思维?)
DP 概率和期望









