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

注意pollard_rho中gcd的写法

Posted by 10110057 at 2014-07-31 10:00:09 on Problem 1811
应该把LL d=gcd(y-x,n)改成LL d=gcd(y-x+n,n);
因为大家写gcd的时候 大多是下面的写法,这要求输入的a,b是非负数才能得到我们想要的答案
LL gcd(LL a,LL b){
    return b?gcd(b,a%b):a;
}

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