随笔分类 - 数论_整数快速幂
摘要:Problem Description Sample Input 2 2 Sample Output 2 Hint 1. For N = 2, S(1) = S(2) = 1. 2. The input file consists of multiple test cases. 解题思路:由于指数很
阅读全文
摘要:Problem Description Given a positive integer N, you should output the most right digit of N^N. Input The input contains several test cases. The first
阅读全文
摘要:Problem Description 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <=
阅读全文