Submission 261
Return to ProblemUser: admin
Language: cpp
Submitted at: Nov. 8, 2025, 8:34 p.m.
Elapsed Time: 64.93 s
Keys per Minute (KPM): Unknown
Status: AC
Test Case Results:
| # | Status | Time (s) | Error |
|---|---|---|---|
| 1 | AC | 0.011 | - |
| 2 | AC | 0.011 | - |
| 3 | AC | 0.012 | - |
| 4 | AC | 0.012 | - |
| 5 | AC | 0.009 | - |
| 6 | AC | 0.012 | - |
#include <iostream>
using namespace std;
#define int long long
int qpow(int a,int b,int p){
if (a==0) return 0;
int ret=1;
while (b){
if (b&1) ret=(ret*a)%p;
b>>=1;
a=(a*a)%p;
}
return ret;
}
signed main(){
int a,b,p;
cin>>a>>b>>p;
cout<<qpow(a,b,p);
}