Language: C++

#include <iostream>
#include <vector>
#include <queue>

using namespace std;

class Board{
    public:
        Board(int n){
            vector<char> tmp;
            for(int i=0;i<n;i++){
                tmp.push_back('#');
            }
            for(int i=0;i<n;i++){
                board.push_back(tmp);
            }
            cost = 0;
            size = n;
        }
        vector<vector<char> > board;
        int getNumBlack() const{
            int count = 0;
            for(int i=0;i<size;i++){
                for(int j=0;j<size;j++){
                    if(board[i][j] == '#')
                        count++;
                }
            }
            return count;
        }
        int getWhite() const{
            return size*size - getNumBlack();
        }

        int whiteColumn() const{
            int count = 0;
            for(int i=0;i<size;i++){
                bool flag = false;
                for(int j=0;j<size;j++){
                    if(board[j][i] == '.')
                        flag = true;
                }
                if(flag)
                    count++;
            }
            return count;
        }

        int eval() const{
            /* return cost + getWhite(); */
            return cost + whiteColumn();
        }
        int size;
        int cost;
        Board change(int i, int j){
            Board newOne(size);
            for(int k=0;k<size;k++){
                for(int l=0;l<size;l++){
                    newOne.board[k][l] = this->board[k][l];
                }
            }
            vector<char> tmp;
            for(int k=0;k<size;k++){
                tmp.push_back(this->board[i][k]);
            }
            for(int k=0;k<size;k++){
                newOne.board[k][j] = tmp[k];
            }
            newOne.cost = this->cost + 1;
            return newOne;
        }
        bool goal(){
            return getNumBlack() == size*size;
        }
        void print(){
            for(int i=0;i<size;i++){
                for(int j=0;j<size;j++){
                    cout << board[i][j];
                }
                cout << endl;
            }
            cout << endl;
        }
};

bool operator<(const Board& ls, const Board& rs){
    return ls.eval() < rs.eval();
}
bool operator>(const Board& ls, const Board& rs){
    return ls.eval() > rs.eval();
}

bool same(Board b1, Board b2){
    for(int i=0;i<b1.size;i++){
        for(int j=0;j<b1.size;j++){
            if(b1.board[i][j] != b2.board[i][j])
                return false;
        }
    }
    return true;
}

bool exist(vector<Board> v, Board b){
    if (v.size() == 0)
        return false;
    for(int i=0;i<v.size();i++){
        for(int j=0;j<b.size;j++){
            for(int k=0;k<b.size;k++){
                if(v[i].board[j][k] != b.board[j][k])
                    return false;
            }
        }
    }
    return true;
}

int astar(priority_queue<Board,vector<Board>, greater<Board> > openList, vector<Board> closedList){
    while(!openList.empty()){
        Board b = openList.top();
        /* b.print(); */
        openList.pop();
        if (b.goal())
            return b.cost;
        else{
            for(int i=0;i<b.size;i++){
                for(int j=0;j<b.size;j++){
                    Board newOne = b.change(i,j);
                    //closedList check
                    if ((!same(b,newOne)) &&(!exist(closedList, newOne)) ){
                        openList.push(newOne);
                        closedList.push_back();
                    }
                }
            }
            closedList.push_back(b);
        }
    }
    return -1;
}



int main(){
    int n; cin >> n;
    char c;
    Board b(n);
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin >> c;
            b.board[i][j] = c;
        }
    }
    priority_queue<Board, vector<Board>, greater<Board> > openList;
    vector<Board> closedList;
    openList.push(b);
    cout << astar(openList, closedList) << endl;
}


Compiler output:
a.cc: In function 'int astar(std::priority_queue<Board, std::vector<Board>, std::greater<Board> >, std::vector<Board>)':
a.cc:131:45: error: no matching function for call to 'std::vector<Board>::push_back()'
  131 |                         closedList.push_back();
      |                         ~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Board; _Alloc = std::allocator<Board>; value_type = Board]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = Board; _Alloc = std::allocator<Board>; value_type = Board]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 0 provided