| 比赛 | 2020级再出发之二进制拆分及运用 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 取余运算 | 最终得分 | 100 |
| 用户昵称 | ┭┮﹏┭┮ | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2023-07-24 12:35:38 | ||
#include <bits/stdc++.h>
using namespace std;
long long a,b,p,ans = 1;
int main(){
freopen("dmod.in","r",stdin);
freopen("dmod.out","w",stdout);
scanf("%lld%lld%lld",&a,&b,&p);
while(b){
if(b & 1)ans = ans * a % p;
a = a * a % p;
b >>= 1;
}
printf("%lld\n",ans);
return 0;
}