比赛 CSP2022普及组 评测结果 RRRRRRRRRR
题目名称 乘方 最终得分 0
用户昵称 wang 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2022-10-29 17:43:35
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
unsigned long long a,b,c=1;
int main(){
	freopen("pow.in","r",stdin);
	freopen("pow.out","w",stdout);
	cin>>a>>b;
	if (a==1) cout<<1;
	else{
		for (int i=1;i<=b;i++){
			c*=a;
			if (c>1000000000){
				cout<<-1;
				return 0;
			}
		}
		cout<<c;
	}
	return 0;
}