Language: C++

/**
 *
 * 枝仮全探索：
 *
 * 8×8 のマスから成るチェス盤に、
 * どのクイーンも他のクイーンを襲撃できないように、
 * 8つのクイーンを配置する問題
 *
 * 文字列探索：String Search
 *
 * 計算量：O(n!)
 *
 * 入力例
 * k
 * r1 c1
 * rk ck
 * (※k：クイーン配置数)
 * (※r,c：座標(行番号,列番号))
    2
    2 2
    5 3
 *
 *  出力例：全クイーンの配置（クイーン：Q,それ以外：.）
    ......Q.
    Q.......
    ..Q.....
    .......Q
    .....Q..
    ...Q....
    .Q......
    ....Q...
 *
 */
#include <iostream>
#include <string>
#include <vector>


using namespace std;

const int kRowNum = 8;
const int kColumnNum = 8;
const int kRowBegin = 0;
const int kNotExistQueenInRow = -1;
const int kDiagonalLineNumm = kRowNum + kColumnNum - 1;

class Queen{
// public://forDebug
private:
	//各行において何列目にQが存在するか
	vector<int> col_id_each_row;
	//各縦横列においてQをおけるかどうか
	vector<bool> possible_register_queen_in_column;
	//各斜め列においてQをおけるかどうか
	vector<bool> possible_register_queen_in_plus_diagonal_line;
	//各斜め列においてQをおけるかどうか
	vector<bool> possible_register_queen_in_minus_diagonal_line;
	// bool is_exist_Queen_board[kRowNum][kColumnNum];
public:
	Queen(){
		for (int i = 0; i < kRowNum; i++) {
			col_id_each_row.push_back(kNotExistQueenInRow);
			possible_register_queen_in_column.push_back(true);
		}
		for (int i = 0; i < kDiagonalLineNumm; i++) {
			possible_register_queen_in_plus_diagonal_line.push_back(true);
			possible_register_queen_in_minus_diagonal_line.push_back(true);
		}
		// for (int i = 0; i < kRowNum; i++) {
		// 	for (int j = 0; j < kColumnNum; j++) {
		// 		is_exist_Queen_board[i][j] = false;
		// 	}
		// }
	}
	void InputQueenInfo(const int row_id, const int col_id){
		// is_exist_Queen_board[row_id][col_id] = true;
		col_id_each_row[row_id] = col_id;
		possible_register_queen_in_column[col_id] = false;
		possible_register_queen_in_plus_diagonal_line[row_id+col_id] = false;
		possible_register_queen_in_minus_diagonal_line[row_id-col_id + kRowNum - 1] = false;
	}
	void RegisterQueen(const int row, const int col){
		col_id_each_row[row] = col;
		possible_register_queen_in_column[col] = false;
		possible_register_queen_in_plus_diagonal_line[row + col] = false;
		possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] = false;
	}
	void RemoveQueen(const int row, const int col){
		col_id_each_row[row] = kNotExistQueenInRow;
		possible_register_queen_in_column[col] = true;
		possible_register_queen_in_plus_diagonal_line[row + col] = true;
		possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] = true;
	}
	bool JudgeExistQueenInRow(const int row) const{ 
		if(col_id_each_row[row] != kNotExistQueenInRow) {
			return true;
		}
		return false;
	}
	bool IsAttackedFromOtherQueen(const int row, const int col) const{
		if (possible_register_queen_in_column[col] == false || possible_register_queen_in_plus_diagonal_line[row + col] == false
				|| possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] == false){
			return true;
		}
		return false;
	}
	void PrintBoard() const{
	for (int row = 0; row < kRowNum; row++) {
		for (int col = 0; col < kColumnNum; col++) {
			if(col_id_each_row[row] == col){
				cout << "Q";
			}
			else{
				cout << ".";
			}
		}
		cout << endl;
	}
}
};

void Input(Queen* queen);
void recursive(Queen update_queen, Queen* output_queen, int row);

void Input(Queen* queen) {
	int placementNum;
	cin >> placementNum;
	for (int i = 0; i < placementNum; i++) {
		int row_id;
		int col_id;
		cin >> row_id >> col_id;
		(*queen).InputQueenInfo(row_id,col_id);
	}
}


// static int cnt_debug = 1;

// void PrintForDebug(const Queen& queen){
// 	cout << cnt_debug++ << "回目" << endl;

// 	cout << "row : ";
// 	for (int i = 0; i < kRowNum; i++) {
// 		cout << queen.col_id_each_row[i] << " ";
// 	}
// 	cout << endl;
// 	cout << "col  : ";
// 	for (int i = 0; i < kRowNum; i++) {
// 		cout << queen.possible_register_queen_in_column[i] << " ";
// 	}
// 	cout << endl;
// 	cout << "dpos  : ";
// 	for (int i = 0; i < 2 * kRowNum - 1; i++) {
// 		cout << queen.possible_register_queen_in_plus_diagonal_line[i] << " ";
// 	}
// 	cout << endl;
// 	cout << endl;
// 	cout << "possible_register_queen_in_minus_diagonal_line  : ";
// 	for (int i = 0; i < 2 * kRowNum - 1; i++) {
// 		cout << queen.possible_register_queen_in_minus_diagonal_line[i] << " ";
// 	}
// 	cout << endl;

// 	cout << "+-+-+-+-+-+-+-+-+" << endl;
// 	for (int y = 0; y < kRowNum; y++){
// 		for (int x = 0; x < kColumnNum; x++){
// 			if(queen.col_id_each_row[y] == x){
// 				printf("|Q");
// 			}
// 			else{
// 				printf("| ");
// 			}
// 		}
// 		printf("|\n");
// 		cout << "+-+-+-+-+-+-+-+-+" << endl;
// 	}
// }

void recursive(Queen update_queen, Queen* output_queen, int row) {
	// クイーンの配置に成功
	// PrintForDebug(update_queen);
	if (row == kRowNum) {
		*output_queen = update_queen;
		return;
	}

	if(update_queen.JudgeExistQueenInRow(row)){
		// 次の行を試す
		recursive(update_queen, output_queen, row + 1);
		return;
	}

	for (int col = 0; col < kColumnNum; col++) {
		// (i, j) が他のクイーンに襲撃される場合はそこに置かず次の列を試行
		if (update_queen.IsAttackedFromOtherQueen(row,col)){
			continue;
		}
		// (i, j) にクイーンを配置する
		update_queen.RegisterQueen(row, col);
		// 次の行を試す
		recursive(update_queen, output_queen, row + 1);
		// (i, j) に配置されているクイーンを取り除く
		update_queen.RemoveQueen(row, col);

	}
	// クイーンの配置に失敗
}

int main(){
	/**********initialize**********/
	Queen input_queen;
    Input(&input_queen);

	/**********calc**********/
    Queen update_queen = input_queen;
    Queen output_queen;
    recursive(update_queen, &output_queen, kRowBegin);

	/**********output**********/
    output_queen.PrintBoard();
    return 0;
}
/**
 *
 * 枝仮全探索：
 *
 * 8×8 のマスから成るチェス盤に、
 * どのクイーンも他のクイーンを襲撃できないように、
 * 8つのクイーンを配置する問題
 *
 * 文字列探索：String Search
 *
 * 計算量：O(n!)
 *
 * 入力例
 * k
 * r1 c1
 * rk ck
 * (※k：クイーン配置数)
 * (※r,c：座標(行番号,列番号))
    2
    2 2
    5 3
 *
 *  出力例：全クイーンの配置（クイーン：Q,それ以外：.）
    ......Q.
    Q.......
    ..Q.....
    .......Q
    .....Q..
    ...Q....
    .Q......
    ....Q...
 *
 */
#include <iostream>
#include <string>
#include <vector>

using namespace std;
const int kRowNum = 8;
const int kColumnNum = 8;
const int kRowBegin = 0;
const int kNotExistQueenInRow = -1;
const int kDiagonalLineNumm = kRowNum + kColumnNum - 1;

struct Queen{
	//各行において何列目にQが存在するか
	int col_id_each_row[kRowNum];
	//各列においてQをおけるかどうか
	bool possible_register_queen_in_column[kColumnNum];
	bool possible_register_queen_in_plus_diagonal_line[kDiagonalLineNumm];
	bool possible_register_queen_in_minus_diagonal_line[kDiagonalLineNumm];

	bool is_exist_Queen_board[kRowNum][kColumnNum];
};

void initialize(Queen* queen);
void Input(Queen* queen);
void Recursive(Queen update_queen, Queen* output_queen, int row);
void PrintBoard(const Queen& queen) ;


void Input(Queen* queen) {
	int placementNum;
	cin >> placementNum;
	for (int i = 0; i < placementNum; i++) {
		int row_id;
		int col_id;
		cin >> row_id >> col_id;
		queen->is_exist_Queen_board[row_id][col_id] = true;
		queen->col_id_each_row[row_id] = col_id;
		queen->possible_register_queen_in_column[col_id] = false;
		queen->possible_register_queen_in_plus_diagonal_line[row_id+col_id] = false;
		queen->possible_register_queen_in_minus_diagonal_line[row_id-col_id + kRowNum - 1] = false;
	}
}
void initialize(Queen* queen) {
	for (int i = 0; i < kRowNum; i++) {
		queen->col_id_each_row[i] = kNotExistQueenInRow;
		queen->possible_register_queen_in_column[i] = true;
	}
	for (int i = 0; i < kDiagonalLineNumm; i++) {
		queen->possible_register_queen_in_plus_diagonal_line[i] = true;
		queen->possible_register_queen_in_minus_diagonal_line[i] = true;
	}
	for (int i = 0; i < kRowNum; i++) {
		for (int j = 0; j < kColumnNum; j++) {
			queen->is_exist_Queen_board[i][j] = false;
		}
	}
}

static int cnt_debug = 1;
void PrintForDebug(const Queen& queen){
	cout << cnt_debug++ << "回目" << endl;

	cout << "row : ";
	for (int i = 0; i < kRowNum; i++) {
		cout << queen.col_id_each_row[i] << " ";
	}
	cout << endl;
	cout << "col  : ";
	for (int i = 0; i < kColumnNum; i++) {
		cout << queen.possible_register_queen_in_column[i] << " ";
	}
	cout << endl;
	cout << "dpos  : ";
	for (int i = 0; i < 2 * kRowNum - 1; i++) {
		cout << queen.possible_register_queen_in_plus_diagonal_line[i] << " ";
	}
	cout << endl;
	cout << endl;
	cout << "minus_diagonal_line  : ";
	for (int i = 0; i < 2 * kRowNum - 1; i++) {
		cout << queen.possible_register_queen_in_minus_diagonal_line[i] << " ";
	}
	cout << endl;


	cout << "+-+-+-+-+-+-+-+-+" << endl;
	for (int y = 0; y < kRowNum; y++){
		for (int x = 0; x < kColumnNum; x++){
			if(queen.col_id_each_row[y] == x){
				printf("|Q");
			}
			else{
				printf("| ");
			}
		}
		printf("|\n");
		cout << "+-+-+-+-+-+-+-+-+" << endl;
	}
}

void PrintBoard(const Queen& queen) {
	for (int row = 0; row < kRowNum; row++) {
		for (int col = 0; col < kColumnNum; col++) {
			if(queen.col_id_each_row[row] == col){
				cout << "Q";
			}
			else{
				cout << ".";
			}
		}
		cout << endl;
	}
}
void RegisterQueen(Queen* queen, const int row, const int col){
	queen->col_id_each_row[row] = col;
	queen->possible_register_queen_in_column[col] = false;
	queen->possible_register_queen_in_plus_diagonal_line[row + col] = false;
	queen->possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] = false;
}

void RemoveQueen(Queen* queen, const int row, const int col){
	queen->col_id_each_row[row] = kNotExistQueenInRow;
	queen->possible_register_queen_in_column[col] = true;
	queen->possible_register_queen_in_plus_diagonal_line[row + col] = true;
	queen->possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] = true;
}

void Recursive(Queen update_queen, Queen* output_queen, int row) {
//	PrintForDebug(update_queen);
	// クイーンの配置に成功
	if (row == kRowNum) {
		*output_queen = update_queen;
		return;
	}

	if(update_queen.col_id_each_row[row] != kNotExistQueenInRow){
		// 次の行を試す
		Recursive(update_queen, output_queen, row + 1);
		return;
	}

	for (int col = 0; col < kColumnNum; col++) {
		// (i, j) が他のクイーンに襲撃されている場合は無視
		if (update_queen.possible_register_queen_in_column[col] == false
				|| update_queen.possible_register_queen_in_plus_diagonal_line[row + col] == false
				|| update_queen.possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] == false){
			continue;
		}
		// (i, j) にクイーンを配置する
		RegisterQueen(&update_queen, row, col);
		// 次の行を試す
		Recursive(update_queen, output_queen, row + 1);
		// (i, j) に配置されているクイーンを取り除く
		RemoveQueen(&update_queen, row, col);
	}
	// クイーンの配置に失敗
}


int main(){
	/**********initialize**********/
	Queen input_queen;
    initialize(&input_queen);
    Input(&input_queen);

	/**********calc**********/
    Queen update_queen = input_queen;
    Queen output_queen;
    Recursive(update_queen, &output_queen, kRowBegin);

	/**********output**********/
    PrintBoard(output_queen);
    return 0;
}


Compiler output:
a.cc:261:11: error: redefinition of 'const int kRowNum'
  261 | const int kRowNum = 8;
      |           ^~~~~~~
a.cc:41:11: note: 'const int kRowNum' previously defined here
   41 | const int kRowNum = 8;
      |           ^~~~~~~
a.cc:262:11: error: redefinition of 'const int kColumnNum'
  262 | const int kColumnNum = 8;
      |           ^~~~~~~~~~
a.cc:42:11: note: 'const int kColumnNum' previously defined here
   42 | const int kColumnNum = 8;
      |           ^~~~~~~~~~
a.cc:263:11: error: redefinition of 'const int kRowBegin'
  263 | const int kRowBegin = 0;
      |           ^~~~~~~~~
a.cc:43:11: note: 'const int kRowBegin' previously defined here
   43 | const int kRowBegin = 0;
      |           ^~~~~~~~~
a.cc:264:11: error: redefinition of 'const int kNotExistQueenInRow'
  264 | const int kNotExistQueenInRow = -1;
      |           ^~~~~~~~~~~~~~~~~~~
a.cc:44:11: note: 'const int kNotExistQueenInRow' previously defined here
   44 | const int kNotExistQueenInRow = -1;
      |           ^~~~~~~~~~~~~~~~~~~
a.cc:265:11: error: redefinition of 'const int kDiagonalLineNumm'
  265 | const int kDiagonalLineNumm = kRowNum + kColumnNum - 1;
      |           ^~~~~~~~~~~~~~~~~
a.cc:45:11: note: 'const int kDiagonalLineNumm' previously defined here
   45 | const int kDiagonalLineNumm = kRowNum + kColumnNum - 1;
      |           ^~~~~~~~~~~~~~~~~
a.cc:267:8: error: redefinition of 'struct Queen'
  267 | struct Queen{
      |        ^~~~~
a.cc:47:7: note: previous definition of 'struct Queen'
   47 | class Queen{
      |       ^~~~~
a.cc:284:6: error: redefinition of 'void Input(Queen*)'
  284 | void Input(Queen* queen) {
      |      ^~~~~
a.cc:125:6: note: 'void Input(Queen*)' previously defined here
  125 | void Input(Queen* queen) {
      |      ^~~~~
a.cc: In function 'void Input(Queen*)':
a.cc:291:24: error: 'struct Queen' has no member named 'is_exist_Queen_board'
  291 |                 queen->is_exist_Queen_board[row_id][col_id] = true;
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc:292:24: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  292 |                 queen->col_id_each_row[row_id] = col_id;
      |                        ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc:293:24: error: 'std::vector<bool> Queen::possible_register_queen_in_column' is private within this context
  293 |                 queen->possible_register_queen_in_column[col_id] = false;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:22: note: declared private here
   53 |         vector<bool> possible_register_queen_in_column;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:294:24: error: 'std::vector<bool> Queen::possible_register_queen_in_plus_diagonal_line' is private within this context
  294 |                 queen->possible_register_queen_in_plus_diagonal_line[row_id+col_id] = false;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:55:22: note: declared private here
   55 |         vector<bool> possible_register_queen_in_plus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:295:24: error: 'std::vector<bool> Queen::possible_register_queen_in_minus_diagonal_line' is private within this context
  295 |                 queen->possible_register_queen_in_minus_diagonal_line[row_id-col_id + kRowNum - 1] = false;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:57:22: note: declared private here
   57 |         vector<bool> possible_register_queen_in_minus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void initialize(Queen*)':
a.cc:300:24: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  300 |                 queen->col_id_each_row[i] = kNotExistQueenInRow;
      |                        ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc:301:24: error: 'std::vector<bool> Queen::possible_register_queen_in_column' is private within this context
  301 |                 queen->possible_register_queen_in_column[i] = true;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:22: note: declared private here
   53 |         vector<bool> possible_register_queen_in_column;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:304:24: error: 'std::vector<bool> Queen::possible_register_queen_in_plus_diagonal_line' is private within this context
  304 |                 queen->possible_register_queen_in_plus_diagonal_line[i] = true;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:55:22: note: declared private here
   55 |         vector<bool> possible_register_queen_in_plus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:305:24: error: 'std::vector<bool> Queen::possible_register_queen_in_minus_diagonal_line' is private within this context
  305 |                 queen->possible_register_queen_in_minus_diagonal_line[i] = true;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:57:22: note: declared private here
   57 |         vector<bool> possible_register_queen_in_minus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:309:32: error: 'struct Queen' has no member named 'is_exist_Queen_board'
  309 |                         queen->is_exist_Queen_board[i][j] = false;
      |                                ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void PrintForDebug(const Queen&)':
a.cc:320:31: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  320 |                 cout << queen.col_id_each_row[i] << " ";
      |                               ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc:325:31: error: 'std::vector<bool> Queen::possible_register_queen_in_column' is private within this context
  325 |                 cout << queen.possible_register_queen_in_column[i] << " ";
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:22: note: declared private here
   53 |         vector<bool> possible_register_queen_in_column;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:330:31: error: 'std::vector<bool> Queen::possible_register_queen_in_plus_diagonal_line' is private within this context
  330 |                 cout << queen.possible_register_queen_in_plus_diagonal_line[i] << " ";
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:55:22: note: declared private here
   55 |         vector<bool> possible_register_queen_in_plus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:336:31: error: 'std::vector<bool> Queen::possible_register_queen_in_minus_diagonal_line' is private within this context
  336 |                 cout << queen.possible_register_queen_in_minus_diagonal_line[i] << " ";
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:57:22: note: declared private here
   57 |         vector<bool> possible_register_queen_in_minus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:344:34: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  344 |                         if(queen.col_id_each_row[y] == x){
      |                                  ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc: In function 'void PrintBoard(const Queen&)':
a.cc:359:34: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  359 |                         if(queen.col_id_each_row[row] == col){
      |                                  ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc: In function 'void RegisterQueen(Queen*, int, int)':
a.cc:370:16: error: 'std::vector<int> Queen::col_id_each_row' is private within this context
  370 |         queen->col_id_each_row[row] = col;
      |                ^~~~~~~~~~~~~~~
a.cc:51:21: note: declared private here
   51 |         vector<int> col_id_each_row;
      |                     ^~~~~~~~~~~~~~~
a.cc:371:16: error: 'std::vector<bool> Queen::possible_register_queen_in_column' is private within this context
  371 |         queen->possible_register_queen_in_column[col] = false;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:22: note: declared private here
   53 |         vector<bool> possible_register_queen_in_column;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:372:16: error: 'std::vector<bool> Queen::possible_register_queen_in_plus_diagonal_line' is private within this context
  372 |         queen->possible_register_queen_in_plus_diagonal_line[row + col] = false;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:55:22: note: declared private here
   55 |         vector<bool> possible_register_queen_in_plus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:373:16: error: 'std::vector<bool> Queen::possible_register_queen_in_minus_diagonal_line' is private within this context
  373 |         queen->possible_register_queen_in_minus_diagonal_line[row - col + kRowNum - 1] = false;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:57:22: note: declared private here
   57 |         vector<bool> possible_register_queen_in_minus_diagonal_line;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void RemoveQueen(Queen*, int, int)':
a.cc:377:16: error: 'std::vector<int> Queen::col_id_each_row' is private within this context