全WA萌新求助
查看原帖
全WA萌新求助
294736
bovine__kebi楼主2020/5/6 10:51

人头(大雾)

#include<bits/stdc++.h>
using namespace std;
const int Mod=19260817;
typedef long long ll;
inline ll read()
{
    ll x,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
        {
            f=-1;
        }
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
        x=((x<<1)+(x<<3))%Mod+(ch^48)%Mod;
        ch=getchar();
    }
    return x%Mod*f;
}
ll qpower(ll x,ll p)
{
    ll ans=1;
    while(p)
    {
        if(p&1)ans=ans*x%Mod;
        x=x*x%Mod;
        p>>=1;
    }
    return ans%Mod;
}
int main()
{
    ll a,b;
    a=read();
    b=read();
    if(b==0){printf("Angry!\n");return 0;}
    printf("%lld\n",(qpower(b,Mod-2)%Mod*a%Mod)%Mod);
    return 0;
}
2020/5/6 10:51
加载中...