NotAlpha102

Incredible Chess

Mar 23rd, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define nl "\n"
  4. main()
  5. {
  6.  
  7.     ios_base::sync_with_stdio(false);
  8.     cin.tie(NULL);
  9.     int test, ind=1;
  10.     cin>>test;
  11.     while(ind<=test)
  12.     {
  13.         long long int n, i, checker=0;
  14.         cin>>n;
  15.         long long int arr1[n], arr2[n];
  16.         for(i=0; i<n; i++)
  17.             {
  18.                 cin>>arr1[i];
  19.                 cin>>arr2[i];
  20.             }
  21.         for(i=0; i<n; i++)
  22.         {
  23.             checker^=abs(arr1[i]-arr2[i]-1)%2;
  24.         }
  25. //        cout<<checker<<nl;
  26.         if(checker)
  27.             cout<<"Case "<<ind<<": "<<"white wins"<<nl;
  28.         else
  29.             cout<<"Case "<<ind<<": "<<"black wins"<<nl;
  30.         ind++;
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment