快速面裸题(显然的m^n-m*(m-1)^(n-1))
然后,,,就没有然后了
1 #include <cstdio> 2 #define wzf2000 100003 3 long long n,m; 4 long long mi(long long ans,long long n) 5 { 6 long long base=1; 7 while(n>1) 8 if(n&1) base=(ans*base)%wzf2000,n--; 9 else ans=(ans*ans)%wzf2000,n/=2; 10 return (base*ans)%wzf2000; 11 } 12 int main() 13 { 14 scanf("%lld%lld",&m,&n);m%=wzf2000; 15 printf("%d",(mi(m,n)-m*mi(m-1,n-1)%wzf2000+wzf2000)%wzf2000); 16 return 0; 17 }