随笔分类 - 数论
摘要:java大数类的模幂计算中,其中比较核心部分就是使用一种窗口算法来优化乘法,然后使用Montgomery取模乘的办法加速取模。 在jdk中,它的源码如下: private BigInteger oddModPow(BigInteger y, BigInteger z) { /* * The algo
阅读全文
摘要:https://nanti.jisuanke.com/t/41299 指数循环节,快速幂递归求解,需要注意的是快速幂乘的时候如果超过了m需要+m补全循环节
阅读全文
摘要:C. Neko does Maths time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Neko does Maths tim
阅读全文
摘要:D. The Beatles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently a Golden Circle o
阅读全文
摘要:C. Permutation Cycle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output For a permutation P
阅读全文
摘要:B. Recursive Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Recursive Querie
阅读全文
摘要:A. Points on the line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Points on the li
阅读全文
摘要:C. Sad powers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Sad powers time limit p
阅读全文