| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
如何暴力计算??样例一直过不了....我用a[i]表示第i个色子有几面红色的,然后暴力
for (a[1]=0;a[1]<=6;a[1]++)
for (a[2]=0;a[2]<=6;a[2]++)
for (a[3]=0;a[3]<=6;a[3]++)
for (a[4]=0;a[4]<=6;a[4]++)
把不满足p,q的情况剔除,然后对可能情况算一下当时的期望,并统计所有的可能情况数,最右
就是期望的和除以总的情况数.
这样做有问题吗,可行吗?
如果可行,就是我算的时候考虑错了.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator