提交时间:2024-08-19 11:18:58

运行 ID: 166311

#include <bits/stdc++.h> int main() { int t; long long n; scanf("%d",&t); while(t--){ scanf("%lld",&n); while(!(n&1)) n>>=1; // n=2^i + 2^j = 2^i(1 + 2^(j-i)),先去除2^i n--; // 剩余的数-1 if(!(n&(n-1))) printf("yes\n"); // 判断剩余的数-1后2^(j-i),是否为2的整数幂 else printf("no\n"); } return 0; }