| 比赛 | CSP2022普及组 | 评测结果 | AAWAAWAAWA |
|---|---|---|---|
| 题目名称 | 乘方 | 最终得分 | 70 |
| 用户昵称 | hnzzlza | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2022-10-29 14:57:58 | ||
#include <bits/stdc++.h>
using namespace std;
int a,b,ans=1,l,wop=1;
int main(){
freopen("csp2022pj_pow.in","r",stdin);
freopen("csp2022pj_pow.out","w",stdout);
cin>>a>>b;
while(b!=0){
if(b&1){
ans*=a;
}
a*=a;
b=b>>1;
if(ans>1000000000){cout<<-1;return 0;}
}
cout<<ans;
return 0;
}