求助qwq
查看原帖
求助qwq
1769771
GEYIHAO楼主2025/8/31 12:09
#include <bits/stdc++.h>
#define int long long
using namespace std;

int quickpow(int a,int b){
	int sum=1;
	while(b>0){
		if(b&1){
			sum=sum*a;
		}
		a=a*a;
		b=b>>1;
		if(sum>2147683647){
			return -1;
		}
	}
	return sum;
}

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
	cout.tie(0);
	int a,b;
	cin>>a>>b;
	int cnt=0;
	cnt=quickpow(a,b);
	cout<<cnt;
	return 0;
}


sub0一个点WA,sub1两个WA,sub2全WA,无TLE

2025/8/31 12:09
加载中...