Created
May 7, 2012 00:29
-
-
Save rvivek/2625141 to your computer and use it in GitHub Desktop.
Dots and Boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
#define odd(x) (x&1) | |
#define even(x) (!(x&1)) | |
int main(){ | |
int x; | |
cin >> x; | |
int n =11; | |
int a[n][n]; | |
for(int i=0;i<n;i++) | |
for(int j=0;j<n;j++) | |
cin >> a[i][j]; | |
for(int i=n-1;i>=0;i--) | |
for(int j=n-1;j>=0;j--){ | |
int tmp = a[i][j]; | |
if((odd(i) && even(j)) || (even(i) && odd(j))) | |
if(tmp == 0){ | |
cout << i << " " << j << "\n"; | |
return 0; | |
} | |
} | |
cout << "0 1\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment