提交时间:2024-07-31 21:38:33

运行 ID: 159846

# include <bits/stdc++.h> using namespace std ; int main ( ) { int n , cnt = 0 , q ; cin >> q ; while ( q -- ) { cin >> n ; cnt = 0 ; while ( n > 1 ) { if ( n % 2 ) { cnt ++ ; } n >>= 1 ; } if ( n ) { cnt ++ ; } if ( cnt == 2 ) { cout << "yes" << endl ; } else { cout << "no" << endl ; } } return 0 ; }