Advertisement
Saleh127

hackerearcth Binary Queries

Sep 29th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. ll a[1000005];
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(0);
  9. cin.tie(0);cout.tie(0);
  10.  
  11. ll c,d,e,f,i,j,k,l;
  12. cin>>c>>d;
  13. for(i=1;i<=c;i++)
  14. {
  15. cin>>a[i];
  16. }
  17. while(d--)
  18. {
  19. cin>>e;
  20. if(e==0)
  21. {
  22. cin>>f>>j;
  23. if(a[j]==0) cout<<"EVEN"<<endl;
  24. else cout<<"ODD"<<endl;
  25. }
  26. else
  27. {
  28. cin>>f;
  29. if(a[f]==0) a[f]=1;
  30. else a[f]=0;
  31. }
  32. }
  33.  
  34. return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement