摘要: 指数爆炸的时候就要降幂 就是求a^b mod c 可以转化为 a^(b mod phi©+phi©) mod c phi 为 欧拉函数 欧拉函数phi(n)的求法: 阅读全文
posted @ 2019-02-19 19:14 xyq0220 阅读(153) 评论(0) 推荐(0)
摘要: 1 struct ios { 2 inline char read(){ 3 static const int IN_LEN=1 inline ios & operator >> (_Tp&x){ 9 static char c11,boo; 10 for(c11=read(),boo=0;!isdigit(c11);c11=rea... 阅读全文
posted @ 2019-02-19 19:13 xyq0220 阅读(782) 评论(0) 推荐(0)
摘要: 1 bool b[maxn]; 2 int f[maxn],len; 3 void init(int n){ 4 b[0]=b[1]=1; 5 for(int i=2;in)break; 12 b[i*f[j]]=1; 13 if(i%f[j]==0)break;//如果i是prime[j]的倍数,那么在筛i时已经筛过pr... 阅读全文
posted @ 2019-02-19 15:43 xyq0220 阅读(120) 评论(0) 推荐(0)