0分求助嘉人们
查看原帖
0分求助嘉人们
592681
ran_Diana楼主2022/1/25 15:09

为什么全红了:(

#include<iostream>
using namespace std;
const int P=19260817;
long long a,b,x,y;
void exgcd(long long a,long long b)
{
	if(b==0)
	{
		x=1;
		y=0;
		return;
	}
	exgcd(b,a%b);
	long long t=x; x=y; y=t-a/b*y;
}
int main()
{
	scanf("%lld%lld",&a,&b);
	if(b==0)
	{
		printf("Angry!");
		return 0;
	}
    exgcd(b, P);
    x = (x+P)%P;
	printf("%lld",((a%P)*(x%P)%P));
 	return 0;
}
2022/1/25 15:09
加载中...