safe保险一点5吧.我是MR: ; int gcd(int a,int b){return !b?a:gcd(b,a%b);} int mul(int a,int b,int p){ )*p); ?tmp+p:tmp; } int pow(int a,int b,int p){ ;a%=p; ,a=mul(a,a,p)) )ans=mul(ans,a,p); return ans; } bool check(int a,int n,int r,int s){ int ans=pow(a,r,n…