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

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
Int N, mod;
vector<vector<Int>>edge;
vector<Int>ans,dis;
Int dfs(Int v, Int prev){
    for(auto nv : edge[v]){
        if(nv == prev) continue;
        dis[v] += dfs(nv,v);
        dis[v] %= mod;
    }
    dis[v] += 1;
    dis[v] %= mod;
    return dis[v];
}
void solve(Int v, Int dis_prev, Int prev){
    Int res = 0;
    for(auto nv : edge[v]){
        if(nv == prev) res
        res += dis[nv];
        res %= mod;
    }
    ans[v] = res;
    
    return;
}
int main(){
    cin >> N >> mod;
    edge = vector<vector<Int>>(N);
    for(Int i = 0; i < N - 1; ++i){
        Int u,v; cin >> u >> v;
        --u,--v;
        edge[u].emplace_back(v);
        edge[v].emplace_back(u);
    }
    Int root  = 0;
    dis = vector<Int>(N,0LL);
    ans = vector<Int>(N,0LL);
    dfs(root,-1);
    solve(root,0,-1);
    for(auto e : ans){
        cout << e << endl;
    }
}


Compiler output:
a.cc: In function 'void solve(Int, Int, Int)':
a.cc:20:27: error: expected ';' before 'res'
   20 |         if(nv == prev) res
      |                           ^
      |                           ;
   21 |         res += dis[nv];
      |         ~~~
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */


/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner s=new Scanner(System.in);
        
            
            int n=s.nextInt();
  
            int a[]=new int[n];
            int b[]=new int[n];
      for(int i=0;i<n;i++){
                a[i]=s.nextInt();
        b[i]=s.nextInt();
      }
      double d=0.0;
      
      for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
          d+=Math.sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
        }
      }
      System.out.format("%.6f",(2*d)/n));
    }
}

Compiler output:
Main.java:34: error: ';' expected
      System.out.format("%.6f",(2*d)/n));
                                       ^
1 error
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
int main()
{
  int n;
  cin>>n;
  long double ff=0.0;
  vector <pair<int,int> > v;
  for(int i=0; i<n; i++)
  {
    int x, y;
    cin>>x>>y;
    v.push_back({x,y});
  }
  for(int i=0; i+1<n; i++)
  {
    for(int j=i+1; j<n; i++)
    {
      ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
    }
  }
  int sum = 1;
  for(int i=1; i<=n; i++) sum *= i;
  cout<<setprecision(20)<<(ff/(long double)n);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:128: error: expected ';' before '}' token
   21 |       ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
      |                                                                                                                                ^
      |                                                                                                                                ;
   22 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  long double ff=0.0;
  vector <pair<int,int> > v;
  for(int i=0; i<n; i++)
  {
    int x, y;
    cin>>x>>y;
    v.push_back({x,y});
  }
  for(int i=0; i+1<n; i++)
  {
    for(int j=i+1; j<n; i++)
    {
      ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
    }
  }
  int sum = 1, sum2 =1;
  for(int i=1; i<=n-2; i++) sum2 *= i;
  for(int i=1; i<=n; i++) sum *= i;
  cout<<setprecision(20)<<(ff/(long double)sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:128: error: expected ';' before '}' token
   21 |       ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
      |                                                                                                                                ^
      |                                                                                                                                ;
   22 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin>>n;
  long double ff=0.0;
  vector <pair<int,int> > v;
  for(int i=0; i<n; i++)
  {
    int x, y;
    cin>>x>>y;
    v.push_back({x,y});
  }
  for(int i=0; i+1<n; i++)
  {
    for(int j=i+1; j<n; i++)
    {
      ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
    }
  }
  int sum = 1;
  for(int i=1; i<=n; i++) sum *= i;
  cout<<setprecision(20)<<(ff/(long double)sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:128: error: expected ';' before '}' token
   21 |       ff += sqrt((v[i].first - v[j].first)*(v[i].first - v[j].first) + (v[i].second - v[j].second)*(v[i].second - v[j].second))
      |                                                                                                                                ^
      |                                                                                                                                ;
   22 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 10;
int town[N][2];
int n;

double calDist(int x, int y) {
	return sqrt((town[x][0] - town[y][0]) * (town[x][0] - town[y][0]) * 1.0 + (town[x][1] - town[y][1]) * (town[x][1] - town[y][1])); 
}

int main() {
	cin>>n;
  	int ret = 1;
  	for(int i=1;i<n;i++)
      ret *= i;
  	
  	for(int i=0;i<n;i++) {
    	cin>>town[i][0]>>town[i][1];
    }
  
  	double sum = 0.0;
  	for(int i=0;i<n-1;i++) {
      for(int j=i+1;j<n;j++) {
          sum += ret * calDist(i, j);
      }
    }
    sum = sum / (ret * n * 1.0)
  	cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:32: error: expected ';' before 'cout'
   27 |     sum = sum / (ret * n * 1.0)
      |                                ^
      |                                ;
   28 |         cout<<sum<<endl;
      |         ~~~~
Language: C++

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

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];
  }
  
  double ans = 0.0;
  
  for(int i = 0; i < N; ++i){
    for(int j = i+1; j < N; ++j){
      double d = sqrt(pow(abs(x[j]-x[i]), 2) + pow(abs(y[j]-y[i]), 2));
      ans += d * 2 / N
    }
  }
  
  cout << setprecision(10) << ans << endl;
  
  return 0;
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected ';' before '}' token
   21 |       ans += d * 2 / N
      |                       ^
      |                       ;
   22 |     }
      |     ~
Language: C++

#inckude<iostream>
#include<vector>
#include<iomanip>
#include<cmath>

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];
  }
  
  double ans = 0.0;
  
  for(int i = 0; i < N; ++i){
    for(int j = i+1; j < N; ++j){
      double d = sqrt(pow(abs(x[j]-x[i]), 2) + pow(abs(y[j]-y[i]), 2));
      ans += d * 2 / N
    }
  }
  
  cout << setprecision(10) << ans << endl;
  
  return 0;
}
    
  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inckude; did you mean #include?
    1 | #inckude<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:9:10: error: 'cin' was not declared in this scope
    9 |   int N; cin >> N;
      |          ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<cmath>
  +++ |+#include <iostream>
    5 | 
a.cc:21:23: error: expected ';' before '}' token
   21 |       ans += d * 2 / N
      |                       ^
      |                       ;
   22 |     }
      |     ~                  
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << setprecision(10) << ans << endl;
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii  = pair<int,int>;
const int INF=1001001001;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define MOD 1000000007
#define EPS 10e-8
int gcd(ll a,ll b){return b?gcd(b,a%b):a;}    //最大公約数
int lcm(int a, int b) {return a * b / gcd(a, b);}   //最小公倍数
const ll MAXN = 1001024; // b-a < MAXN, sqrt(b) < MAXN


int main(){
    double n;
    cin >> n;
    double x[n], y[n];
    double cnt = 0;
    rep(i, n)
    {
        cin >> x[i] >> y[i];
    }
    rep(j,n-1){
        rep2(i,j+1,n){
            cnt += (double)pow((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]), 0.5);
        }
    }
    cout << (double)cnt*2/n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   18 |     double x[n], y[n];
      |              ^
a.cc:18:14: error: could not convert 'n' from 'double' to 'long unsigned int'
   18 |     double x[n], y[n];
      |              ^
      |              |
      |              double
a.cc:18:14: error: size of array 'x' has non-integral type 'double'
a.cc:18:20: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   18 |     double x[n], y[n];
      |                    ^
a.cc:18:20: error: could not convert 'n' from 'double' to 'long unsigned int'
   18 |     double x[n], y[n];
      |                    ^
      |                    |
      |                    double
a.cc:18:20: error: size of array 'y' has non-integral type 'double'
Language: Java

        int N  = sc.nextInt();
        int [] X = new int[N];
        int [] Y = new int[N];
        double sum = 0;
        int time = 1;
        int n =1;
        for(int i=N-1;i>0;i--) time*=i;
        for(int i=N;i>0;i--) n*=i;
        time*=2;
        for(int i=0;i<N;i++){
            X[i] = sc.nextInt();
            Y[i] = sc.nextInt();
        }
        for(int i=0;i<N;i++){
            for(int j=i+1;j<N;j++){
                double x = Math.pow(X[i]-X[j],2);
                double y = Math.pow(Y[i]-Y[j],2);
                double dis = Math.sqrt(x+y)*time;
                sum+=dis;
            }
        }
        sum/=n;
        System.out.println(sum);

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
        int N  = sc.nextInt();
        ^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
        for(int i=N-1;i>0;i--) time*=i;
        ^
Main.java:7: error: class, interface, enum, or record expected
        for(int i=N-1;i>0;i--) time*=i;
                      ^
Main.java:7: error: class, interface, enum, or record expected
        for(int i=N-1;i>0;i--) time*=i;
                          ^
Main.java:8: error: class, interface, enum, or record expected
        for(int i=N;i>0;i--) n*=i;
        ^
Main.java:8: error: class, interface, enum, or record expected
        for(int i=N;i>0;i--) n*=i;
                    ^
Main.java:8: error: class, interface, enum, or record expected
        for(int i=N;i>0;i--) n*=i;
                        ^
Main.java:9: error: class, interface, enum, or record expected
        time*=2;
        ^
Main.java:10: error: class, interface, enum, or record expected
        for(int i=0;i<N;i++){
        ^
Main.java:10: error: class, interface, enum, or record expected
        for(int i=0;i<N;i++){
                    ^
Main.java:10: error: class, interface, enum, or record expected
        for(int i=0;i<N;i++){
                        ^
Main.java:12: error: class, interface, enum, or record expected
            Y[i] = sc.nextInt();
            ^
Main.java:13: error: class, interface, enum, or record expected
        }
        ^
Main.java:14: error: class, interface, enum, or record expected
        for(int i=0;i<N;i++){
                    ^
Main.java:14: error: class, interface, enum, or record expected
        for(int i=0;i<N;i++){
                        ^
Main.java:15: error: class, interface, enum, or record expected
            for(int j=i+1;j<N;j++){
                          ^
Main.java:15: error: class, interface, enum, or record expected
            for(int j=i+1;j<N;j++){
                              ^
Main.java:19: error: class, interface, enum, or record expected
                sum+=dis;
                ^
Main.java:20: error: class, interface, enum, or record expected
            }
            ^
Main.java:23: error: class, interface, enum, or record expected
        System.out.println(sum);
        ^
20 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct z{
  int x;
  int y;
}

double distance(z a,z b){
  return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

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

int main(){
  int n;
  double sum=0;
  cin >> n;
  vector<z> place(n);
  vector<vector<double>> vector<double>d(n);
  for(int i=0;i<n ;i++){
    cin >> place.at(i).x;
    cin >> place.at(i).y;
  }
  for(int i=0;i<n;i++)
    for(int j=i+1;j<n;i++)
      sum += d.at(i).push_back(distance(place.at(i),place(j)));
  
  printf("%0.11lf\n",(n-1)*2*sum/kai(n));

}



Compiler output:
a.cc:6:2: error: expected ';' after struct definition
    6 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:22:40: error: invalid declarator before 'd'
   22 |   vector<vector<double>> vector<double>d(n);
      |                                        ^
a.cc:29:14: error: 'd' was not declared in this scope
   29 |       sum += d.at(i).push_back(distance(place.at(i),place(j)));
      |              ^
a.cc:29:58: error: no match for call to '(std::vector<z>) (int&)'
   29 |       sum += d.at(i).push_back(distance(place.at(i),place(j)));
      |                                                     ~~~~~^~~
Language: C++

#include <iostream>
#include <vector>

int Factorial(int n)
{
	int res = 1;
	for (int i = 2; i <= n; ++i)
	{
		res *= i;
	}
	return res;
}

int main()
{
	int n = 0;
	std::cin >> n;
	int inputX = 0;
	int inputY = 0;
	std::vector<int> vx(n);
	std::vector<int> vy(n);
	for (int i = 0; i < n; ++i)
	{
		std::cin >> inputX >> inputY;
		vx.at(i) = inputX;
		vy.at(i) = inputY;
	}
	long double average = 0.0;
	for (int i = 0; i < n; ++i)
	{
		for (int j = i + 1; j < n; ++j)
		{
			average += std::sqrt(std::pow((vx.at(i)-vx.at(j)),2)+ std::pow((vy.at(i) - vy.at(j)), 2));
		}
	}
	std::cout << average * 2 * (n - 1) / Factorial(n) << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:41: error: 'sqrt' is not a member of 'std'
   33 |                         average += std::sqrt(std::pow((vx.at(i)-vx.at(j)),2)+ std::pow((vy.at(i) - vy.at(j)), 2));
      |                                         ^~~~
a.cc:33:51: error: 'pow' is not a member of 'std'
   33 |                         average += std::sqrt(std::pow((vx.at(i)-vx.at(j)),2)+ std::pow((vy.at(i) - vy.at(j)), 2));
      |                                                   ^~~
a.cc:33:84: error: 'pow' is not a member of 'std'
   33 |                         average += std::sqrt(std::pow((vx.at(i)-vx.at(j)),2)+ std::pow((vy.at(i) - vy.at(j)), 2));
      |                                                                                    ^~~
Language: C++

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

int main(void){
	int N;
	cin >> N;
	int *x, *y;
	x = new int [N];
	y = new int [N];
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	
	double distance = 0;
	for (int i = 1; i < N; i++) {
		for (int j = 0; j < i; j++) {
			distance += sqrt( (x[i]-x[j]) * (x[i]-x[j]) + (y[i]-y[j]) * (y[i]-y[j]) );
        	}
		}
	}
	
	int S = N*(N-1)/2;
	distance /= S;
	cout << distance << endl;

	delete[] x;
	delete[] y;
	return 0;
}



Compiler output:
a.cc:23:17: error: 'N' was not declared in this scope
   23 |         int S = N*(N-1)/2;
      |                 ^
a.cc:23:20: error: 'N' was not declared in this scope
   23 |         int S = N*(N-1)/2;
      |                    ^
a.cc:24:9: error: 'distance' does not name a type
   24 |         distance /= S;
      |         ^~~~~~~~
a.cc:25:9: error: 'cout' does not name a type
   25 |         cout << distance << endl;
      |         ^~~~
a.cc:27:9: error: expected unqualified-id before 'delete'
   27 |         delete[] x;
      |         ^~~~~~
a.cc:28:9: error: expected unqualified-id before 'delete'
   28 |         delete[] y;
      |         ^~~~~~
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main(void){
	int N;
	cin >> N;
	int *x, *y;
	x = new int [N];
	y = new int [N];
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	
	double distance = 0;
	for (int i = 1; i < N; i++) {
		for (int j = 0; j < i; j++) {
			distance += sqrt( (x[i]-x[j]) * (x[i]-x[j]) + (y[i]-y[j]) * (y[i]-y[j]) );
		 	)
		}
	}
	
	int S = N*(N-1)/2;
	distance /= S;
	cout << distance << endl;

	delete[] x;
	delete[] y;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected primary-expression before ')' token
   19 |                         )
      |                         ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n,vector<int>(2));
  for(int i=0;i<n;i++){
    cin >> a.at(i).at(0) >> a.at(i).at(1);
  }
  
  double ans=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      int A = a.at(i).at(0) - a.at(j).at(0);
      int B = a.at(i).at(1) - a.at(j).at(1);
      ans += sqrt(A*A) + sqrt(B*B);
    }
  }
  int k=1;
  int i=1;
  while(i <= n){
    k *= i;
    i++;
  }
  cout << ans/k << endl;
  
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <math.h>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<vector<int>> a(n,vector<int>(2));
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   vector<vector<int>> a(n,vector<int>(2));
      |                 ^~~
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a.at(i).at(0) >> a.at(i).at(1);
      |            ^
a.cc:16:15: error: 'a' was not declared in this scope
   16 |       int A = a.at(i).at(0) - a.at(j).at(0);
      |               ^
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << ans/k << endl;
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |   cout << ans/k << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <math.h>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n,vector<int>(2));
  for(int i=0;i<n;i++){
    cin >> a.at(i).at(0) >> a.at(i).at(1);
  }
  
  double ans=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      int A = a.at(i).at(0) - a.at(j).at(0);
      int B = a.at(i).at(1) - a.at(j).at(1);
      ans += sqrt(A*A) + sqtr(B*B);
    }
  }
  int k=1;
  int i=1;
  while(i <= n){
    k *= i;
    i++;
  }
  cout << ans/k << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'sqtr' was not declared in this scope; did you mean 'sqrt'?
   18 |       ans += sqrt(A*A) + sqtr(B*B);
      |                          ^~~~
      |                          sqrt
Language: C

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[i] = make_pair(x, y);
  }

  vector<int> l(n);
  iota(l.begin(), l.end(), 0);
  
  double total = 0;
  int c = 0;
  do {
    for (int i = 0; i < n - 1; i++) {
      int i1 = l[i], i2 = l[i+1];
      int x1, y1, x2, y2;
      tie(x1, y1) = v[i1];
      tie(x2, y2) = v[i2];
      total += sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
    }
    c++;
  } while (next_permutation(l.begin(), l.end()));

  cout << total / c << endl;
  
  return 0;
}


Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      
      int[8][2] array = new int[][];
      for (int i = 0; i < N; ++i) {
          // i番目のx座標
          array[i][0] = sc.nextInt();
          // i番目のy座標
          array[i][1] = sc.nextInt();
      }
      
      double total = 0.0d;
      
      // 全道の長さの和を求める
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          if (i == j) continue;
          total += Math.sqrt(nijo(array[i][0] - array[j][0]) + nijo(array[i][1] - array[j][1]));
        }
      }
      
      System.out.println(2.0d * total / N);
      
    }
  
  private int nijo(int x) { return x * x;}
}

Compiler output:
Main.java:8: error: ']' expected
      int[8][2] array = new int[][];
          ^
Main.java:8: error: not a statement
      int[8][2] array = new int[][];
         ^
Main.java:8: error: array dimension missing
      int[8][2] array = new int[][];
                                   ^
3 errors
Language: C++

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

int main(){
  int n; cin>>n;
  vector<pair<int, int>> g(n);
  for(int i=0;i<n;i++){
    cin>>g[i].first >>g[i].second;
  }
  
  long long sum=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      sum+=sqrt((g[i].first-g[j].first)**2+(g[i].second-g[j].second)**2);
    }
  }
  
  cout<<sum*n/2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: invalid type argument of unary '*' (have 'int')
   14 |       sum+=sqrt((g[i].first-g[j].first)**2+(g[i].second-g[j].second)**2);
      |                                         ^~
a.cc:14:70: error: invalid type argument of unary '*' (have 'int')
   14 |       sum+=sqrt((g[i].first-g[j].first)**2+(g[i].second-g[j].second)**2);
      |                                                                      ^~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
struct point {
	int x;
	int y;
};

double dis(point a, point b) {
	return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main() {
	int n;
	cin >> n;
	cout << fixed;
	cout.precision(10);
	point arr[8];
	int perm[8];
	for (int i = 0; i < n; i++) {
		perm[i] = i;
	}
	for (int i = 0; i < n; i++) {
		cin >> arr[i].x >> arr[i].y;
	}
	double fact = 1;
	for (int i = 1; i <= n; i++)
		fact *= i;
	double sum = 0;
	do {
		for (int i = 0; i < n - 1; i++)
			sum += dis(arr[perm[i]], arr[perm[i + 1]]);
	} while (next_permutation(perm, perm + n));
	cout << sum / fact << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'double dis(point, point)':
a.cc:11:16: error: 'sqrt' was not declared in this scope
   11 |         return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  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 ans=0;
  for(int i=0; i<n-1; i++){
    for(int j=i; j<n; j++){
      ans += sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
    }
  }
  ans *= 2/n;
  cout << setpretension(10) << ans << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'setpretension' was not declared in this scope
   18 |   cout << setpretension(10) << ans << endl;
      |           ^~~~~~~~~~~~~
Language: C++


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] x = new int[n];
		int[] y = new int[n];
		for (int i = 0; i < n; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
		}
		double r = solve(n, x, y);
		System.out.println(r);
		in.close();
	}

	private static double solve(int n, int[] x, int[] y) {
		float r = 0;
		for (int i = 0; i < n; i++)
			r += sum(i, 1 << i, n, x, y);
		return r / n;
	}

	private static double sum(int p, int st, int n, int[] x, int[] y) {
		double r = 0;
		int c = 0;
		for (int i = 0; i < n; i++)
			if ((st & (1 << i)) == 0) {
				c++;
				r += sum(i, st | (1 << i), n, x, y)
						+ Math.pow(Math.pow(x[p] - x[i], 2) + Math.pow(y[p] - y[i], 2), 0.5);
			}
		if (c > 0)
			return r / c;
		else
			return 0;
	}

}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Arrays;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.Scanner;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
    7 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int N;
int x[10], y[10];
 
double dist(int i, int j) {
    double dx = x[i] - x[j];
    double dy = y[i] - y[j];
    return pow(dx * dx + dy * dy, 0.5);
}
 
void solve() {
    cin >> N;
    for(int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for(int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for(int i = 0; i < N - 1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));
    int Factorial = 1;
    for(int i = 2; i <= N; i++) Factorial *= i;
    cout << sum / Factorial << endl;
    return;
}
 

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iomanip>
#include <iostream>
#include <limits>
#include <utility>
#include <vector>

using namespace std;

double dis(double x1, double y1, double x2, double y2) {
	return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}

int main() {
	cout << fixed;
	cout << setprecision(numeric_limits<double>::max_digits10);

	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 sumDis = 0;
	for(int i = 0; i < N; i++) {
		for(int j = i; j < N; j++) {
			const double d = dis(x[i], y[i], x[j], y[j]);
			sumDis += d;
		}
	}

	const double result = (2 * sumDis) / N;
	cout << result << endl;

	return 0;
}


Compiler output:
a.cc: In function 'double dis(double, double, double, double)':
a.cc:10:21: error: 'pow' was not declared in this scope
   10 |         return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
      |                     ^~~
a.cc:10:16: error: 'sqrt' was not declared in this scope
   10 |         return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
      |                ^~~~
Language: C++

#include <iomanip>
#include <iostream>
#include <utility>
#include <vector>

using namespace std;

double dis(double x1, double y1, double x2, double y2) {
	return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}

int main() {
	cout << fixed;
	cout << setprecision(numeric_limits<double>::max_digits10);

	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 sumDis = 0;
	for(int i = 0; i < N; i++) {
		for(int j = i; j < N; j++) {
			const double d = dis(x[i], y[i], x[j], y[j]);
			sumDis += d;
		}
	}

	const double result = (2 * sumDis) / N;
	cout << result << endl;

	return 0;
}


Compiler output:
a.cc: In function 'double dis(double, double, double, double)':
a.cc:9:21: error: 'pow' was not declared in this scope
    9 |         return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
      |                     ^~~
a.cc:9:16: error: 'sqrt' was not declared in this scope
    9 |         return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
      |                ^~~~
a.cc: In function 'int main()':
a.cc:14:30: error: 'numeric_limits' was not declared in this scope
   14 |         cout << setprecision(numeric_limits<double>::max_digits10);
      |                              ^~~~~~~~~~~~~~
a.cc:14:45: error: expected primary-expression before 'double'
   14 |         cout << setprecision(numeric_limits<double>::max_digits10);
      |                                             ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;

int main() {
	int n;
	cin >> n;
	vector<double>x(n), y(n);
	for (int i = 1;i <= n;++i) {
		cin >> x[i] >> y[i];
	}
	double sum = 0.0;
	vector<int>a(n);
	for (int i = 1;i <= n;++i) {
		a[i] = i;
	}
	do {
		for (int i = 1;i < n;++i) {
			sum += sqrt((x[a[i]] - x[a[i + 1]]) * (x[a[i]] - x[a[i + 1]]) + (y[a[i]] - y[a[i + 1]]) * (y[a[i]] - y[a[i + 1]]))
		}
	} while (next_permutation(a.begin(), a.end()));
	double Factorial = 1;
	for (int i = 2;i <= n;++i)Factorial *= i;
	printf("%.12lf\n", sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:139: error: expected ';' before '}' token
   21 |                         sum += sqrt((x[a[i]] - x[a[i + 1]]) * (x[a[i]] - x[a[i + 1]]) + (y[a[i]] - y[a[i + 1]]) * (y[a[i]] - y[a[i + 1]]))
      |                                                                                                                                           ^
      |                                                                                                                                           ;
   22 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  double ans=0;
  vector<double> s(n);
  for(int i=0;i<n;i++)cin>>s.at(i);
  sort(s.begin(),s.end());
  do{
    for(int i=1;i<n;i++){
      ans+=s.at(i)-s.at(i-1);
    }
  }while(next_permutation(s.begin(),s.end()));
  for(int i=1;i<n+1;i++)ans/=i;
  cout<<setprecition(12)<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'setprecition' was not declared in this scope
   15 |   cout<<setprecition(12)<<ans<<endl;
      |         ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  double ans=0;
  vector<double> s(n);
  for(int i=0;i<n;i++)cin>>s.at(i);
  sort(s.begin(),s.end());
  do{
    for(int i=1;i<n<i++){
      ans+=s.at(i)-s.at(i-1);
    }
  }while(next_permutation(s.begin(),s.end()));
  for(int i=1;i<n+1;i++)ans/=i;
  cout<<setprecisition(12)<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before ')' token
   10 |     for(int i=1;i<n<i++){
      |                        ^
      |                        ;
a.cc:15:9: error: 'setprecisition' was not declared in this scope
   15 |   cout<<setprecisition(12)<<ans<<endl;
      |         ^~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
using namespace std;
int fact(int n) {
  if (n <= 1) {
	  return 1;
	}
  else {
	  return n * fact(n - 1);
	}
}

int main() {
  int N;
  cin >> N;
  vector <int> x(N);
  vector <int> y(N);
  vector <int> v(N);
  double ans = 0.0;
  for (int i = 0; i < N; i++) {
	  cin >> x[i] >> y[i];
	  v[i] = i;
	}
  do {
	  double dist = 0.0;
	  for (int i = 0; i < N - 1; i++) {
		  dist += sqrt((x[v[i]] - x[v[i + 1]]) * (x[v[i]] - x[v[i + 1]]) + (y[v[i]] - y[v[i + 1]]) * (y[v[i]] - y[v[i + 1]]));
		}
	  ans += dist / fact(N);
	} while (next_permutation(v.begin(), v.end()));
  printf("%10f\n", ans);
  return 0;
}


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

#include <iostream>
#include <iomanip>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
using namespace std;
int fact(int n) {
  if (n <= 1) {
	  return 1;
	}
  else {
	  return n * fact(n - 1);
	}
}

int main() {
  int N;
  cin >> N;
  vector <int> x(N);
  vector <int> y(N);
  vector <int> v(N);
  double ans = 0.0;
  for (int i = 0; i < N; i++) {
	  cin >> x[i] >> y[i];
	  v[i] = i;
	}
  do {
	  double dist = 0.0;
	  for (int i = 0; i < N - 1; i++) {
		  dist += sqrt((x[v[i]] - x[v[i + 1]]) * (x[v[i]] - x[v[i + 1]]) + (y[v[i]] - y[v[i + 1]]) * (y[v[i]] - y[v[i + 1]]));
		}
	  ans += dist / fact(N);
	} while (next_permutation(v.begin(), v.end()));
  printf("%10f\n", ans);
  return 0;
}


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

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;

int x[10], y[10];
double dist(int i, int j) {
	double dx = x[i] - x[j];
	double dy = y[i] - y[j];
	return pow(dx * dx + dy * dy, 0.5);
}
int main() {
	int n;
	cin >> n;
	vector<double>x(n), y(n);
	for (int i = 1;i <= n;++i) {
		cin >> x[i] >> y[i];
	}
	double sum = 0.0;
	vector<int>v(n);
	for (int i = 1;i <= n;++i) {
		v[i] = i;
	}
	do {
		for (int i = 1;i < n - 1;++i) {
			sum += dist(v[i], v[i + 1]);
		}
	} while (next_permutation(v.begin, v.end()));
	int Factorial = 1;
	for (int i = 2;i <= n;++i)Factorial *= i;
	cout << sum / Factorial << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: no matching function for call to 'next_permutation(<unresolved overloaded function type>, std::vector<int>::iterator)'
   29 |         } while (next_permutation(v.begin, v.end()));
      |                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2939:5: note: candidate: 'bool std::next_permutation(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2939:45: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note: candidate: 'template<class _BIter, class _Compare> bool std::next_permutation(_BIter, _BIter, _Compare)'
 2972 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;

int x[10], y[10];
double dist(int i, int j) {
	double dx = x[i] - x[j];
	double dy = y[i] - y[j];
	return pow(dx * dx + dy * dy, 0.5);
}
int main() {
	int n;
	cin >> n;
	vector<double>x(n), y(n);
	for (int i = 1;i <= n;++i) {
		cin >> x[i] >> y[i];
	}
	double sum = 0.0;
	vector<int>v(n);
	for (int i = 1;i <= n;++i) {
		v[i] = i;
	}
	do {
		for (int i = 1;i < n - 1;++i) {
			sum += dist(v[i], v[i + 1]);
		}
	} while (next_permutation(v.begin, v.end());
	int Factorial = 1;
	for (int i = 2;i <= n;++i)Factorial *= i;
	cout << sum / Factorial << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: no matching function for call to 'next_permutation(<unresolved overloaded function type>, std::vector<int>::iterator)'
   29 |         } while (next_permutation(v.begin, v.end());
      |                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2939:5: note: candidate: 'bool std::next_permutation(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2939:45: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note: candidate: 'template<class _BIter, class _Compare> bool std::next_permutation(_BIter, _BIter, _Compare)'
 2972 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note:   candidate expects 3 arguments, 2 provided
a.cc:29:52: error: expected ')' before ';' token
   29 |         } while (next_permutation(v.begin, v.end());
      |                 ~                                  ^
      |                                                    )
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;

double dist(int i, int j) {
	double dx = x[i] - x[j];
	double dy = y[i] - y[j];
	return pow(dx * dx + dy * dy, 0.5);
}
int main() {
	int n;
	cin >> n;
	vector<double>x(n), y(n);
	for (int i = 1;i <= n;++i) {
		cin >> x[i] >> y[i];
	}
	double sum = 0.0;
	vector<int>v(n);
	for (int i = 1;i <= n;++i) {
		v[i] = i;
	}
	do {
		for (int i = 1;i < n - 1;++i) {
			sum += dist(v[i], v[i + 1]);
		}
	} while (next_permutation(v.begin, v.end());
	int Factorial = 1;
	for (int i = 2;i <= n;++i)Factorial *= i;
	cout << sum / Factorial << endl;
}

Compiler output:
a.cc: In function 'double dist(int, int)':
a.cc:8:21: error: 'x' was not declared in this scope; did you mean 'dx'?
    8 |         double dx = x[i] - x[j];
      |                     ^
      |                     dx
a.cc:9:21: error: 'y' was not declared in this scope; did you mean 'dy'?
    9 |         double dy = y[i] - y[j];
      |                     ^
      |                     dy
a.cc: In function 'int main()':
a.cc:28:34: error: no matching function for call to 'next_permutation(<unresolved overloaded function type>, std::vector<int>::iterator)'
   28 |         } while (next_permutation(v.begin, v.end());
      |                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2939:5: note: candidate: 'bool std::next_permutation(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2939:45: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note: candidate: 'template<class _BIter, class _Compare> bool std::next_permutation(_BIter, _BIter, _Compare)'
 2972 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2972:5: note:   candidate expects 3 arguments, 2 provided
a.cc:28:52: error: expected ')' before ';' token
   28 |         } while (next_permutation(v.begin, v.end());
      |                 ~                                  ^
      |                                                    )
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<int> x(N);
vector<int> y(N);
double rout(int i,int j){
  double dx = x[i] - x[j];
  double dy = y[i] - y[j];
  return pow(dx*dx + dy*dy, 0.5);
}

int main(void){
  int N;
  cin >> N;
  for(int i=0; i < N; ++i){
    cin >> x.at(i) >> y.at(i);
  }
  double sum;
  vector<int> v(N);
  for(int i=0; i < N; i++) v[i] = i+1;
  do{
    for(int i = 0; i < N-1; i++) sum += rout(v[i], v[i+1]);
  }while(next_permutation(v.begin(),v.end()));
  int Factorial = 1;
  for(int i=2; i <= N; i++) Factorail *= i;
  cout << fixed << setprecision(10) << sum / Factorial << endl;
  return 0;
}

Compiler output:
a.cc:3:15: error: 'N' was not declared in this scope
    3 | vector<int> x(N);
      |               ^
a.cc:4:15: error: 'N' was not declared in this scope
    4 | vector<int> y(N);
      |               ^
a.cc: In function 'int main()':
a.cc:24:29: error: 'Factorail' was not declared in this scope; did you mean 'Factorial'?
   24 |   for(int i=2; i <= N; i++) Factorail *= i;
      |                             ^~~~~~~~~
      |                             Factorial
Language: C++

#include <bits/stdc++.h>
using namespace std;
double rout(int i,int j){
  double dx = x[i] - x[j];
  double dy = y[i] - y[j];
  return pow(dx*dx + dy*dy, 0.5);
}

int main(void){
  int N;
  cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  for(int i=0; i < N; ++i){
    cin >> x.at(i) >> y.at(i);
  }
  double sum;
  vector<int> v(N);
  for(int i=0; i < N; i++) v[i] = i+1;
  do{
    for(int i = 0; i < N-1; i++) sum += rout(v[i], v[i+1]);
  }while(next_permutation(v.begin(),v.end()));
  int Factorial = 1;
  for(int i=2; i <= N; i++) Factorail *= i;
  cout << fixed << setprecision(10) << sum / Factorial << endl;
  return 0;
}

Compiler output:
a.cc: In function 'double rout(int, int)':
a.cc:4:15: error: 'x' was not declared in this scope; did you mean 'dx'?
    4 |   double dx = x[i] - x[j];
      |               ^
      |               dx
a.cc:5:15: error: 'y' was not declared in this scope; did you mean 'dy'?
    5 |   double dy = y[i] - y[j];
      |               ^
      |               dy
a.cc: In function 'int main()':
a.cc:24:29: error: 'Factorail' was not declared in this scope; did you mean 'Factorial'?
   24 |   for(int i=2; i <= N; i++) Factorail *= i;
      |                             ^~~~~~~~~
      |                             Factorial
Language: Java

import java.util.*;
import java.lang.*;

public class Main {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    List<Position> positions = new ArrayList<Position>();
    
    int n = sc.nextInt();
    for (int i = 0 ; i < n ; i++){
      int x = sc.nextInt();
      int y = sc.nextInt();
      positions.add(new Position(x,y));
    }
    
    int c = 0;
    double distances = 0.0;
    for(int i = 0 ; i < positions.size() ; i++){
      for(int y = 0 ; y < positions.size() ; y++){
        if(i == y){
          continue;
        }
        c++;
        distances += calcDistance(positions.get(i), positions.get(y));
      }
    }
    System.out.println((distances / c));
  }
  
  static double calcDistance(Position a, Position b){
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
  }
  
  public class Position{
    public int x;
    public int y;
    
    public Position(int x, int y){
      this.x = x;
      this.y = y;
    }
  }
}

Compiler output:
Main.java:13: error: non-static variable this cannot be referenced from a static context
      positions.add(new Position(x,y));
                    ^
Main.java:31: error: method pow in class Math cannot be applied to given types;
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
                         ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
Main.java:31: error: method pow in class Math cannot be applied to given types;
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
                                               ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
3 errors
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    List<Position> positions = new ArrayList<Position>();
    
    int n = sc.nextInt();
    for (int i = 0 ; i < n ; i++){
      int x = sc.nextInt();
      int y = sc.nextInt();
      positions.add(new Position(x,y));
    }
    
    int c = 0;
    double distances = 0.0;
    for(int i = 0 ; i < positions.size() ; i++){
      for(int y = 0 ; y < positions.size() ; y++){
        if(i == y){
          continue;
        }
        c++;
        distances += calcDistance(positions.get(i), positions.get(y));
      }
    }
    System.out.println((distances / c));
  }
  
  static double calcDistance(Position a, Position b){
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
  }
  
  public class Position{
    public int x;
    public int y;
    
    public Position(int x, int y){
      this.x = x;
      this.y = y;
    }
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    List<Position> positions = new ArrayList<Position>();
    ^
  symbol:   class List
  location: class Main
Main.java:6: error: cannot find symbol
    List<Position> positions = new ArrayList<Position>();
                                   ^
  symbol:   class ArrayList
  location: class Main
Main.java:12: error: non-static variable this cannot be referenced from a static context
      positions.add(new Position(x,y));
                    ^
Main.java:30: error: method pow in class Math cannot be applied to given types;
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
                         ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
Main.java:30: error: method pow in class Math cannot be applied to given types;
    return Math.sqrt(Math.pow(a.x - b.x) + Math.pow(a.y - b.y));
                                               ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
5 errors