답안 #290477

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
290477 2020-09-03T21:43:43 Z matheo_apd Chessboard (IZhO18_chessboard) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define maxn 105
int chess[maxn][maxn];
int main(){
	int n, k;
	cin >> n >> k;
	for(int i = 0; i < k; i++){
		int x, y;
		cin >> x >> y;
		cin >> x >> y; //8)
		
	}
	int cont_errado = 0;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
			if(i+j)&2 == chess[i][j]) cont_errado++;
	cout << min(cont_errado, n*n - cont_errado) << endl;
	return 0;
}

Compilation message

chessboard.cpp: In function 'int main()':
chessboard.cpp:17:12: error: lvalue required as unary '&' operand
   17 |    if(i+j)&2 == chess[i][j]) cont_errado++;
      |            ^