摘要: 参考大神https://blog.csdn.net/a27038/article/details/77203892 阅读全文
posted @ 2018-07-16 17:34 MCQ 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 直接套欧拉函数模板,链接:欧拉函数#include#include#include#include#include#include#include#include#include#include#include#include#include#include#incl... 阅读全文
posted @ 2018-07-16 16:57 MCQ 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 欧拉函数有直接求法和打欧拉函数表法。欧拉函数的定义:对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。例如euler(8)=4,因为1,3,5,7均和8互质。Euler函数表达通式:euler(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1... 阅读全文
posted @ 2018-07-16 16:51 MCQ 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 思路:设第x天高峰同时出现,则x≡p(mod23),x≡e(mod28),x≡i(mod33),根据中国剩余定理,求出乘法逆元,直接套公式求和就行了。注意:求和后要减去初始天数d,如果是小于等于0,则要加上m=23*28*33#include#include#incl... 阅读全文
posted @ 2018-07-16 13:55 MCQ 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ll kgcd(ll a,ll b,ll &x,ll &y)//扩欧{ if(!b) { x=1;y=0;return a; } ll t=kgcd(g,a%b,y,x); y-=a/b*x; return t;}ll... 阅读全文
posted @ 2018-07-16 11:37 MCQ 阅读(93) 评论(0) 推荐(0) 编辑