Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:遍历所有因子超时In Reply To:遍历所有因子超时 Posted by:lihuiyykl at 2009-08-10 15:10:07 > 使用欧拉函数求出phi(m)值后,需要从小到大验证phi(m)的所有因子x, > 如果phi(m)很大,那么它的因子x也可能很大,所以每次验证10^x mod m是否等于1也就用掉了很多时间, > 我的程序因为这而超时,请问有什么好的方法能迅速验证10^x mod m是否等于1哇?大牛们多多指教,谢谢啦 直接验证就好了 sqrt(phi(m))*log2(m)的效率 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator