Eddy's digital Roots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4436 Accepted Submission(s): 2505 Problem Description The digital root of a positive integer is found by summing the digi…
学习了元根的一些知识,哈哈. 总结一下: 几个概念: 阶:对于模数m和整数a,并且gcd(m,a)==1,那么定义a在模m下的阶r为满足ar=1 mod m的最小正整数. 性质1:r in [1,phi(m)] (由欧拉定理) 性质2:r | phi(m) ( ar=aphi(m) mod m,然后用反证法) 性质3:r 是整数a模m的阶当且仅当满足:1)ar=1 mod m 2) a r/p(r) ≠ 1 mod m (后面推前面也用反正法). 元根: 如果对于一个模数m,存在一个数…