1008

 

思路:

  越狱情况=总情况-不越狱情况;

 

代码:

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define ll long long

ll poww(ll x,ll e,ll k)
{
    ll res=1,pos=x;pos%=k;
    while(e)
    {
        if(e&1) res=(res*pos)%k;
        pos=(pos*pos)%k,e=e>>1;
    }
    return res;
}

int main()
{
    ll m,n;
    cin>>m>>n;
    ll ans=(poww(m,n,100003)%100003-poww(m-1,n-1,100003)%100003*m%100003)%100003;
    cout<<(ans<0?ans+100003:ans);
    return 0;
}

 

相关文章:

  • 2021-08-11
  • 2021-08-31
  • 2021-08-31
  • 2022-02-15
猜你喜欢
  • 2021-11-17
  • 2022-02-04
  • 2022-12-23
  • 2021-06-01
  • 2022-01-30
相关资源
相似解决方案