比赛 | CSP2022普及组 | 评测结果 | RRRRRRRRRR |
---|---|---|---|
题目名称 | 乘方 | 最终得分 | 0 |
用户昵称 | mayijia | 运行时间 | 0.005 s |
代码语言 | C++ | 内存使用 | 5.74 MiB |
提交时间 | 2022-10-29 16:29:32 | ||
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ // freopen("pow.in","r",stdin); // freopen("pow.out","w",stdout); ll ans=1; int a,b; cin>>a>>b; for(int i=1;i<=b;i++){ ans*=a; } if(ans>=INT_MAX){ cout<<"-1"; }else { cout<<ans; } }