题解
2025-11-28 21:56:51
发布于:湖南
14阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main() {
long long x;
cin >> x;
// 条件:x>0 且 x的二进制只有1个1(x & (x-1) == 0)
if (x > 0 && (x & (x - 1)) == 0) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
这里空空如也




有帮助,赞一个