SHARE
TWEET

game1

a53 Apr 19th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int T,G,i,n,p2;
  7.     bool a[2000003];
  8.     cin>>T>>G;
  9.     for (i=1;i<=G;i++)
  10.     {
  11.         cin>>n;
  12.         p2=0;
  13.         while (n%2==0)
  14.         {
  15.             p2++;
  16.             n/=2;
  17.         }
  18.         if (n>1)
  19.             if(p2%2)
  20.                 cout<<0<<endl;
  21.             else
  22.                 cout<<1<<endl;
  23.         else
  24.             if (T==1)
  25.                 if(p2%2)
  26.                     cout<<0<<endl;
  27.                 else
  28.                     cout<<1<<endl;
  29.             else
  30.                 if(p2%2)
  31.                     cout<<1<<endl;
  32.                 else
  33.                     cout<<0<<endl;
  34.     }
  35.     return 0;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top