版本比较
题解 [AGC063D] Many CRT
正文
增加 10 行删除 10 行
33 行未改动3435363738383940414237 行未改动808182838485868485868788899091919293949595969798999 行未改动10911011111211311311411511611717 行未改动1351361371381391391401411421431441451461461471481491502 行未改动15315415515615715715815916016130 行未改动33 行未改动// Contest: AtCoder - AtCoder Grand Contest 063// URL: https://atcoder.jp/contests/agc063/tasks/agc063_d// Memory Limit: 1024 MB// Time Limit: 2000 ms// //// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>#define poly vector<int>37 行未改动 if (c%d)return -1; x*=c/d,y*=c/d; d=abs(d); LL p=b/d,q=a/d,k; if(y<0)
if(y<0) { k=(-y+q-1)/q,x-=p*k,y+=q*k; } else if(y>=0) if(y>=0) { k=(y)/q,x+=p*k,y-=q*k; } if(x<0) if(x<0) { int o=(-x-p-1)/(-p); x-=p*o,y+=q*o; }9 行未改动void BellaKira(){ int n,a,b,c,d; int aa,bb,cc,dd;
cin>>n>>aa>>bb>>cc>>dd; int g=__gcd(cc,dd); if (bb%g!=0) {17 行未改动 { for (int j=o;j<n;j+=i) { int tt=0; while (val[j]%i==0) while (val[j]%i==0) { val[j]/=i; tt++; } mx=max(mx,tt); } while (mx--) while (mx--) { M=M*i%d,M1=M1*i%mod; if (inf/rM<i) rM=inf+1; else rM*=i;2 行未改动 for (int j=i+i;j<=1000000;j+=i) vis[j]=1; } for (int i=0;i<n;i++) { int u=val[i]; int u=val[i]; { M=M*u%d,M1=M1*(u%mod)%mod; if (inf/rM<u) rM=inf+1; else rM*=u;30 行未改动