| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 100216 | 陈志轩 | [HNOI2008]越狱 | C++ | Accepted | 100 | 0 MS | 252 KB | 415 | 2023-08-25 09:28:38 |
#include<bits/stdc++.h> #define int long long using namespace std; const int mod = 1e5 + 3; int fastpow(int a,int b){ int sum = a,ans = 1; while (b){ if (b & 1){ ans = (ans * sum) % mod; } sum = (sum * sum) % mod; b >>= 1; } return ans; } signed main(){ int n,m; cin>>m>>n; cout<<(fastpow(m % mod,n) - (fastpow((m - 1) % mod,n - 1) * m) % mod + mod) % mod<<'\n'; return 0; }