2018年12月17日

容斥定理

摘要: #include #include using namespace std; long long Gcd(long long a,long long b){ return b==0?a:Gcd(b,a%b); } long long cal(long long n,int *p,int cnt){ long long res=0; for(int i=1;i>=1; ... 阅读全文

posted @ 2018-12-17 12:44 欣崽 阅读(220) 评论(0) 推荐(0)

扩展中国剩余定理

摘要: #include using namespace std; #define ll long long ll Left[10+5],M[10+5]; ll exgcd(ll a,ll b,ll &x,ll &y){ if(!b){x=1,y=0;return a;} ll re=exgcd(b,a%b,x,y),tmp=x; x=y,y=tmp-(a/b)*y; r... 阅读全文

posted @ 2018-12-17 12:12 欣崽 阅读(228) 评论(0) 推荐(0)

导航