Advertisement
a53

game1

a53
Mar 11th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int T,G,n;
  7. cin>>T>>G;
  8. while(G--)
  9. {
  10. cin>>n;
  11. int p=0;
  12. while(n%2==0)
  13. ++p,n/=2;
  14. if(T==1)
  15. if(p%2)
  16. cout<<0<<'\n';
  17. else
  18. cout<<1<<'\n';
  19. else
  20. if((n==1&&p%2)||(n>=3&&p%2==0))
  21. cout<<1<<'\n';
  22. else
  23. cout<<0<<'\n';
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement