![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
初等数论
cxylyq526
这个作者很懒,什么都没留下…
展开
-
Relatives 互质数个数
Relatives Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0...原创 2019-07-09 19:59:20 · 519 阅读 · 0 评论 -
青蛙的约会 扩展GCD
青蛙的约会 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只...原创 2019-07-10 20:40:12 · 146 阅读 · 0 评论 -
素数筛法
素数筛法 1.埃式筛 #include <iostream> #include<stdio.h> #include<algorithm> #define me(a,b) memset(a,b,sizeof(a)) const int maxn=1e6+10; using namespace std; int a[maxn],b[maxn]; int main()...原创 2019-07-30 09:23:58 · 108 阅读 · 0 评论