50pts求调试(有关注雨)
查看原帖
50pts求调试(有关注雨)
1331383
CSP400pts楼主2024/9/1 10:11

My WA code:

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
long long a,b;
long long sum;
int main() {
	cin>>a>>b;
	int sum=1;
	for(int i=1; i<=b; i++) {
		sum*=a;
		if(sum>pow(10,9)) {
			cout<<-1<<endl;
			return 0;
		}
	}
	cout<<pow(a,b);
	return 0;
}
2024/9/1 10:11
加载中...