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

Re:求大神指导为什么一直过不了,数据对了啊

Posted by 3233313048 at 2016-05-23 20:28:57 on Problem 1061
In Reply To:求大神指导为什么一直过不了,数据对了啊 Posted by:448501561 at 2013-08-13 18:56:30
> 	y=y%L;
> 	__int64 t=0,s,v,r;
> 	if(m>n)
> 	{
> 		v=m-n;
> 		s=(y-x+L)%L;
> 		if(s==0)
>             s+=L;
> 		r=s%v;
> 		while(1)
> 		{
> 			if(s%v==0)
> 				break;
> 			else if(t>0&&s%v==r)
> 			{
> 				flag=true;
> 				break;
> 			}
> 			t++;
> 			s+=L;
> 		}
> 	}
> 	if(m<n)
> 	{
> 		v=n-m;
> 		s=(x-y+L)%L;
> 		if(s==0)
>             s+=L;
> 		r=s%v;
> 		while(1)
> 		{
> 			if(s%v==0)
> 				break;
> 			else if(t>0&&s%v==r)
> 			{
> 				flag=true;
> 				break;
> 			}
> 			t++;
> 			s+=L;
> 		}
> 	}
> 	if(flag)
> 		printf("Impossible\n");
> 	else
> 		printf("%I64d\n",s/v);
>     }
> 	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