![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
cwb丶
这个作者很懒,什么都没留下…
展开
-
Icebound and Sequence(非互质逆元 快速乘法)or(矩阵快速幂)
Icebound hates math. But Imp loves math. One day, Imp gave icebound a problem.The problem is as follows.S=(∑ni=1qi)modpS=(∑i=1nqi)modpFor given q,n,p, you need to help icebound to calculate th...原创 2019-05-25 17:26:49 · 427 阅读 · 0 评论 -
D - Farey Sequence (欧拉函数打表)
The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arranged in increasing order. The first few areF2 ...原创 2019-08-01 11:22:55 · 89 阅读 · 0 评论 -
B - 上帝与集合的正确用法 (欧拉降幂)
根据一些书上的记载,上帝的一次失败的创世经历是这样的:第一天, 上帝创造了一个世界的基本元素,称做“元”。第二天, 上帝创造了一个新的元素,称作“α”。“α”被定义为“元”构成的集合。容易发现,一共有两种不同的“α”。第三天, 上帝又创造了一个新的元素,称作“β”。“β”被定义为“α”构成的集合。容易发现,一共有四种不同的“β”。第四天, 上帝创造了新的元素“γ”,“γ”被...原创 2019-08-01 11:32:49 · 91 阅读 · 0 评论 -
F - Prime Test (唯一分解定理|逆元|快速加法)
Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901).InputThe only line contains the two natural n...原创 2019-08-01 15:45:32 · 363 阅读 · 0 评论 -
super_log(欧拉降幂)
n Complexity theory, some functions are nearlyO(1)O(1), but it is greater thenO(1)O(1). For example, the complexity of a typical disjoint set isO(nα(n))O(nα(n)). Hereα(n)α(n)is Inverse Ackermann ...原创 2019-09-02 21:28:18 · 268 阅读 · 0 评论