Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
150144 | Microsoft | 二进制半整数 | C++ | 解答错误 | 40 | 72 MS | 268 KB | 656 | 2024-06-01 15:56:50 |
#include <iostream> #include <cmath> using namespace std; bool man(int n) { if ((n & (n - 1)) == 0) { return true; } int i = 1; while (pow(2, i) <= n) { int j = i + 1; while (pow(2, j) <= n) { if (pow(2, i) + pow(2, j) == n) { return true; } j++; } i++; } return false; } int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (man(n)) { cout << "yes" << endl; } else { cout << "no" << endl; } } return 0; }