Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <cstring>#include <cstdio>#include <algorithm>typedef long long ll;#define FOR(begin,end) for(int i = begin; i < end; ++i)using namespace std;char mp[1100][1100];char tmp[1100][1100];inline int GetBit(char n ){return n-'0';}inline bool judge(char a[1100][1100], int rb,int re,int cb,int ce){for(int i = rb; i < re; ++i)for(int j = cb; j < ce; ++j){if(j > cb && GetBit(a[i][j]) == GetBit(a[i][j-1]))return false;if(i > rb && GetBit(a[i-1][j]) == GetBit(a[i][j]))return false;}return true;}int main(){int N,M;//freopen("/Users/user/Desktop/1.txt","r",stdin);cin >> N >> M;for(int i = 0; i < N; ++i)for(int j = 0; j < M; ++j)cin >> mp[i][j];