Advertisement
a53

game1

a53
Apr 19th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement