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