1 solutions

  • 0
    @ 2024-7-20 13:13:28

    这都要看题解?

    #include<bits/stdc++.h>
    using namespace std;
    #define int long long
    const int e=1e9;
    int pow_pro(int a,int b){
    	int k=1;
    	for(int i=1;i<=b;i++){
    		k*=a;
    		if(k>e){
    			return -1;
    		}
    	}
    	return k;
    }
    signed main(){
    	int a,b;
    	cin>>a>>b;
    	cout<<pow_pro(a,b);
    	return 0;
    }
    
    • @ 2025-10-12 10:35:52

      upd 2022.11.14/2025.04.02:各新增加一组 Hack Hack 数据。

  • 1

Information

ID
7834
Time
500ms
Memory
128MiB
Difficulty
1
Tags
# Submissions
116
Accepted
35
Uploaded By