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

帮我看看为什么总是RUNE TIME ERROR

Posted by tashj at 2005-10-26 10:54:59 on Problem 2633
#include<stdio.h>
#define max 1000000
double a[max],b[max];
int main()
{
 	int n,record,top1,top2,i,j,m;
 	double min,num,p[100];
    scanf("%d",&n);
    while(n--)
    {
     record=1;
     top1=top2=0;     
     scanf("%lf %d",&num,&m);
      b[top2++]=num;
      min=1;
     for(i=0;i<m;i++)
     {
       scanf("%lf",&p[i]);
       if(min>p[i])min=p[i];
     }
 
     while(1)
     {
 		 record=(record+1)%2;
	  if(!record)
      {
		 top1=0;
		 for(j=0;j<top2;j++)
		 {
            if(min*b[j]-1.00>.00000001)		
		   {
		   for(i=0;i<m;i++)
		   {
		    a[top1++]=b[j]*p[i];
		  
		   }
		   }
	     }
	  }
	  else
	  {
	        top2=0;
	        for(j=0;j<top1;j++)
	        {
               if(min*a[j]-1.000>.00000001)
              {
               for(i=0;i<m;i++)
               {
                 b[top2++]=a[j]*p[i];
  
		       }
             }
            }
	  }
	  if(top1==0)
	  {
		 printf("Nils\n");
		 break;
	  }
	  else if(top2==0)
	  { 
         printf("Mikael\n");
         break;
      }
	 }
  
    }
      return 0;
    
}

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