90pts!破解悬2关
查看原帖
90pts!破解悬2关
1178990
kaijie2002楼主2024/6/19 20:24

90分求调,改善代码dalao必关注

我错哪了???冤啊

:::error[我的错误] Wrong Answer.
wrong answer Too long on line 2.

stuback 0一个,但stub 1全wa

::: :::info[代码]

#include<bits/stdc++.h>
using namespace std;
int a,b,ans=1;
const int maxn=1e9;
int main(){
	cin>>a>>b;
	for(int i=1;i<=b;i++){
		ans*=a;
		if(ans>maxn){
			cout<<-1;
			return 0;
		}
	}cout<<ans;
	return 0;
}

:::

感谢屏幕前大佬的指正!

2024/6/19 20:24
加载中...