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

Time Limit Exceeded

Posted by _LV111 at 2009-04-06 17:33:10 on Problem 1061
void _1061(int xx,int yy,int mm,int nn,int ll);
int main(void)
{
	int x,y,m,n,l;
	scanf("%d %d %d %d %d",&x,&y,&m,&n,&l);
	_1061(x,y,m,n,l);
	return 0;
}
void _1061(int xx,int yy,int mm,int nn,int ll)
{
	int k=1,i=xx-yy,j=mm-nn;
	if(abs(j)==0||abs(j)>=ll&&abs(j)%ll==0)
		printf("Impossible\n");
	else
	{
		while(abs(i+j*k)!=0&&(abs(i+j*k)<ll||abs(i+j*k)%ll!=0))
		{
			k++;
		}
		printf("%d\n",k);
	}
}
。。。。怎么会这样。。


还有,类型开到long long该怎么办

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