Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include <queue>
using namespace std;

#define int long long
#define INF 1001001001
int ans[2001];
int dis[2001][2001];
vector<int> v(2001);

void bfs(int start){
	
    queue<int> q;
    dis[start][start] = 1;
    
    q.push(start);
    
    while(!q.empty()){
    	
    	int u = q.front();
		
		q.pop();
		
		for(int tmp : v[u]){
			
			if(dis[tmp][start]==0){
                dis[tmp][start]=dis[tmp][start]+1;
                q.push(tmp);
        	}
			
		}	
    	
	}
	
}


int32_t main() {
	
    int N,X,Y;
  
    cin >> N >> X >> Y;
	
	X--;Y--;
	
	
	for(int i=0; i<N-1;i++){
		
		v[i].push_back(i+1);
		v[i+1].push_back(i);
		
	}
	
	v[x].push_back(y);
	v[y].push_back(x);
	for(int i=0;i<N;i++)
        bfs(i);
    for(int i=0;i<N;i++)
        for(int j=i+1;j<N;j++)
            ++ans[dis[i][j]-1];
    for(int i=1;i<N;i++)
        cout<<ans[i]<<"\n";
}

Compiler output:
a.cc: In function 'void bfs(long long int)':
a.cc:28:34: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   28 |                 for(int tmp : v[u]){
      |                                  ^
      |                                  std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:28:34: error: 'end' was not declared in this scope; did you mean 'std::end'?
   28 |                 for(int tmp : v[u]){
      |                                  ^
      |                                  std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc: In function 'int32_t main()':
a.cc:53:22: error: request for member 'push_back' in 'v.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   53 |                 v[i].push_back(i+1);
      |                      ^~~~~~~~~
a.cc:54:24: error: request for member 'push_back' in 'v.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   54 |                 v[i+1].push_back(i);
      |                        ^~~~~~~~~
a.cc:58:11: error: 'x' was not declared in this scope
   58 |         v[x].push_back(y);
      |           ^
a.cc:58:24: error: 'y' was not declared in this scope
   58 |         v[x].push_back(y);
      |                        ^