Just-a-programmer

Laser tag

Aug 14th, 2020
1,420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     ios_base::sync_with_stdio(0);
  6.     cin.tie(0); cout.tie(0);
  7.     int n,x;
  8.     cin>>n>>x;
  9.     x*=2;
  10.     int mnm=ceil(log2(double(n)));
  11.     cout<<((mnm<=x)?1:0)<<"\n";
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment