正文
增加 9 行删除 9 行
38 行未改动39404142434445464748495051525354555668 行未改动12512612712812913013113213324 行未改动1581591601611621631641651661671681691701718 行未改动18018118218318418518618718818938 行未改动#include<string>#include<algorithm>#include<math.h>#include<time.h>#include<map>using namespace std;map<long long,bool> M;const long long mod=1234577;int n,tl,ftl;long long a[100005],b[100005],fac[20];struct node{long long A,B,C;//mod A^B=C};node t[1500005];bool cmp(node x,node y){68 行未改动}exgcd(b,a%b,x,y);long long tmp=x;x=y;y=tmp-a/b*y;}long long CRT(){24 行未改动for(i=1;i<=n;++i){scanf("%lld%lld",&a[i],&b[i]);if(a[i]==1) continue;add(a[i],b[i]);}// cout<<clock()<<endl;sort(t+1,t+tl+1,cmp);l=r=1;while(l<=tl){maxx=t[l].B,mm=t[l].C;8 行未改动}a[++ftl]=pow(t[l].A,maxx),b[ftl]=mm;l=r+1,r=l;}printf("%lld\n",CRT());return 0;}```38 行未改动39404142434445464748495051525354555668 行未改动12512612712812913013113213324 行未改动1581591601611621631641651661671681691701718 行未改动18018118218318418518618718818938 行未改动#include<string>#include<algorithm>#include<math.h>#include<time.h>#include<map>using namespace std;map<long long,bool> M;const long long mod=1234577;int n,tl,ftl;long long a[100005],b[100005],fac[20];struct node{long long A,B,C;//mod A^B=C};node t[1500005];bool cmp(node x,node y){68 行未改动}exgcd(b,a%b,x,y);long long tmp=x;x=y;y=tmp-a/b*y;}long long CRT(){24 行未改动for(i=1;i<=n;++i){scanf("%lld%lld",&a[i],&b[i]);if(a[i]==1) continue;add(a[i],b[i]);}// cout<<clock()<<endl;sort(t+1,t+tl+1,cmp);l=r=1;while(l<=tl){maxx=t[l].B,mm=t[l].C;8 行未改动}a[++ftl]=pow(t[l].A,maxx),b[ftl]=mm;l=r+1,r=l;}printf("%lld\n",CRT());return 0;}```