| 比赛 | CSP2022普及组 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 乘方 | 最终得分 | 100 |
| 用户昵称 | 日 | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2022-10-29 16:26:01 | ||
#include<bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
freopen("pow.in","r",stdin);
freopen("pow.out","w",stdout);
scanf("%lld%lld",&a,&b);
if((a>=10)&&(b>=10))
{
cout<<-1<<endl;
return 0;
}
if((a>pow(10,9))&&(b>pow(10,9)))
{
cout<<-1<<endl;
return 0;
}
long long c=pow(a,b);
if(c<=pow(10,9))
cout<<c<<endl;
else cout<<-1<<endl;
return 0;
}