题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3240 n 和 m 太过巨大,不难想到应该用费马小定理什么的来缩小范围: 总之就是推式子啦,看博客:https://blog.csdn.net/jiangshibiao/article/details/24594825 还有:https://www.cnblogs.com/iiyiyi/p/5617598.html 其实也蛮好推的,也挺好写,但我调了很久很久啊... 要十分注意取 mod 时…