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 chinabest at 2014-01-14 09:24:38 on Problem 2142
求x,y的通解,设为u,v,就是要求|u-at|+|v+bt|的最小值,其中只有t是未知数,这就是一个分段函数,零点就在两个绝对值的零点时取到,所以就枚举零点两端最近的4个整数,4种情况就好了。Bug:用欧几里得求出一组解后,要马上带回原方程然后求通解,不能求完通解后再回到原方程,那样会漏解

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