Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
165991 AX龙神 整数幂 C++ 通过 100 4 MS 244 KB 486 2024-08-19 09:02:34

Tests(4/4):


#include <bits/stdc++.h> using namespace std; int n, a[1100]; int main(){ cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i]; } for(int i = 1; i <= n; i++){ int p = 1; while(a[i] != 0){ if(a[i] % 2 != 0){ p = 0; break; } else if(a[i] == 2){ break; } a[i] = a[i] / 2; } if(a[i] == 1){ cout << "Yes" << endl; } else if(p == 1){ cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }


测评信息: