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 majia5 at 2009-10-25 21:19:19
In Reply To:B题 怎么做? Posted by:BUAA_MM at 2009-10-25 15:11:11
> rt
1.O(n)暴力Hash寻找循环节的开始位置和循环节长
2.Baby-Step用解离散对数的相关内容来做(见上次ZJU 的E),多校的时候我用BabyStep写了5kb的代码AC了那题.
3.a^x = a^(x%phi(p)+phi(p)) (mod p) (x>=phi(p)),代码很短,不过要注意成立的条件

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