![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM-数论
GDUFE_SSS
这个作者很懒,什么都没留下…
展开
-
HDU 3923 Invoker 普通染色:乘法逆元与扩展欧几里得
c种颜色给n个珠子染色:1.旋转:将环顺时针旋转i格后,循环节个数为gcd(n,i), 染色方案为 ∑c^gcd(n,i) 其中 i=1~n ;gcd代码:LL gcd(LL a,LL b) { return b==0?a:gcd(b,a%b); } 2.翻转 :这里也得考虑两种情转载 2017-08-04 10:58:55 · 423 阅读 · 0 评论 -
CodeForces 7C Line Exgcd(数论)
传送门:http://codeforces.com/problemset/problem/7/C题意&&思路:找出方程一组通解,扩展欧几里得算法就是解方程(欧几里得算法详解)先附上扩展欧几里得算法模板:ll gcd(ll a,ll b,ll& x,ll& y){ if(!b) { x=1; y=0; return a; } ll ans=gcd原创 2017-08-04 21:21:48 · 470 阅读 · 0 评论 -
LightOJ 1370- Bi-shoe and Phi-shoe (欧拉函数)
/*欧拉函数*/Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant原创 2017-11-24 23:02:22 · 265 阅读 · 0 评论