| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 30421 | hukaiyuan | 取余运算 | C++ | Wrong Answer | 0 MS | 260 KB | 290 | 2023-11-09 21:24:44 |
#include<bits/stdc++.h> using namespace std; int b,p,k; int f(int p){ if(p==0) return 1; int tmp; tmp=f(p/2)%k; tmp=(tmp*tmp)%k; if(p%2==1){ tmp=(tmp*b)%k; } } int main(){ cin>>b>>p>>k; int t=b; int ans=f(p); printf("%d^%d mod %d=%d",b,p,k,ans); return 0; }