记录编号 | 598514 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 取余运算 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 0.029 s | ||
提交时间 | 2025-01-25 09:17:40 | 内存使用 | 3.30 MiB | ||
#include <bits/stdc++.h> using namespace std; long long a,b,p; int main(){ freopen("dmod.in","r",stdin); freopen("dmod.out","w",stdout); cin>>a>>b>>p; int ans=1; while(b){ if(b&1){ ans=ans*a%p; } a=a*a%p; b=b>>1; } cout<<ans; return 0; }