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:注意了!!必须用__int64,用long int WA;而且要注意ax+by=c中a、c的正负;以及结果应属于(1,L/gcd(a,L))

Posted by jiangshuibujie at 2012-10-04 17:46:46 on Problem 1061
In Reply To:注意了!!必须用__int64,用long int WA;而且要注意ax+by=c中a、c的正负;以及结果应属于(1,L/gcd(a,L)) Posted by:JokerKS at 2010-09-11 13:56:01
> RT
> a是两蛙速度差,b是数轴长,求x
> x=用辗转相除扩展算出ax+by=gcd(a,b)的解再乘以c/gcd(a,b)的值
> 
> 以这题的数据来看
> 直接让a=n-m;c=x-y;就可以过了
> 让a=m-n;c=y-x;而之后不作处理就WA
> 
> 
> 假如得到结果是x
> 应该输出(x%t+t)%t  --(t=L/gcd(a,L))
> 即是使x>1且小于L/gcd(a,L)
在保证解的非负最小性时,(x%t+t)%t  --(t=L/gcd(a,L))
中t的含义是什么,为什么这样

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