第一题:
代码:
#include <iostream>
#include <tuple>
using namespace std;
const int MOD = 19260817;
inline long long getint()
{
long long res = 0, ch = getchar();
while(!isdigit(ch) and ch != EOF)
ch = getchar();
while(isdigit(ch))
{
res = (res << 3) + (res << 1) + (ch - '0');
res %= MOD;
ch = getchar();
}
return res;
}
long long modexp(long long a,long long b,long long mod)
{
long long res=1;
a%=mod;
while(b>0)
{
if(b%2==1)
{
res=(res*a)%mod;
}
a=(a*a)%mod;
b>>=1;
}
return res;
}
long long suan(long long a,long long m)
{
return modexp(a,m-2,m);
}
int main() {
long long a, b;
a=getint();
b=getint();
if (b == 0)
{
cout << "Angry!" << endl;
return 0;
}
long long inv = suan(b, MOD);
if (inv == -1)
{
cout << "Angry!" << endl;
} else
{