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

computing the probility of the tournament

Posted by 070101070260 at 2011-11-16 16:07:07 on Problem 2261
for(i=0;i<16;i++)
	{
		for(j=0;j<16;j++)
		{
			scanf("%lf",&sa[i][j]);
			sa[i][j]=sa[i][j]/100.0;
		}
		p[i][0]=1.0;
	}
for(r=0;r<4;r++)
	{
		for(i=0;i<16;i++)
		{
			double ss=0; // probility of going through the round at present
			for(k=(1<<r);k<(2<<r);k++)
			{
				ss+=sa[i][i^k]*p[i^k][r];
			}
			p[i][r+1]=p[i][r]*ss; //going to the next round
		}
	}

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