Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int T,G,i,n,p2;
- bool a[2000003];
- cin>>T>>G;
- for (i=1;i<=G;i++)
- {
- cin>>n;
- p2=0;
- while (n%2==0)
- {
- p2++;
- n/=2;
- }
- if (n>1)
- if(p2%2)
- cout<<0<<endl;
- else
- cout<<1<<endl;
- else
- if (T==1)
- if(p2%2)
- cout<<0<<endl;
- else
- cout<<1<<endl;
- else
- if(p2%2)
- cout<<1<<endl;
- else
- cout<<0<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement