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 |
JAVA贡献了5次RE+6次TLE终于AC,亏在了BigInteger.isProbablePrime和Random.nextInt上用BigInteger是可以的,但是别用isProbablePrime,一用就RE,看了JDK估计是静态方法getSecureRandom()抛的RE,由于是私有方法,不高兴重写BigInteger了,就用了自己的Miller-Rabin,结果又亏在了Random.nextInt上,特别要当心,这个随出来可以是负数的,要取绝对值后才能用. 解题代码参考的http://xingyezhi.diandian.com/post/2012-02-26/15529645 Pollard rho分解质因数 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator