Language: C++

#include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <climits>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int (i)=1;(i)<=(n);(i)++)

using namespace std;



int main(int argc, char const* argv[])
{
    int N, X, Y;
    cin >> N >> X >> Y;
    std::vector<std::vector<size_t>> adj(N);
    adj[0].push_back(1);
    for(size_t i=1; i<N-1; i++){
        adj[i].push_back(i-1);
        adj[i].push_back(i+1);
    }
    adj[N-1].push_back(N-2);
    adj[X-1].push_back(Y-1);
    adj[Y-1].push_back(X-1);

    std::vector<std::vector<size_t>> costs(N);
    std::vector<std::vector<size_t>> queues(N);
    for(size_t i=0; i<N; i++){
        costs[i] = std::vector<size_t>(N, INT_MAX);
        costs[i][i] = 0;
    }
    for(size_t i=0; i<N; i++){
        queues[i].push_back(i);
    }

    //cout << "costs: " << endl;
    //for(size_t i=0; i<N; i++){
    //    for(size_t j=0; j<N; j++){
    //        cout << costs[i][j] << " ";
    //    }
    //    cout << endl;
    //}
    //cout << "queues: " << endl;
    //for(size_t i=0; i<N; i++){
    //    for(size_t j : queues[i]){
    //        cout << j << " ";
    //    }
    //    cout << endl;
    //}

    for(size_t k=1; k<=N-1; k++){
        size_t count = 0;
        for(size_t i=0; i<N; i++){
            std::vector<size_t> new_queue;
            for(size_t idx : queues[i]){
                for(size_t adj_idx : adj[idx]){
                    if(costs[i][adj_idx] > costs[i][idx]){
                        costs[i][adj_idx] = costs[i][idx] + 1;
                        new_queue.push_back(adj_idx);
                        count++;
                    }
                }
            }
            queues[i] = new_queue.erase(std::unique(new_queue.begin(), new_queue.end()), new_queue.end());
        }

        //cout << "costs: " << endl;
        //for(size_t i=0; i<N; i++){
        //    for(size_t j=0; j<N; j++){
        //        cout << costs[i][j] << " ";
        //    }
        //    cout << endl;
        //}
        //cout << "queues: " << endl;
        //for(size_t i=0; i<N; i++){
        //    for(size_t j : queues[i]){
        //        cout << j << " ";
        //    }
        //    cout << endl;
        //}
        cout << count/2 << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:67:105: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long unsigned int> >, std::vector<long unsigned int> >::value_type' {aka 'std::vector<long unsigned int>'} and 'std::vector<long unsigned int>::iterator')
   67 |             queues[i] = new_queue.erase(std::unique(new_queue.begin(), new_queue.end()), new_queue.end());
      |                                                                                                         ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<long unsigned int>::iterator' to 'const std::vector<long unsigned int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<long unsigned int>::iterator' to 'std::vector<long unsigned int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<long unsigned int>::iterator' to 'std::initializer_list<long unsigned int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~