#include<bits/stdc++.h>
#define ll long long
#define mod 100003
using namespace std;
ll n, m;
ll ksm(ll A, ll B){
ll now = A % mod, t = B, ans = 1;
while(t){
if(t % 2 == 1)
ans = (ans * now) % mod;
now = (now * now) % mod;
t /= 2;
}
return ans;
}
int main(){
scanf("%d%d", &m, &n);
if(n == 1){
printf("0");
return 0;
}
if(n == 2){
printf("%lld", m);
return 0;
}
ll a = ksm(m, n), b = (m % mod), c = ksm(m - 1, n - 1);
ll t = (a - (b * c) % mod) % mod;
printf("%lld", (t + mod) % mod);
return 0;
}
哪里有问题,导致10分qwq