1 solutions
- 1
Information
- ID
- 7834
- Time
- 500ms
- Memory
- 128MiB
- Difficulty
- 1
- Tags
- # Submissions
- 116
- Accepted
- 35
- Uploaded By
这都要看题解?
#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;
}
upd 2022.11.14/2025.04.02:各新增加一组 Hack Hack 数据。
By signing up a ZXOJ universal account, you can submit code and join discussions in all online judging services provided by us.