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

不懂为什么wa,大牛们看看吧,谢谢啦:)

Posted by xd at 2005-05-24 17:40:53 on Problem 1862
#include <iostream.h>
#include <math.h>
#include <iomanip.h>
void main ()
{
	int num,i,j;
	double sum,tmp;
	cin>>num;
	double *ptr=new double [num];
	
	for ( i=0;i<num;i++ )
		cin>>ptr[i];
	
	for ( i=0;i<num;i++ )//to sort;
	{
		for ( j=i;j<num;j++ )
		{
			if ( ptr[j]>ptr[i] )
			{
				tmp=ptr[j];
				ptr[j]=ptr[i];
				ptr[i]=tmp;
			}
		}
	}

	sum=pow ( ptr[0],1 / pow ( 2, num-1 ) );

	for ( i=1;i<num;i++ )
	{
			sum*=pow ( pow ( ptr[i],pow( 2,i-1 ) ),1 / pow ( 2, num-1 ) );
	}

	sum *= pow ( pow ( 2,  pow( 2,num ) -2 ),1/pow ( 2,num-1 ) );

	cout<<setiosflags(ios::fixed)<<setprecision(3)<<sum<<endl;
}

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