Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
165950 | 王容宇 | 二进制半整数 | C++ | 通过 | 100 | 6 MS | 248 KB | 382 | 2024-08-19 08:26:26 |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for(int i = 1; i<=t; i++) { long long n; cin >> n; int sum = 0; if(n==1) { sum=114514; } while(n!=1) { if(n%2) { sum++; } n/=2; } if(sum<=1) { cout << "yes" << endl; } else { cout << "no" << endl; } } return 0; }