关于昨晚B
查看原帖
关于昨晚B
362101
_TLEer_的小号楼主2021/5/3 09:12

RT.

请问这样的做法为什么有问题/yiw

code:

#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <cstdio>
#define endl '\n'
#define int long long
using namespace std;
const int MAX = 35;
bool check(int a, int b)
{
   return a > b;
}
signed main()
{
   int t, n, x, tmp;
   cin >> t;
   while (t--)
   {
      tmp = 1;
      cin >> n;
      do
      {
         tmp <<= 1;
      } while (n != tmp && tmp != (1ll << MAX));
      cout << (tmp == (1ll << MAX) ? "NO" : "YES") << endl;
   }
   return 0;
}

Newbie祭(

2021/5/3 09:12
加载中...