Skip to content

Instantly share code, notes, and snippets.

@math314
Created June 2, 2014 07:14
Show Gist options
  • Save math314/03b705f9d9eac779362e to your computer and use it in GitHub Desktop.
Save math314/03b705f9d9eac779362e to your computer and use it in GitHub Desktop.
2 4
XXXX
XOOO
4 4
XXXX
OOOO
XXXX
OOOO
-1 -1
#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