Created
September 6, 2017 07:30
-
-
Save LightBells/2b155d70aaa6ad988aa1c1abafc3537a to your computer and use it in GitHub Desktop.
This file contains 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; | |
char px[1000][1001];int n; | |
bool issymmetry();void diff(int,int); | |
int main(void){ int c,count=0; cin >> c >> n; for(int i=0;i<n;i++) cin >> px[i]; for(int i=0;i<c;i++){ int d; cin >> d; for(int j=0;j<d && i!=0;j++){ int x,y; cin >> y >> x; px[y-1][x-1] = (px[y-1][x-1]=='0')?'1':'0'; } count+=issymmetry(); } cout << count << endl;} | |
bool issymmetry(){ for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(px[i][j]!=px[i][(n-1)-j]) return false; if(px[(n-1)-i][j]!=px[i][j]) return false; } } return true;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment