| 比赛 | CSP2022普及组 | 评测结果 | AAAAAATAAA |
|---|---|---|---|
| 题目名称 | 乘方 | 最终得分 | 90 |
| 用户昵称 | 张皓荀 | 运行时间 | 1.000 s |
| 代码语言 | C++ | 内存使用 | 0.57 MiB |
| 提交时间 | 2022-10-29 16:28:55 | ||
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("pow.in","r",stdin);
freopen("pow.out","w",stdout);
int a,b;
long long ans;
cin>>a>>b;
ans=1;
if(b>=30&&a!=1){
cout<<"-1";
return 0;
}
for(int i=1;i<=b;i++){
ans*=a;
if(ans>1000000000){
cout<<"-1";
return 0;
}
}
cout<<ans;
}