| ||||||||||
| 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 | |||||||||
Time Limit Exceeded,求解释#include "stdio.h"
#include "math.h"
void main()
{
double a,b,temp1,temp2;
int i;
while(scanf("%lf %lf",&a,&b)!=EOF)
{
if(a>b)
{
temp1=a;
a=b;
b=temp1;
}
for(i=1,temp1=0,temp2=0;floor(temp1)<a&&floor(temp2)<b;i++)
{
temp1=i*(1+sqrt(5))/2;
temp2=temp1+i;
}
printf("%d\n",(floor(temp1)==a&&floor(temp2)==b)?0:1);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator