subtask#1 #10过不了
查看原帖
subtask#1 #10过不了
756900
When_can_I_be楼主2022/12/9 20:29

RT,代码如下

#include<iostream>
#include<math.h>
#include<iomanip>
#include<cstring>
using namespace std;
int main(){
    
    long long a,b,cnt=1;
    cin>>a>>b;
    
    for(int i=0;i<b;i++){
    	
    	cnt*=a;
    	if(cnt>=1000000000){
    		cout<<"-1";
    		return 0;
		}
	}
	cout<<cnt;
    
    return 0;
}
2022/12/9 20:29
加载中...