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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 正经题解|N - 立方数

    题目分析 对 NNN 开三次根,若求得的数为整数,则是立方数。 可以用函数 cbrt,开三次根,已在 c++11中支持。 或者使用 pow 函数,求 N13N ^ {\frac{1}{3}}N31 。 AC 代码 复杂度分析 O(1)O(1)O(1)

    userId_undefined

    AC君

    管理员
    倔强青铜
    77阅读
    0回复
    4点赞
  • 简单题解

    用cbrt(开立方)和pow(幂)就可以

    userId_undefined

    qi

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

    #include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long ll; const int N = 1e5 + 10; int t,n,m; int main() { ios::sync_with_stdio(false); cin >> n; int k = cbrt(n); if (k * k * k == n) { cout << "YES" << endl; }else { cout << "NO" << endl; } return 0; }

    userId_undefined

    郭恒驿

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

    userId_undefined

    有事找大号

    秩序白银
    4阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    LS_YZY

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

    userId_undefined

    zsy

    秩序白银
    0阅读
    0回复
    0点赞
首页