Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

如何暴力计算??样例一直过不了....

Posted by wzc1989 at 2009-02-22 21:34:54 on Problem 3716
我用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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator