#include<stdio.h> int main(){ long long num;//要判断的数 int m; int count; scanf("%d",&m); for(int i=0; i<m; i++){//m行数 scanf("%lld",&num); //是2的幂次方只有两个条件,1:大于0 2:二进制只有一个1,因此一旦减1比为0 if((num&(num-1))== 0 && num>0) printf("YES\n"); else printf("NO\n"); } }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account