acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 题解,简洁

    #include<bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; long long result = 1; for (int i = 0; i < b; ++i) { result *= a; if (result > 1e9) { result = -1; break; } } cout << result << endl; return 0; }

    userId_undefined

    ZDZL_いうあ时雨₯

    倔强青铜
    0阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    zsy

    秩序白银
    0阅读
    0回复
    0点赞
  • 简单

    #include <bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if(pow(a,b) > pow(10,9)){ cout<<-1; } else cout<<int(pow(a,b)); }

    userId_undefined

    DST

    倔强青铜
    0阅读
    0回复
    0点赞
  • tj

    userId_undefined

    有事找大号

    秩序白银
    0阅读
    0回复
    0点赞
  • 666

    userId_undefined

    耐高总冠军 张文杰

    倔强青铜
    0阅读
    0回复
    0点赞
  • 题解如下

    #include <iostream> #include<cmath> using namespace std; int main(){ long long a,b,sum=0; cin>>a>>b; if(pow(a,b)>1000000000){ cout<<"-1"; }else{ sum=pow(a,b); cout<<sum; } }

    userId_undefined

    周泽峰

    倔强青铜
    0阅读
    0回复
    0点赞
  • 6

    #include<bits/stdc++.h> using namespace std; int main(){ long long a,b,m,n; n=pow(10,9); cin>>a>>b; m=pow(a,b); if(m>n||m<0){ cout<<-1; }else{ cout<<m; } return 0; }

    userId_undefined

    只莹

    倔强青铜
    0阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    准

    倔强青铜
    0阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    刘鑫昊

    倔强青铜
    0阅读
    0回复
    0点赞
  • sss

    #include<bits/stdc++.h> using namespace std; int main(){ long long a,b,ans=1; cin>>a>>b; for(int i=1;i<=b;i++){ ans*=a; if(ans>1000000000){ cout<<"-1"; return 0; } } cout<<ans; return 0; }

    userId_undefined

    霄

    荣耀黄金
    0阅读
    0回复
    0点赞

共50条

  • 1
  • 2
  • 3
20条/页
跳至页
首页