criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
int main()	{
  int n;
  int c=1;
  cin>>n;
  vector<int>x(n),y(n);
  rep(i,n){
    cin>>x[i]>>y[i];
  }
  for(int i=1;i<=n;i++;
    c*=i;}
  int sum=0;
  rep(i,n){
    int sum0=0;
    rep(j,n){
      if(i==j)
        continue;
      sum0+=pow(x[i]*x[i]+y[j]*y[j],1/2);
    }
    sum+=sum0;
  }
  cout<<fixed<<setprecision(10)<<sum/c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before ';' token
   16 |   for(int i=1;i<=n;i++;
      |      ~                ^
      |                       )
a.cc:17:8: error: 'i' was not declared in this scope
   17 |     c*=i;}
      |        ^
a.cc: At global scope:
a.cc:3:18: error: expected unqualified-id before 'for'
    3 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                  ^~~
a.cc:19:3: note: in expansion of macro 'rep'
   19 |   rep(i,n){
      |   ^~~
a.cc:19:7: error: 'i' does not name a type
   19 |   rep(i,n){
      |       ^
a.cc:3:30: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                              ^
a.cc:19:7: error: 'i' does not name a type
   19 |   rep(i,n){
      |       ^
a.cc:3:41: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                         ^
a.cc:28:3: error: 'cout' does not name a type
   28 |   cout<<fixed<<setprecision(10)<<sum/c<<endl;
      |   ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class C_145 {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]x = new int[N];
			int[]y = new int[N];
			
			double answer = 0.0;
			
			for(int i = 0;i<N;i++) {
				x[i] = scan.nextInt();
				y[i] = scan.nextInt();
				
			}
			
			ArrayList<Double> kyori = new ArrayList<Double>();
			
			ArrayList<Integer> nantouri = new ArrayList<Integer>();
			
			for(int i = 1;i<=N;i++) {
				nantouri.add(i);
			}
			
			goukei(N,0,0,x,y,kyori,nantouri,0);
			
			System.out.println(kyori.size());
			double goukei = 0;
			
			for(int i = 0;i<kyori.size();i++) {
				System.out.println(kyori.get(i));
				goukei+=kyori.get(i)-1;
				
			}
			
			System.out.println(goukei/(double)kaijyou(N));
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
	private static void goukei(int n,int x,int y,int[]X,int[]Y,
			ArrayList<Double> Kyori,ArrayList<Integer> nantouri,double ichiji) {
		
		if(n==0) {
			Kyori.add(ichiji);//リストの数はN!個ある	
			System.out.println("ok");
		}else {
			
			
		for(int i = 0;i<nantouri.size();i++) {
			ArrayList<Integer> nan = new ArrayList<Integer>(nantouri);
			int s = nan.get(i);
			System.out.println(s);
			int dx = X[s-1];//目的地
			int dy = Y[s-1];//目的地
			System.out.println("呼び出された");
			//System.out.println(x);
			//System.out.println(y);
			
			double ichijikyori =ichiji+Math.sqrt((dx-x)*(dx-x)+(dy-y)*(dy-y));
			nan.remove(i);
			
			System.out.println(nan.size());
			
			goukei(n-1,dx,dy,X,Y,Kyori,nan,ichijikyori);
			

				
		}
		
		}
		
	}
	
	
	
	
	
	
	private static int kaijyou(int n) {
		if(n==1)return 1;
		return n*kaijyou(n-1);
	}

}


Compiler output:
Main.java:4: error: class C_145 is public, should be declared in a file named C_145.java
public class C_145 {
       ^
1 error
Language: C++

>> N;
vector<int> x(N);
vector<int> y(N);
vector<int> order(N);
for(int i=0;i<N;i++)
{
order.at(i)=i;
cin >> x.at(i) >> y.at(i);
}
do {
a=0;
for(int i=0;i<N-1;i++)
{
double X=abs(x.at(order.at(i))-x.at(order.at(i+1)))*abs(x.at(order.at(i))-x.at(order.at(i+1)));
double Y=abs(y.at(order.at(i))-y.at(order.at(i+1)))*abs(y.at(order.at(i))-y.at(order.at(i+1)));
a+=sqrt(X+Y);

}
ans+=a;
}while(next_permutation(order.begin(),order.end()));
for(int i=N;i>0;i--){div*=i;}
ans/=div;
cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '>>' token
    1 | >> N;
      | ^~
a.cc:2:1: error: 'vector' does not name a type
    2 | vector<int> x(N);
      | ^~~~~~
a.cc:3:1: error: 'vector' does not name a type
    3 | vector<int> y(N);
      | ^~~~~~
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> order(N);
      | ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for(int i=0;i<N;i++)
      | ^~~
a.cc:5:13: error: 'i' does not name a type
    5 | for(int i=0;i<N;i++)
      |             ^
a.cc:5:17: error: 'i' does not name a type
    5 | for(int i=0;i<N;i++)
      |                 ^
a.cc:10:1: error: expected unqualified-id before 'do'
   10 | do {
      | ^~
a.cc:20:2: error: expected unqualified-id before 'while'
   20 | }while(next_permutation(order.begin(),order.end()));
      |  ^~~~~
a.cc:21:1: error: expected unqualified-id before 'for'
   21 | for(int i=N;i>0;i--){div*=i;}
      | ^~~
a.cc:21:13: error: 'i' does not name a type
   21 | for(int i=N;i>0;i--){div*=i;}
      |             ^
a.cc:21:17: error: 'i' does not name a type
   21 | for(int i=N;i>0;i--){div*=i;}
      |                 ^
a.cc:22:1: error: 'ans' does not name a type
   22 | ans/=div;
      | ^~~
a.cc:23:1: error: 'cout' does not name a type
   23 | cout << ans << endl;
      | ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<bits/stdc++.h>                                                   //---------------------------------------------------------------
                                                                    
# define ll long long   
# define ld long double                                               
# define mod 1000000007                                                   
# define MAX 100005                                                                                //shortcut keys
                                                                                
# define pb push_back                                                                     
# define mp make_pair                                                     
                                                                  
# define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);        //---------------------------------------------------------------                                       
using namespace std;

ll power(ll x,ll y,ll m){            //power(x,y)=x^y  %m;
	if(y==0)return 1;
	int ll a=power(x,y/2,m);
	if(y%2){
		return (a*((a*x)%m))%m;
	}
	else{
		return (a*a)%m;
	}
}
ll mod_inverse(ll x,ll m){
	return power(x,m-2,m);
}
ll fact(ll n,ll m){
	if(n<=1)return 1;
	return (fact(n-1,m)*n)%m;
}
ll ncr(ll n,ll r,ll m){
	ll n1=1,d1=1,d2=1;
	n1=fact(n,m);d1=fact(r,m);d2=fact(n-r,m);
	ll ans=mod_inverse((d1*d2)%m,m);
	ans=(ans*n1)%m;
	return ans;
}
 vector<ll> adj[MAX];
 graphinput(ll edge)
 {
 	for(ll i=0;i<edge;i++)
 	{
 		int x,y;
 		cin>>x>>y;
 		adj[x].pb(y);
 		adj[y].pb(x);                                                         // for undirected graph
	 }
 }

int main()
{
	ll n;
	cin>>n;
	ll a[n][2];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<2;j++)
		cin>>a[i][j];
	}
	ld sum=0.0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			ld b=pow(abs(a[i][0]-a[j][0]),2)+pow(abs(a[i][1]-a[j][1]),2);
			ld c=sqrt(b);
			sum+=c;
		}
	}
//	ld fac=fact(n,mod);
	ld ans=(sum*2)/n;
	cout<<fixed<<setprecision(9)<<ans;
	
	
	
	
	
	
	
	
	
	

	return 0;
}

Compiler output:
a.cc:39:2: error: ISO C++ forbids declaration of 'graphinput' with no type [-fpermissive]
   39 |  graphinput(ll edge)
      |  ^~~~~~~~~~
a.cc: In function 'int graphinput(long long int)':
a.cc:48:2: warning: no return statement in function returning non-void [-Wreturn-type]
   48 |  }
      |  ^
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

#define ll long long
using vt = int; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define MOD 1000000007

long double dist(long double a, long double b, long double c, long double d) {
	long double l = sqrtl((a - c) * (a - c) + (b - d) * (b - d));
	return l;
}

int main() {
	int n;
	long double s = 0, ans;
	cin >> n;
	vector<vector<long double>> twn(n, vector<long double>(2));
	rep(i, n) rep(j, 2) cin >> twn.at(i).at(j);
	rep(i, n) {
		rep(j, n) {
			long double t = dist(twn.at(i).at(0), twn.at(i).at(1), twn.at(j).at(0), twn.at(j).at(1));
			s += t;
		}
	}
	cout << s / n;
	return 0;
}

Compiler output:
a.cc: In function 'long double dist(long double, long double, long double, long double)':
a.cc:27:25: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
   27 |         long double l = sqrtl((a - c) * (a - c) + (b - d) * (b - d));
      |                         ^~~~~
      |                         strtol
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = new sc.nextInt();
    int[] x = new int[n];
    int[] y = new int[n];
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
      y[i] = sc.nextInt();
    }
    long sum = 0;
    for(int i = 0; i < n; i++){
      for(int j = i + 1; i < n; j++){
        sum += Math.sqrt(1.0 * (x[j] - x[i]) * (x[j] - x[i]) + (y[j] - y[i]) * (y[j] - y[i]));
      }
    }
    System.out.println(sum * 2 / n);
  }
}

Compiler output:
Main.java:5: error: package sc does not exist
    int n = new sc.nextInt();
                  ^
1 error
Language: C++

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>

int main(){
    using namespace std;
    constexpr unsigned long shosubu = 200;
    using bigint = boost::multiprecision::cpp_int;
    bigint p10{string(shosubu, '9')}, eps{p10 / 1000000};
    ++p10;
    unsigned long N;
    cin >> N;
    vector<pair<long, long>> t(N);
    for(auto& i : t)cin >> i.first >> i.second;
    const auto& norm = [](const pair<long, long>& x, const pair<long, long>& y) -> unsigned long {
        unsigned long xd{static_cast<unsigned long>(max(x.first, y.first) - min(x.first, y.first))}, yd{static_cast<unsigned long>(max(x.second, y.second) - min(x.second, y.second))};
        return xd * xd + yd * yd;
    };
    bigint ans_lower{0}, ans_upper{0};
    for(const auto& i : t)for(const auto& j : t){
        bigint t{p10 * p10 * norm(i, j)};
        bigint c{boost::multiprecision::sqrt(t)}, d{c * c == t ? c : c + 1};
        ans_lower += c;
        ans_upper += d;
    }
    const auto& println_bigint_as_decimal = [](const bigint& x) -> void {
        string s = x.str();
        copy(s.begin(), s.end() - shosubu, ostream_iterator<char>(cout));
        cout << '.';
        copy(s.end() - shosubu, s.end(), ostream_iterator<char>(cout));
        cout << endl;
    };
    println_bigint_as_decimal(max(ans_lower / N + eps, ans_lower * 1000001 / (N * 1000000)));
    //println_bigint_as_decimal(min((ans_upper + N - 1) / N - eps, (ans_upper * 999999 + N * 1000000 - 1) / (N * 1000000)));
    return 0;
}

Compiler output:
a.cc:2:9: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include<boost/multiprecision/cpp_int.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
    double d = 0.0;
    int n;
    int p[8][2];

    cin >> n;
    for(int i = 0; i < n; ++i)
        cin >> p[i][0] >> p[i][1];

    for(int i = 0; i < n - 1; ++i)
        for(int j = i + 1; j < n; ++j) {
            double x = p[i][0] - p[j][0];
            double y = p[i][1] - p[j][1];
            d += sqrt(x * x + y * y);
        }
    
    cout << fixed << setprecision(10) << 2 * d / n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: 'sqrt' was not declared in this scope
   20 |             d += sqrt(x * x + y * y);
      |                  ^~~~
Language: C++

#include <iostream>
#include <typeinfo>
#include <cmath>
#include <vector>
#include <algorithms>
using namespace std;

int fact(int n)
{
  int ans = 1;
  for (int i = 1; i <= n; i++)
  {
    ans *= i;
  }
  return ans;
}

int main()
{
  int N;
  cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  vector<vector<long double>> dist(N, vector<long double>(N));

  for (int i = 0; i < N; i++)
  {
    int X, Y;
    cin >> X >> Y;
    x[i] = X;
    y[i] = Y;
  }

  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      long double d = sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
      dist[i][j] = d;
      dist[j][i] = d;
    }
  }

  long double sum = 0;

  vector<int> order(N);
  for (int i = 0; i < N; i++)
  {
    order[i] = i;
  }

  do
  {
    long double d = 0;
    for (int i = 0; i < N - 1; i++)
    {
      d += dist[order[i]][order[i + 1]];
    }
    sum += d;
  } while (next_permutation(order.begin(), order.end()));

  cout << sum / fact(N) << endl;
}

Compiler output:
a.cc:5:10: fatal error: algorithms: No such file or directory
    5 | #include <algorithms>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <typeinfo>
#include <cmath>
#include <vector>
using namespace std;

int fact(int n)
{
  int ans = 1;
  for (int i = 1; i <= n; i++)
  {
    ans *= i;
  }
  return ans;
}

int main()
{
  int N;
  cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  vector<vector<long double>> dist(N, vector<long double>(N));

  for (int i = 0; i < N; i++)
  {
    int X, Y;
    cin >> X >> Y;
    x[i] = X;
    y[i] = Y;
  }

  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      long double d = sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
      dist[i][j] = d;
      dist[j][i] = d;
    }
  }

  long double sum = 0;

  vector<int> order(N);
  for (int i = 0; i < N; i++)
  {
    order[i] = i;
  }

  do
  {
    long double d = 0;
    for (int i = 0; i < N - 1; i++)
    {
      d += dist[order[i]][order[i + 1]];
    }
    sum += d;
  } while (next_permutation(order.begin(), order.end()));

  cout << sum / fact(N) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:12: error: 'next_permutation' was not declared in this scope
   59 |   } while (next_permutation(order.begin(), order.end()));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
 
int n;
int x[10];
int y[10];
int b[10];
 
double dis(int a, int b, int c, int d) {
	double ans = sqrt((a - b) * (a - b) + (c - d) * (c - d));
	return ans;
}
 
int main() {
	cin >> n;
	rep(i, n) cin >> x[i] >> y[i];
	for (int i=0;i<n;i++) b[i] = i;
	double sum = 0;
	do {
		for (int i = 0; i < n - 1; i++) {
			sum += dis(x[b[i]],x[b[i+1]],y[b[i]],y[b[i+1]]);
		}
	} while (next_permutation(b, b + n));
	double k = 1;
	for (int i = 1; i <= n; i++) k *= i;
	cout << fixed << setprecision(10) << sum / k << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'setprecision' was not declared in this scope
   29 |         cout << fixed << setprecision(10) << sum / k << endl;
      |                          ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <cmath>
  +++ |+#include <iomanip>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <bitset>
#include <algorithm>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)

int n;
int x[10];
int y[10];
int b[10];

double dis(int a, int b, int c, int d) {
	double ans = sqrt((a - b) * (a - b) + (c - d) * (c - d));
	return ans;
}

int main() {
	cin >> n;
	rep(i, n) cin >> x[i] >> y[i];
	for (int i=0;i<n;i++) b[i] = i;
	double sum = 0;
	do {
		for (int i = 0; i < n - 1; i++) {
			sum += dis(x[b[i]],x[b[i+1]],y[b[i]],y[b[i+1]]);
		}
	} while (next_permutation(b, b + n));
	double k = 1;
	for (int i = 1; i <= n; i++) k *= i;
	cout << sum / k << endl;
	return 0;
}


Compiler output:
a.cc: In function 'double dis(int, int, int, int)':
a.cc:13:22: error: 'sqrt' was not declared in this scope
   13 |         double ans = sqrt((a - b) * (a - b) + (c - d) * (c - d));
      |                      ^~~~
Language: C++

#include <iostream>
#include <bitset>
#include <algorithm>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)

int n;
int x[10];
int y[10];
int b[10];

double dis(int a, int b, int c, int d) {
	double ans = sqrt((a - b) * (a - b) + (c - d) * (c - d));
	return ans;
}

int main() {
	cin >> n;
	rep(i, n) cin >> x[i] >> y[i];
	for (int i=0;i<n;i++) b[i] = i+1;
	double sum = 0;
	do {
		for (int i = 0; i < n - 1; i++) {
			sum += dis(x[b[i]-1],x[b[i+1]-1],y[b[i]-1],y[b[i+1]-1]);
		}
	} while (next_permutation(b, b + n));
	double k = 1;
	for (int i = 1; i <= n; i++) k *= i;
	cout << sum / k << endl;
	return 0;
}


Compiler output:
a.cc: In function 'double dis(int, int, int, int)':
a.cc:13:22: error: 'sqrt' was not declared in this scope
   13 |         double ans = sqrt((a - b) * (a - b) + (c - d) * (c - d));
      |                      ^~~~
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include <iomanip>

using namespace std;

int main()
{
  int N;
  cin >> N;

  vector<Vec2d> pos(N);
  vector<int> v(N);
  for (int i = 0; i < N; ++i)
  {
    cin >> pos[i].x >> pos[i].y;
    v[i] = i;
  }

  double sum_distance = 0.0;
  int count = 0;
  do{
    ++count;
    for (int i = 0; i < v.size() - 1; ++i)
    {
      double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      sum_distance += sqrt(dis);
    }
  } while (next_permutation(v.begin(), v.end()));

  cout << setprecision(10) << sum_distance / count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'Vec2d' was not declared in this scope
   17 |   vector<Vec2d> pos(N);
      |          ^~~~~
a.cc:17:15: error: template argument 1 is invalid
   17 |   vector<Vec2d> pos(N);
      |               ^
a.cc:17:15: error: template argument 2 is invalid
a.cc:21:15: error: invalid types 'int[int]' for array subscript
   21 |     cin >> pos[i].x >> pos[i].y;
      |               ^
a.cc:21:27: error: invalid types 'int[int]' for array subscript
   21 |     cin >> pos[i].x >> pos[i].y;
      |                           ^
a.cc:31:27: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   31 |       double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      |                           ^
a.cc:31:41: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   31 |       double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      |                                         ^
a.cc:31:67: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   31 |       double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      |                                                                   ^
a.cc:31:81: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   31 |       double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      |                                                                                 ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;


void average_length()
{
  int n;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

  double sum = 0;
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      if (i == j) continue;
      sum += std::sqrt(std::pow(x[i] - x[j], 2) + std::pow(y[i] - y[j], 2));
    }
  }

  cout << sum / n << '\n';
}


int calc_digits(long long int n)
{
  int digits = 0;
  while (n >= 1)
  {
    n /= 10;
    ++digits;
  }

  return digits;
}


void buy_an_interger()
{
  long long int a, b;
  long long int x;
  cin >> a >> b >> x;

  long long int left = 0, right = 1000000001;
  long long int mid;
  while (right - left > 1)
  {
    mid = left + (right - left) / 2;
    if (a * mid + b * calc_digits(mid) <= x) left = mid;
    else right = mid;
  }

  cout << left << '\n';
}


void honest_or_unkind2()
{
  //後回し
}


long long int gcd(int a, int b)
{
  if (a < b) 
  {
    int tmp;
    tmp = a;
    a   = b;
    b   = tmp;
  }

  int r = a % b;
  while (r != 0)
  {
    a = b;
    b = r;
    r = a % b;
  }

  return b;
}


long long int lcm(long long int a, long long int b)
{
  return a * b / gcd(a, b);
}


void snack()
{
  long long int a, b;
  cin >> a >> b;

  cout << lcm(a, b) << "\n";
}


bool is_prime(int n)
{
  if (n <= 1) return false;
  if (n == 2) return true;

  if (n % 2 == 0)return false;

  for (int i = 3; i * i <= n; i += 2)
  {
    if (n % i == 0) return false;
  }

  return true;
}


void next_prime()
{
  int x;
  cin >> x;

  int prime = x;
  while (!is_prime(prime)) ++prime;

  cout << prime << "\n";
}


int factorial(int n)
{
  int fact = 1;
  for (int i = n; i > 0; --i) fact *= i;
  return fact;
}


int calc_order(int n, vector<int> x)
{
  int cnt = 0;
  for (int i = 0; i < n; ++i)
  {
    cnt += (x[i] - 1) * factorial(n - 1 - i);
    for (int j = i + 1; j < n; ++j) {
      if (x[j] > x[i]) --x[j];
    }
  }
  return cnt;
}


void count_order()
{
  int n;
  cin >> n;

  vector<int> p(n);
  vector<int> q(n);
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) cin >> q[i];

  int p_cnt = 0, q_cnt = 0;
  p_cnt = calc_order(n, p);
  q_cnt = calc_order(n, q);

  cout << abs(p_cnt - q_cnt);
}




int main()
{
  average_length();
  //buy_an_interger();
  //cout << calc_digits(1000000000) << '\n';
  //honest_or_unkind2();
  //snack();
  //next_prime();
  //count_order();
}


Compiler output:
a.cc: In function 'void average_length()':
a.cc:21:19: error: 'sqrt' is not a member of 'std'
   21 |       sum += std::sqrt(std::pow(x[i] - x[j], 2) + std::pow(y[i] - y[j], 2));
      |                   ^~~~
a.cc:21:29: error: 'pow' is not a member of 'std'
   21 |       sum += std::sqrt(std::pow(x[i] - x[j], 2) + std::pow(y[i] - y[j], 2));
      |                             ^~~
a.cc:21:56: error: 'pow' is not a member of 'std'
   21 |       sum += std::sqrt(std::pow(x[i] - x[j], 2) + std::pow(y[i] - y[j], 2));
      |                                                        ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;


void average_length()
{
  int n;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

  double sum = 0;
  for (int i = 0; i < n; ++i)
  {
    for (int j = 0; j < n; ++j)
    {
      if (i == j) continue;
      sum += sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
    }
  }

  cout << sum / n << '\n';
}


int calc_digits(long long int n)
{
  int digits = 0;
  while (n >= 1)
  {
    n /= 10;
    ++digits;
  }

  return digits;
}


void buy_an_interger()
{
  long long int a, b;
  long long int x;
  cin >> a >> b >> x;

  long long int left = 0, right = 1000000001;
  long long int mid;
  while (right - left > 1)
  {
    mid = left + (right - left) / 2;
    if (a * mid + b * calc_digits(mid) <= x) left = mid;
    else right = mid;
  }

  cout << left << '\n';
}


void honest_or_unkind2()
{
  //後回し
}


long long int gcd(int a, int b)
{
  if (a < b) 
  {
    int tmp;
    tmp = a;
    a   = b;
    b   = tmp;
  }

  int r = a % b;
  while (r != 0)
  {
    a = b;
    b = r;
    r = a % b;
  }

  return b;
}


long long int lcm(long long int a, long long int b)
{
  return a * b / gcd(a, b);
}


void snack()
{
  long long int a, b;
  cin >> a >> b;

  cout << lcm(a, b) << "\n";
}


bool is_prime(int n)
{
  if (n <= 1) return false;
  if (n == 2) return true;

  if (n % 2 == 0)return false;

  for (int i = 3; i * i <= n; i += 2)
  {
    if (n % i == 0) return false;
  }

  return true;
}


void next_prime()
{
  int x;
  cin >> x;

  int prime = x;
  while (!is_prime(prime)) ++prime;

  cout << prime << "\n";
}


int factorial(int n)
{
  int fact = 1;
  for (int i = n; i > 0; --i) fact *= i;
  return fact;
}


int calc_order(int n, vector<int> x)
{
  int cnt = 0;
  for (int i = 0; i < n; ++i)
  {
    cnt += (x[i] - 1) * factorial(n - 1 - i);
    for (int j = i + 1; j < n; ++j) {
      if (x[j] > x[i]) --x[j];
    }
  }
  return cnt;
}


void count_order()
{
  int n;
  cin >> n;

  vector<int> p(n);
  vector<int> q(n);
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) cin >> q[i];

  int p_cnt = 0, q_cnt = 0;
  p_cnt = calc_order(n, p);
  q_cnt = calc_order(n, q);

  cout << abs(p_cnt - q_cnt);
}




int main()
{
  average_length();
  //buy_an_interger();
  //cout << calc_digits(1000000000) << '\n';
  //honest_or_unkind2();
  //snack();
  //next_prime();
  //count_order();
}


Compiler output:
a.cc: In function 'void average_length()':
a.cc:21:19: error: 'pow' was not declared in this scope
   21 |       sum += sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
      |                   ^~~
a.cc:21:14: error: 'sqrt' was not declared in this scope
   21 |       sum += sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
      |              ^~~~
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <string>

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

using namespace std;


struct Vec2d
{
  double x;
  double y;
};


void C_145()
{
  int N;
  cin >> N;

  vector<Vec2d> pos(N);
  vector<int> v(N);
  for (int i = 0; i < N; ++i)
  {
    cin >> pos[i].x >> pos[i].y;
    v[i] = i;
  }

  double sum_distance = 0.0;
  int count = 0;
  do{
    ++count;
    for (int i = 0; i < v.size() - 1; ++i)
    {
      double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      sum_distance += sqrt(dis);
    }
  } while (next_permutation(v.begin(), v.end()));

  cout << sum_distance / count << endl;
}

int main()
{
  //C_140();
  //C_141();
  //C_142();
  //C_143();
  //C_144();
  C_145();
  return 0;
}

Compiler output:
a.cc: In function 'void C_145()':
a.cc:39:20: error: 'pow' was not declared in this scope; did you mean 'pos'?
   39 |       double dis = pow(pos[v[i]].x - pos[v[i + 1]].x, 2) + pow(pos[v[i]].y - pos[v[i + 1]].y, 2);
      |                    ^~~
      |                    pos
a.cc:40:23: error: 'sqrt' was not declared in this scope
   40 |       sum_distance += sqrt(dis);
      |                       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

double distance(pair<int,int> a, pair<int,int> b){
  return sqrt(pow((double)a.first-(double)b.first,2.0)+pow((double)a.second-(double)b.second,2.0));
}

int main(){
  int N;
  cin>>N;
  vector<pair<int,int>> xy(N);
  for(int i=0;i<N;i++){
    cin>>xy.at(i).first>>xy.at(i).second;
  }
  
  double sum=0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      sum+=distance(xy.at(i),xy.at(j));
    }
  }
  
  cout<<xy.at(i)*2.0/(double)N<<endl;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'i' was not declared in this scope
   23 |   cout<<xy.at(i)*2.0/(double)N<<endl;
      |               ^
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>

using namespace std;

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

int f(int x){
    if (x == 1){
        return 1;
    }
    
    return f(x-1) * x;
}

int main(){
    int n;
    cin >> n;
    double x[n], y[n];
    for (int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
    }
    int perm[n];
    rep(i, n) perm[i] = i;
    double ans = 0;
    do{
        double dis = 0;
        for (int i = 0; i < n - 1; i++){
            dis += sqrt((x[perm[i]] - x[perm[i+1]]) * (x[perm[i]] - x[perm[i+1]]) + (y[perm[i]] - y[perm[i+1]]) * (y[perm[i]] - y[perm[i+1]]));
        }
        ans += dis;
    }while(next_permutation(perm, perm + n));
    ans /= (double)(f(n));
    printf("%.10lf\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 'next_permutation' was not declared in this scope
   34 |     }while(next_permutation(perm, perm + n));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

double distance(pair<int,int> a, pair<int,int> b){
  return sqrt(pow((double)a.first-(double)b.first,2.0)+pow((double)a.second-(double)b.second,2.0));
}

int main(){
  int N;
  cin>>N;
  vector<pair<int,int>> xy(N);
  for(int i=0;i<N;i++){
    cin>>xy.at(i).first>>xy.at(i).second;
  }
  
  double sum=0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j++){
      sum+=distance(xy.at(i),xy.at(j));
    }
  }
  
  cout<<xy.at(i)*2.0/(double)N<<endl;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expected ';' before ')' token
   18 |     for(int j=i+1;j++){
      |                      ^
      |                      ;
a.cc:23:15: error: 'i' was not declared in this scope
   23 |   cout<<xy.at(i)*2.0/(double)N<<endl;
      |               ^
Language: C++

 #include<bits/stdc++.h>

using namespace std;

vector<int> IntegerToVector(int bit,int N){
  vector<int> S;
  for(int i = 0; i < N; i++) {
    if(bit & (1 << i)) {
      S.push_back(i);
    }
  }
  return S;
}



int main(){
  int N;
  cin >> N;

  vector<double> x;
  vector<double> y;
  vector<int> z;
  for(int i = 0; i < N; i++){
    z[i] = i;
  }


  for(int i = 0; i < N; i++) cin >> x[i] >> y[i];
  double sum = 0;
  do{
    for(int i = 0; i < N - 1; i++){
      sum += sqrt((x[i + 1] - x[i]) * (x[i + 1] - x[i]) + (y[i + 1] - y[i]));
    }

  }next_permutation(z.begin(),z.end());

  int num = 1;
  for(int i = 1; i < N + 1; i++) num *= i;

  cout << sum / num << endl;
  return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:36:4: error: expected 'while' before 'next_permutation'
   36 |   }next_permutation(z.begin(),z.end());
      |    ^~~~~~~~~~~~~~~~
a.cc:36:4: error: expected '(' before 'next_permutation'
   36 |   }next_permutation(z.begin(),z.end());
      |    ^~~~~~~~~~~~~~~~
      |    (
a.cc:36:39: error: expected ')' before ';' token
   36 |   }next_permutation(z.begin(),z.end());
      |    ~~~~~~~~~~~~~~~~                   ^
      |                                       )
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
 
using namespace std;
 
void AverageLength()
{
  int n;
  double res = 0;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  {
    cin >> x[i] >> y[i];
    v[i] = i + 1;
  }
 
  int c = calcConbination(n, 2);
  int f = calcFactorial(n);
  cout << f * (n - 1) / c << endl;
  for (int i = 0; i < n; i++)
  {
    for (int j = i + 1; j < n; j++)
    {
      res += sqrt(pow((x[i] - x[j]), 2) + pow((y[i] - y[j]), 2));
 
    }
  }
  
  cout << setprecision(16) << res * (n - 1) / c << endl;
  return;
}
 
int main()
{
  AverageLength();
  return 0;
}

Compiler output:
a.cc: In function 'void AverageLength()':
a.cc:22:11: error: 'calcConbination' was not declared in this scope
   22 |   int c = calcConbination(n, 2);
      |           ^~~~~~~~~~~~~~~
a.cc:23:11: error: 'calcFactorial' was not declared in this scope
   23 |   int f = calcFactorial(n);
      |           ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

void AverageLength()
{
  int n;
  double res = 0;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  {
    cin >> x[i] >> y[i];
    v[i] = i + 1;
  }

  int c = calcConbination(n, 2);
  int f = calcFactorial(n);
  cout << f * (n - 1) / c << endl;
  for (int i = 0; i < n; i++)
  {
    for (int j = i + 1; j < n; j++)
    {
      res += sqrt(pow((x[i] - x[j]), 2) + pow((y[i] - y[j]), 2));

    }
  }
  
  cout << setprecision(10) << res * (n - 1) / c << endl;
  return;
}

int main()
{
  AverageLength();
  return 0;
}



Compiler output:
a.cc: In function 'void AverageLength()':
a.cc:21:11: error: 'calcConbination' was not declared in this scope
   21 |   int c = calcConbination(n, 2);
      |           ^~~~~~~~~~~~~~~
a.cc:22:11: error: 'calcFactorial' was not declared in this scope
   22 |   int f = calcFactorial(n);
      |           ^~~~~~~~~~~~~
a.cc:33:11: error: 'setprecision' was not declared in this scope
   33 |   cout << setprecision(10) << res * (n - 1) / c << endl;
      |           ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <cmath>
  +++ |+#include <iomanip>
    4 |
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double a, b, c, d;
  int n;
  a = 0;
  cin >> n;
  int g[n];
  int h[n];
  double k[n * (n - 1) / 2];
  for(int i = 0; i < n; i++)
    cin >> g[i] >> h[i];
  for(int i = 0; i < n; i++){
    for(int j = i + 1; j < n; j++){
      b = (g[i] - g[j]) * (g[i] - g[j]);
      c = (h[i] - h[j]) * (h[i] - h[j]);
      a = a + sprt(b + c);
    }
  }
  d = 2.0000000 * a / n;
  cout << fixed << setprecision(7);
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'sprt' was not declared in this scope; did you mean 'sqrt'?
   18 |       a = a + sprt(b + c);
      |               ^~~~
      |               sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double a, b, c, d;
  double n;
  a = 0;
  cin >> n;
  int g[n];
  int h[n];
  double k[n * (n - 1) / 2];
  for(int i = 0; i < n; i++)
    cin >> g[i] >> h[i];
  for(int i = 0; i < n; i++){
    for(int j = i + 1; j < n; j++){
      b = (g[i] - g[j]) * (g[i] - g[j]);
      c = (h[i] - h[j]) * (h[i] - h[j]);
      a = a + sprt(b + c);
    }
  }
  d = 2.0000000 * a / n;
  cout << fixed << setprecision(7);
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    9 |   int g[n];
      |         ^
a.cc:9:9: error: could not convert 'n' from 'double' to 'long unsigned int'
    9 |   int g[n];
      |         ^
      |         |
      |         double
a.cc:9:9: error: size of array 'g' has non-integral type 'double'
a.cc:10:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 |   int h[n];
      |         ^
a.cc:10:9: error: could not convert 'n' from 'double' to 'long unsigned int'
   10 |   int h[n];
      |         ^
      |         |
      |         double
a.cc:10:9: error: size of array 'h' has non-integral type 'double'
a.cc:11:24: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   11 |   double k[n * (n - 1) / 2];
      |            ~~~~~~~~~~~~^~~
a.cc:11:24: error: could not convert '((n * (n - (double)1)) / (double)2)' from 'double' to 'long unsigned int'
   11 |   double k[n * (n - 1) / 2];
      |            ~~~~~~~~~~~~^~~
      |                        |
      |                        double
a.cc:11:24: error: size of array 'k' has non-integral type 'double'
a.cc:18:15: error: 'sprt' was not declared in this scope; did you mean 'sqrt'?
   18 |       a = a + sprt(b + c);
      |               ^~~~
      |               sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> x(n),y(n)
	for(int i=0;i<n;i++)cin >> x[i]>>y[i];
	vector<int> ind(n);
	for(int i=0;i<n;i++)ind[i]=i;
	
	int cnt=0;
	double sum=0;
	do{
		for(int i=0;i<n-1;i++){
			sum+= sqrt(pow(x[ind[i+1]]-x[ind[i]],2)+pow(y[ind[i+1]]-y[ind[i]],2));
		}
		cnt++;
	}while(next_permutation(ind.begin(),ind.end()));
	
	printf("%0.10f",sum/cnt);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ',' or ';' before 'for'
    8 |         for(int i=0;i<n;i++)cin >> x[i]>>y[i];
      |         ^~~
a.cc:8:21: error: 'i' was not declared in this scope
    8 |         for(int i=0;i<n;i++)cin >> x[i]>>y[i];
      |                     ^
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>
  
double perm(int,int,int);

int main(void){
    
  int x[10],y[10],N,k;
  double s=0.0,n=0.0;
   scanf("%d",&N);
   for(k=0;k<N;k++){
   scanf("%d%d",&x[k],&y[k]);
   s=s*(k+1);
   }
   n=perm(1,x,y);
   printf("%d",n/s);
}
double perm(int i,int x[],int y[]){
   int j,t;
   double l=0.0;
     
    if(i<N){
     for(j=i;j<=N;j++){
       t=x[j];x[j]=x[i];x[i]=t;
        perm(i+1,x,y);
       t=x[j];x[j]=x[i];x[i]=t;
     }
    }
     else{
       for(j=0;j<N-1;j++)
         l+=sqrt(pow(x[j+1]-x[j],2)+pow(y[j+1]-y[j]));
     }
     return l;     
} 

Compiler output:
main.c: In function 'main':
main.c:16:13: error: passing argument 2 of 'perm' makes integer from pointer without a cast [-Wint-conversion]
   16 |    n=perm(1,x,y);
      |             ^
      |             |
      |             int *
main.c:5:17: note: expected 'int' but argument is of type 'int *'
    5 | double perm(int,int,int);
      |                 ^~~
main.c:16:15: error: passing argument 3 of 'perm' makes integer from pointer without a cast [-Wint-conversion]
   16 |    n=perm(1,x,y);
      |               ^
      |               |
      |               int *
main.c:5:21: note: expected 'int' but argument is of type 'int *'
    5 | double perm(int,int,int);
      |                     ^~~
main.c: At top level:
main.c:19:8: error: conflicting types for 'perm'; have 'double(int,  int *, int *)'
   19 | double perm(int i,int x[],int y[]){
      |        ^~~~
main.c:5:8: note: previous declaration of 'perm' with type 'double(int,  int,  int)'
    5 | double perm(int,int,int);
      |        ^~~~
main.c: In function 'perm':
main.c:23:10: error: 'N' undeclared (first use in this function)
   23 |     if(i<N){
      |          ^
main.c:23:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:37: error: too few arguments to function 'pow'
   32 |          l+=sqrt(pow(x[j+1]-x[j],2)+pow(y[j+1]-y[j]));
      |                                     ^~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: declared here
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
Language: C++

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <bitset>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

using P = pair<int, int>;

int factorial(int n) {
    if (n == 0) return 1;
    return n * factorial(n - 1);
}

int main(int argc, const char * argv[]) {
    int N;
    cin >> N;

    vector<P> pts(N);
    vector<int> indices(N);
    for (int i = 0; i < N; i++) {
        int x, y;
        cin >> x >> y;
        pts[i] = make_pair(x, y);
        indices[i] = i;
    }

    vector<vector<double>> dist(N, vector<double>(N));
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            double dx = pts[i].first - pts[j].first;
            double dy = pts[i].second - pts[j].second;
            double d = sqrt(dx * dx + dy * dy);
            dist[i][j] = d;
            dist[j][i] = d;
        }
    }

    double total = 0.0;
    do {
        for (int i = 0; i < N - 1; i++) {
            total += dist[indices[i]][indices[i+1]];
        }
    } while(next_permutation(indices.begin(), indices.end()));

    cout << fixed << setprecision(10) << total / factorial(N) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:56:22: error: 'setprecision' was not declared in this scope
   56 |     cout << fixed << setprecision(10) << total / factorial(N) << endl;
      |                      ^~~~~~~~~~~~
a.cc:13:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
   12 | #include <bitset>
  +++ |+#include <iomanip>
   13 |
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

void AverageLength()
{
  int n;
  float res = 0;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  {
    cin >> x[i] >> y[i];
    v[i] = i + 1;
  }

  int c = calcConbination(n, 2);
  int f = calcFactorial(n);
  cout << f * (n - 1) / c << endl;
  if (n > 2)
  {
    for (int i = 0; i < n; i++)
    {
      for (int j = i + 1; j < n; j++)
      {
        res += sqrt(pow((x[i] - x[j]), 2) + pow((y[i] - y[j]), 2));
  
      }
    }
  }
  else res += sqrt(pow((x[0] - x[1]), 2) + pow((y[0] - y[1]), 2)) * 2;
  cout << setprecision(10) << res * (n - 1) / c << endl;
}


int main()
{ 
  AverageLength();
  return 0;
}


Compiler output:
a.cc: In function 'void AverageLength()':
a.cc:21:11: error: 'calcConbination' was not declared in this scope
   21 |   int c = calcConbination(n, 2);
      |           ^~~~~~~~~~~~~~~
a.cc:22:11: error: 'calcFactorial' was not declared in this scope
   22 |   int f = calcFactorial(n);
      |           ^~~~~~~~~~~~~
a.cc:36:11: error: 'setprecision' was not declared in this scope
   36 |   cout << setprecision(10) << res * (n - 1) / c << endl;
      |           ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <cmath>
  +++ |+#include <iomanip>
    4 |
Language: C++

#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main(){
  int N,x,y;cin>>N;
  vector<pair<int,int>>s(N);
  for(int i=0;i<N;i++){
    cin>>x>>y;
    s.at(i)=make_pair(x,y);
  }
  int c=0;
  double l=0;
  sort(s.begin(),s.end());
  do{
    c++;
    for(int i=1;i<N;i++)l+=sqrt(pow(s.at(i).fist-s.at(i-1).fist,2)+pow(s.at(i).second-s.at(i-1).second,2));
  }while(next_permutation(s.begin(),s.end()));
  printf("%lf",l/c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:45: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'fist'; did you mean 'first'?
   16 |     for(int i=1;i<N;i++)l+=sqrt(pow(s.at(i).fist-s.at(i-1).fist,2)+pow(s.at(i).second-s.at(i-1).second,2));
      |                                             ^~~~
      |                                             first
a.cc:16:60: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'fist'; did you mean 'first'?
   16 |     for(int i=1;i<N;i++)l+=sqrt(pow(s.at(i).fist-s.at(i-1).fist,2)+pow(s.at(i).second-s.at(i-1).second,2));
      |                                                            ^~~~
      |                                                            first
Language: C++

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define N 8
int main()
{
    int x[N],y[N],n;
    double points=0;
    cin >> n;
    for (int i=0; i<n;i++)
    {
        cin >> x[i] >>y[i];
    }
    for (int i=0; i<n-1;i++)
    {
        for (int j=i+1; j<n;j++)
        {
            points+=sqrt(((x[i]-x[j])*(x[i]-x[j]))+((y[i]-y[j])*(y[i]-y[j])))
        }
    }
    cout << points * 2 / n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:78: error: expected ';' before '}' token
   19 |             points+=sqrt(((x[i]-x[j])*(x[i]-x[j]))+((y[i]-y[j])*(y[i]-y[j])))
      |                                                                              ^
      |                                                                              ;
   20 |         }
      |         ~
Language: Java

 java.util.Scanner;

class Main {

  static int sqr(int x) {
    return x * x;
  }

  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    
    int n = stdIn.nextInt();
    
    int[] x = new int[8];
    int[] y = new int[8];
    
    for (int i = 0; i < n; i++) {
      x[i] = stdIn.nextInt();
      y[i] = stdIn.nextInt();
    }
    
    double sum = 0;
    for (int i = 0; i < n-1; i++) {
      for(int j = 1; j < n; j++) {
        sum += Math.sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j]));
      }
    }
    
    System.out.println(sum * 2 / n);
  }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
 java.util.Scanner;
 ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)


int main(){
    int n; cin >> n;
    vector<int> x(n); vector<int> y(n);
    rep(i,n) cin >> x[i] >> y[i];
    auto dist = [&](int i, int j){
        double dx = x[i] - x[j];
        double dy = y[i] - y[j];
        return sqrt(dx*dx+dy*dy);
    };
    vector<int> p(n);
    rep(i,n) p[i] = i;
    double len=0;
    int cnt=0;
    do{
        rep(i, n-1){
            len +=dist(p[i], p[i+1]);
        }
        cnt++;
    } while (next_permutation(p.begin(), p.end()));
    double ans = len/cnt;
    printf("%.10f\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'next_permutation' was not declared in this scope
   26 |     } while (next_permutation(p.begin(), p.end()));
      |              ^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N; cin >> N;
  vector<pair<double,double>> A(N);
  for(int i=0;i<N;i++){
    cin >> A[i].first >> A[i].second;
  }
  double ans=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      double x=A[i].first-A[j].first;
      double y=A[i].second-A[j].second;
      ans+=sqrt(x*x+y*y);
    }
  }
  cout << fixed << setprecision(10);
  cout << ans*2/N << endl;
  return 0;
}
  cout << 
  

Compiler output:
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout <<
      |   ^~~~