摘要: 这道题只要用朴素算法的bsgs就行了,数据中的情况都是基本情况没有变形但是要注意加一个判断语句 阅读全文
posted @ 2019-08-24 16:38 Gold_stein 阅读(268) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define ll long long using namespace std; ll n,m,a,lcm,now; bool flag; void exgcd(ll a,ll b,ll &d,ll &x,ll &y) { if(b==0) { d=a; x=1; y=0; } else { exgcd(b,a%b,d,x,y); ll t=x; 阅读全文
posted @ 2019-08-24 16:37 Gold_stein 阅读(283) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define ll long long using namespace std; const ll M=9901; ll a,b,ans=1,cnt; ll p[20],c[20]; inline void divide(int n) { for(int i=2;i*i<=n;i++) { if(n%i==0) { p[++cnt]=i; whil 阅读全文
posted @ 2019-08-24 16:36 Gold_stein 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 1632:【 例 2】[NOIP2012]同余方程 阅读全文
posted @ 2019-08-24 16:35 Gold_stein 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define ll long long using namespace std; ll x,y,L,m,n; void Exgcd(ll a,ll b,ll &d,ll &x,ll &y) { if(!b) { x=1;y=0;d=a; } else { Exgcd(b,a%b,d,x,y); int t=x;x=y;y=t-a/b*y; } } 阅读全文
posted @ 2019-08-24 16:34 Gold_stein 阅读(262) 评论(0) 推荐(0) 编辑