Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n , q ;
- cin >> n >> q;
- int a[100];
- for (int i = 0 ; i < n ; i++)
- cin >> a[i];
- int t , x , l , r;
- for (int k = 0 ; k < q ; k++){
- cin >> t;
- if (t == 1){
- cin >> x;
- if (a[x-1] == 0)
- a[x-1] = 1;
- else
- a[x-1] = 0;
- }
- else{
- cin >> l >> r;
- if (a[r-1] == 1)
- cout << "ODD";
- else
- cout << "EVEN";
- cout << endl;
- }
- }
- /*
- // From binary to decimal
- int b[100];
- int nn ;
- cin >> nn;
- for (int i = 0 ; i < n ; i++)
- cin >> b[i];
- int two = 1 , sum = 0;
- for (int i = n - 1 ; i >= 0 ; i--){
- sum += b[i] * two;
- two *= 2;
- }
- cout << sum ;
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement