标签:open mes pen div include string tmp 输入 color
2 3 9
8
#include <iostream> #include <string> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <vector> #include <queue> #define range(i,a,b) for(int i=a;i<=b;++i) #define LL long long #define rerange(i,a,b) for(int i=a;i>=b;--i) #define fill(arr,tmp) memset(arr,tmp,sizeof(arr)) using namespace std; LL a,b,p; void init(){ cin>>a>>b>>p; } LL qpow(LL a,LL b){ LL ans=1;a%=p; while(b){ if(b&1)ans=ans*a%p; a=a*a%p; b>>=1; } return ans; } void solve(){ cout<<qpow(a,b)%p<<endl; } int main() { init(); solve(); return 0; }
标签:open mes pen div include string tmp 输入 color
原文地址:https://www.cnblogs.com/Rhythm-/p/9318474.html