摘要:
一、性质求欧拉函数 from collections import Counter # 证明:容斥原理 # f(N) = N * (1 - 1/p1) * (1 - 1/p2) * ... * (1 - 1/pn) # 与N互质的数的个数: N - N/P1 - N/P2 - ... - N/Pn 阅读全文
posted @ 2024-04-03 18:17
gebeng
阅读(30)
评论(0)
推荐(0)
摘要:
一、中国剩余定理 from functools import reduce r = [2,3,2] # 要求mod里的数必须两两互质 mod = [3,5,7] def exgcd(a,b): if b == 0: return 1,0,a x,y,gcd = exgcd(b,a % b) x,y 阅读全文
posted @ 2024-04-03 11:45
gebeng
阅读(86)
评论(0)
推荐(0)

浙公网安备 33010602011771号