| 比赛 | CSP2022普及组 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 乘方 | 最终得分 | 100 |
| 用户昵称 | 李奇文 | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2022-10-29 16:22:53 | ||
#include<bits/stdc++.h>
using namespace std;
int maxx=1000000000;
long long ans=1;
int main(){
freopen("csp2022pj_pow.in","r",stdin);
freopen("csp2022pj_pow.out","w",stdout);
long long a,b;
cin>>a>>b;
if(a==1){
cout<<1;
return 0;
}
for(int i=1;i<=b;i++){
ans*=a;
if(ans>maxx){
cout<<-1<<endl;
return 0;
}
}
cout<<ans;
return 0;
}