acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
登录
注册
题目详情提交记录(0)
  • 嗯

    userId_undefined

    188****7602

    0阅读
    0回复
    0点赞
  • 题解

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

    userId_undefined

    🐒🐒🐒🐒🐒🐒🐒🐒

    时间刺客空间掌握者时空双修者秩序白银
    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点赞
  • 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点赞

共69条

  • 1
  • 2
  • 3
  • 4
20条/页
跳至页
暂无数据

提交答案之后,这里将显示提交结果~

首页