Language: C++

#include <bits/stdc++.h>
#define INF 10000

using namespace std;

int main() {
  int n, x, y;
  cin >> n >> x >> y;
  x--; y--;
  vector<int> ans(n);
  for (int i=0; i<n; i++) {
  	vector<int> dis(n);
    for (int i=0; i<n; i++) dis[i] = INF;
    queue<int> q(n);
    auto push = [&](int ind, int d) {
    	if (dis[ind]!=INF) return;
      	dis[ind] = d;
      	q.push(ind);
    }
    push(i,0);
    while (!q.empty()) {
    	int temp = q.pop();
      	if (temp+1<n) push(temp+1, dis[temp]+1);
      	if (temp-1>0) push(temp-1, dis[temp]+1);
      	if (temp==x) push(y,dis[temp]+1);
      	if (temp==y) push(x,dis[temp]+1);
    }
   	for (int i=0; i<n; i++) ans[dis[i]]++;
  }
  for (int i=1; i<n; i++) ans[i] /= 2;
  for (int i=1; i<n; i++) cout << ans[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: no matching function for call to 'std::queue<int>::queue(int&)'
   14 |     queue<int> q(n);
      |                   ^
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:195:9: note: candidate: 'template<class _Alloc, class _Requires> std::queue<_Tp, _Sequence>::queue(std::queue<_Tp, _Sequence>&&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  195 |         queue(queue&& __q, const _Alloc& __a)
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:195:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_queue.h:191:9: note: candidate: 'template<class _Alloc, class _Requires> std::queue<_Tp, _Sequence>::queue(const std::queue<_Tp, _Sequence>&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  191 |         queue(const queue& __q, const _Alloc& __a)
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:191:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_queue.h:187:9: note: candidate: 'template<class _Alloc, class _Requires> std::queue<_Tp, _Sequence>::queue(_Sequence&&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  187 |         queue(_Sequence&& __c, const _Alloc& __a)
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:187:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_queue.h:183:9: note: candidate: 'template<class _Alloc, class _Requires> std::queue<_Tp, _Sequence>::queue(const _Sequence&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  183 |         queue(const _Sequence& __c, const _Alloc& __a)
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:183:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_queue.h:179:9: note: candidate: 'template<class _Alloc, class _Requires> std::queue<_Tp, _Sequence>::queue(const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  179 |         queue(const _Alloc& __a)
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:179:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_queue.h: In substitution of 'template<class _Tp, class _Sequence> template<class _Alloc> using std::queue<_Tp, _Sequence>::_Uses = typename std::enable_if<std::uses_allocator<_Sequence, _Alloc>::value>::type [with _Alloc = int; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]':
/usr/include/c++/14/bits/stl_queue.h:177:33:   required from here
  177 |       template<typename _Alloc, typename _Requires = _Uses<_Alloc>>
      |                                 ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:125:15: error: no type named 'type' in 'struct std::enable_if<false, void>'
  125 |         using _Uses = typename
      |               ^~~~~
/usr/include/c++/14/bits/stl_queue.h:166:9: note: candidate: 'template<class _Seq, class _Requires> std::queue<_Tp, _Sequence>::queue() [with _Requires = _Seq; _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  166 |         queue()
      |         ^~~~~
/usr/include/c++/14/bits/stl_queue.h:166:9: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_queue.h:174:7: note: candidate: 'std::queue<_Tp, _Sequence>::queue(_Sequence&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  174 |       queue(_Sequence&& __c)
      |       ^~~~~
/usr/include/c++/14/bits/stl_queue.h:174:25: note:   no known conversion for argument 1 from 'int' to 'std::deque<int, std::allocator<int> >&&'
  174 |       queue(_Sequence&& __c)
      |             ~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:170:7: note: candidate: 'std::queue<_Tp, _Sequence>::queue(const _Sequence&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  170 |       queue(const _Sequence& __c)
      |       ^~~~~
/usr/include/c++/14/bits/stl_queue.h:170:30: note:   no known conversion for argument 1 from 'int' to 'const std::deque<int, std::allocator<int> >&'
  170 |       queue(const _Sequence& __c)
      |             ~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'std::queue<int>::queue(const std::queue<int>&)'
   96 |     class queue
      |           ^~~~~
/usr/include/c++/14/bits/stl_queue.h:96:11: note:   no known conversion for argument 1 from 'int' to 'const std::queue<int>&'
/usr/include/c++/14/bits/stl_queue.h:96:11: note: candidate: 'std::queue<int>::queue(std::queue<int>&&)'
/usr/include/c++/14/bits/stl_queue.h:96:11: note:   no known conversion for argument 1 from 'int' to 'std::queue<int>&&'
a.cc:20:5: error: expected ',' or ';' before 'push'
   20 |     push(i,0);
      |     ^~~~
a.cc:22:25: error: void value not ignored as it ought to be
   22 |         int temp = q.pop();
      |                    ~~~~~^~