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

超时,我无语,求牛人解释,是不是输入输出控制上的问题,诚谢!

Posted by scuwf at 2010-10-17 09:47:54 on Problem 1067
#include<stdio.h>
#include<math.h>
int main (void)
{
	long int a,b,r,temp;
	while(1)
	{
		scanf("%ld%ld",&a,&b);
		r=abs(a-b);
		if(a>b)
		{
			temp=b;
		}
		else
		{
			temp=a;
		}
		if(r>=2*temp/(sqrt(5)+1) && r<2*(temp+1)/(sqrt(5)+1))
		{
			printf("0\n");
		}
		else
		{
			printf("1\n");
		}
	}
	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