Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
166340 C班-陈乐 二进制半整数 C++ 解答错误 0 5 MS 248 KB 556 2024-08-19 13:46:19

Tests(0/5):


#include <iostream> using namespace std; int main() { int t,cnt = 0; long long n; cin >> t; while (t --) { cnt = 0; cin >> n; if (n % 2 != 0 || n < 4) { cout << "No" << endl; continue; } for (int i = 0 ; i < 64 ; i ++) { n >>= 1; if (n & 1) cnt ++; } if (cnt == 2 || cnt == 1) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }


测评信息: