题意 : 给出数 x (1 ≤ x ≤ 10^12 ),要求求出所有满足 1 ≤ n ≤ x 的 n 有多少个是满足 n*a^n = b ( mod p ) 分析 : 首先 x 的范围太大了,所以使用枚举进行答案的查找是行不通的 观察给出的同余恒等式,发现这个次方数 n 毫无规律 自然想到化成费马小定理的形式 令 n = i*(p-1)+j 式子化成 根据费马小定理不难证明(猜???)周期为 p*(p-1) ==> 来自 Tutorial,反正我是不知道怎么证,貌似评论下面有大神用欧拉函数来证…
Description Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the division of S by 29). Take X = 1 for an example. The positive integer divisors of 2004^1…
C. Beautiful Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vitaly is a very weird man. He's got two favorite digits a and b. Vitaly calls a positive integer good, if the decimal…