For this Question: Tom loves Chess boards. He admires its symmetry and how the black and white colors are placed adjacently along both axis.
More formally, a chessboard-like coloring implies that no two adjacent cells have the same color and all the cells are painted either white or black.
On his birthday, Tom has been gifted a board which is in the form of an N*N grid. Every cell is painted either black or white. Since Tom loves the placement of colors in a chessboard, he will try to convert the board that has been gifted to him, identical to a chessboard. He has both black and white colors available to him. Help him find out the minimum number of cells he will have to recolor to paint his board similar to a chessboard.The first line contains an integer N, denoting the size of the board
Each of the next N lines contains N space-separated integers and each integer being either '0' or '1'
'1' represent black cell
'0' represents white cell

Constraints
1 &le; N &le; 1000A single integer that is the minimum number of cells that Tom will have to re-color in his board to convert the given board to a chess board like coloring.Input:
3
1 1 1
1 1 1
1 1 1

Output:
4

<b>Explanation:</b>
Convert to 
1 0 1
0 1 0
1 0 1
Thus he has to color 4 cells., I have written this Solution Code: #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 2e3 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N][N];

signed main() {
	IOS;
	int n;
	cin >> n;
	int c1 = 0, c2 = 0;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			int p;	cin >> p;
			int x = (i+j)&1;
			c1 += (bool)(p == x);
			c2 += (bool)(p != x);
		}
	}
	cout << min(c1, c2);
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?