自测AC了,请问强数据能过吗
查看原帖
自测AC了,请问强数据能过吗
649618
0x4D2楼主2022/10/29 13:47
#include<bits/stdc++.h>
using namespace std;
int a,b;
long long ans=1;

int main() {
	//freopen("pow.in","r",stdin);
	//freopen("pow.out","w",stdout);
	scanf("%d%d",&a,&b);
	for(int i=1;i<=b;i++) {
		if(ans*a>1000000000) {
			printf("%d",-1);
			return 0;
		}
		ans*=a;
	}
	cout<<ans;
	return 0;
}
2022/10/29 13:47
加载中...