| 比赛 | CSP2022普及组 | 评测结果 | AAAAAAAAAA | 
|---|---|---|---|
| 题目名称 | 乘方 | 最终得分 | 100 | 
| 用户昵称 | 蜀山鸭梨大 | 运行时间 | 0.989 s | 
| 代码语言 | C++ | 内存使用 | 0.57 MiB | 
| 提交时间 | 2022-10-29 17:24:25 | ||
#include<bits/stdc++.h>
using namespace std;
long long a,b,c=1;
int main(){
	freopen("csp2022pj_pow.in","r",stdin);
	freopen("csp2022pj_pow.out","w",stdout);
	cin>>a>>b;
	if(a>31622&&b>2){
		cout<<-1;
		return 0;
	}
	if(a>1&&b>=30){
		cout<<-1;
		return 0;
	}
	while(b--){
		c*=a;
		if(c>1000000000){
			cout<<-1;
			return 0;
		}
	}
	cout<<c;
	return 0;
}