Created
June 2, 2014 07:14
-
-
Save math314/03b705f9d9eac779362e to your computer and use it in GitHub Desktop.
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
2 4 | |
XXXX | |
XOOO | |
4 4 | |
XXXX | |
OOOO | |
XXXX | |
OOOO | |
-1 -1 |
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 <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int h,w; | |
while(cin>>h>>w,h!= -1){ | |
vector<string> vs(h); | |
for(int i = 0; i < h; i++) cin>>vs[i]; | |
vector<vector<int> > peke(h,vector<int>(w)); | |
vector<int> rows(h),cols(w); | |
for(int i = 0; i < h; i++){ | |
for(int j = 0; j < w; j++){ | |
if(vs[i][j] == 'O') continue; | |
peke[i][j] ^= 1; | |
rows[i] ^= 1; | |
cols[j] ^= 1; | |
} | |
} | |
for(int i = 0; i < h; i++){ | |
for(int j = 0; j < w; j++){ | |
if(peke[i][j] ^ rows[i] ^ cols[j]) printf("%d %d\n",i,j); | |
} | |
} | |
puts(""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment