제출 #290481

#제출 시각아이디문제언어결과실행 시간메모리
290481matheo_apdChessboard (IZhO18_chessboard)C++17
컴파일 에러
0 ms0 KiB
#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)
		chess[i][j] = 1;
	}
	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;
}

컴파일 시 표준 에러 (stderr) 메시지

chessboard.cpp: In function 'int main()':
chessboard.cpp:12:12: error: 'j' was not declared in this scope
   12 |   chess[i][j] = 1;
      |            ^