C++ | Leetcode C++题解之第231题2的幂

题目:

题解:

class Solution {
private:
    static constexpr int BIG = 1 << 30;

public:
    bool isPowerOfTwo(int n) {
        return n > 0 && BIG % n == 0;
    }
};

相关推荐

  1. Leetcode | 231. 2 C语言

    2024-07-13 09:26:05       50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 09:26:05       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 09:26:05       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 09:26:05       57 阅读
  4. Python语言-面向对象

    2024-07-13 09:26:05       68 阅读

热门阅读

  1. 封装图片压缩

    2024-07-13 09:26:05       21 阅读
  2. 为什么文件需要校验MD5?

    2024-07-13 09:26:05       23 阅读
  3. STL内建仿函数

    2024-07-13 09:26:05       22 阅读
  4. 开源 Wiki 系统 InfoSphere 2024.01.1 发布

    2024-07-13 09:26:05       29 阅读
  5. macOS 的电源适配器设置

    2024-07-13 09:26:05       25 阅读
  6. PTA 7-14 畅通工程之局部最小花费问题

    2024-07-13 09:26:05       27 阅读
  7. Vue单路由的独享守卫怎么设置

    2024-07-13 09:26:05       26 阅读
  8. 代码随想录算法训练营第33天

    2024-07-13 09:26:05       25 阅读