| ||||||||||
| 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 | |||||||||
Re:超时,我无语,求牛人解释,是不是输入输出控制上的问题,诚谢!In Reply To:超时,我无语,求牛人解释,是不是输入输出控制上的问题,诚谢! Posted by:scuwf at 2010-10-17 09:47:54 #include<stdio.h>
#include<math.h>
int main (void)
{
long int a,b,r,temp;
while(scanf("%ld%ld",&a,&b)!=EOF)//增加结束条件
{
r=abs(a-b);
if(a>b)
{
temp=b;
}
else
{
temp=a;
}
if(r>=2*temp/(sqrt(5.0)+1) && r<2*(temp+1)/(sqrt(5.0)+1))
{
printf("0\n");
}
else
{
printf("1\n");
}
}
return 0;
}
修改成这样就可以了。
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator