10分,求调
查看原帖
10分,求调
1592128
Coke666zzx楼主2024/12/29 00:28
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod=100003;
ll m,n,x,y;
ll power(ll a,ll b)
{
    ll s=1;
    while(b>0){
        if(b&1){
            s*=a;
            s%=mod;
        }
        a*=a;
        a%=mod;
        b>>=1;
    }
    return s;
}
int main()
{
    scanf("%lld%lld",&m,&n);
    x=power(m,n);
    y=m*power(m-1,n-1);
    printf("%lld",(x-y+mod)%mod);
    return 0;
}
2024/12/29 00:28
加载中...