Source Code
#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 7;
int n , m, k;

int a[2] ; 

int main()
{
       ios_base::sync_with_stdio(0);
       cin.tie(0);
#ifndef ONLINE_JUDGE
#endif
       cin >> n >> m >> k; 
       int sum = 0 ; 
       for(int i = 0 ;i < n; ++ i){
              int x, y;  cin >> x >> y; 
              a[(x%2 + y%2)%2] ++ ; 
              sum+= x&1 ; 
              sum&=1;
       }
       
       if(a[0] && a[1]){
              if(m&1)cout<< 1 ; else cout << 2;  
       }else if(a[0]){
              if(k == sum)cout << 1 ; else cout << 2; 
       }else{
              sum = (sum + m) & 1; 
              if(k == sum)cout<< 1; else cout << 2; 
       }

       return 0;
}
Copy
Always with Me, Always with You Mohamed.Sobhy
GNU G++17
0 ms
360 KB
Wrong Answer