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

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for(int i = 0; i < n; i++){
        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);
    for(int i = 0; i < n; i++){
        p[i] = i;
    }
    double len = 0;
    int cnt = 0;
    do {
        for(int i = 0; i < n-1; i++){
            len += dist(p[i] + p[i+1]);
        }
        cnt++;
    } while(next_permutation(p.begin(), p.end))
    double ans = let/cnt;
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: no match for call to '(main()::<lambda(int, int)>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   23 |             len += dist(p[i] + p[i+1]);
      |                    ~~~~^~~~~~~~~~~~~~~
a.cc:10:17: note: candidate: 'main()::<lambda(int, int)>'
   10 |     auto dist = [&](int i, int j){
      |                 ^
a.cc:10:17: note:   candidate expects 2 arguments, 1 provided
a.cc:26:29: error: no matching function for call to 'next_permutation(std::vector<int>::iterator, <unresolved overloaded function type>)'
   26 |     } while(next_permutation(p.begin(), p.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:2940:45: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 2940 |                      _BidirectionalIterator __last)
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/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:26:48: error: expected ';' before 'double'
   26 |     } while(next_permutation(p.begin(), p.end))
      |                                                ^
      |                                                ;
   27 |     double ans = let/cnt;
      |     ~~~~~~                                      
a.cc:27:18: error: 'let' was not declared in this scope; did you mean 'len'?
   27 |     double ans = let/cnt;
      |                  ^~~
      |                  len
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for(int i = 0; i < n; i++){
        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);
    for(int i = 0; i < n; i++){
        p[i] = i;
    }
    double len = 0;
    int cnt = 0;
    do {
        for(int i = 0; i < n-1; i++){
            len += dist(p[i] + p[i+1]);
        }
        cnt++;
    } while(next_permutation(p.begin(), p.end))
    double ans = let/cnt;
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected ',' or ';' before 'vector'
   15 |     vector<int> p(n);
      |     ^~~~~~
a.cc:17:9: error: 'p' was not declared in this scope
   17 |         p[i] = i;
      |         ^
a.cc:23:25: error: 'p' was not declared in this scope
   23 |             len += dist(p[i] + p[i+1]);
      |                         ^
a.cc:26:30: error: 'p' was not declared in this scope
   26 |     } while(next_permutation(p.begin(), p.end))
      |                              ^
a.cc:26:48: error: expected ';' before 'double'
   26 |     } while(next_permutation(p.begin(), p.end))
      |                                                ^
      |                                                ;
   27 |     double ans = let/cnt;
      |     ~~~~~~                                      
a.cc:27:18: error: 'let' was not declared in this scope; did you mean 'len'?
   27 |     double ans = let/cnt;
      |                  ^~~
      |                  len
Language: C++

import java.util.*;
import java.lang.Math;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int x[] = new int [n];
    int y[] = new int [n];
    double dis=0;
    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=0; j<n; j++){
        if(i!=j){
          int sx = x[i] - x[j];
          int sy = y[i] - y[j];
          dis+=Math.sqrt(sx*sx+sy*sy);
        }
      }
    }
    System.out.println(dis/n);
  }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.Math;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

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

int N;
int x[10], y[10];

double root(int i, int j) {
    int dx = x[i - 1] - x[j - 1];
    int dy = y[i - 1] - y[j - 1];
    return pow(dx * dx + dy * dy, 0.5);
}

int main() {
    cin >> N;
    for (int i = 0; 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 = 1; i < N; ++i) {
            sum += root(v[i-1], v[i]);
        }
    } while (next_permutation(v.begin(), v.end()));
    int Factorial = 1;
    for(int i = 2; i <= N; i++) Factorial *= i;

    cout << fixed << setprecision(10) << sum / Factorial << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: 'next_permutation' was not declared in this scope
   34 |     } while (next_permutation(v.begin(), v.end()));
      |              ^~~~~~~~~~~~~~~~
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 = 0; i < N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    do {
        for(int i = 0; i < N - 1; i++) sum += dist(i, i+1);
    } while(next_permutation(v.begin(), v.end()));
    int Factorial = 1;
    for(int i = 2; i <= N; i++) Factorial *= i;
    cout << fixed << setprecision(10) << sum / Factorial << endl;
    return;
}

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



Compiler output:
a.cc: In function 'void solve()':
a.cc:19:30: error: 'v' was not declared in this scope
   19 |     } while(next_permutation(v.begin(), v.end()));
      |                              ^
Language: C++

#include <stdio.h>
#include <iostream>

using namespace std;
#define N_MAX 8

int main(void){
    int N;
    float x[N_MAX], y[N_MAX];
    
    scanf("%d", &N);
    for(int i = 0; i < N; i++){
        int x_, y_;
        scanf("%d %d", &x_, &y_);
        x[i] = x_;
        y[i] = y_;
    }
    
    float dist_sum = 0;
    for(int i = 0; i < N; i++){
        for(int j = i + 1; j < N; j++){
            dist_sum += sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
        }
    }
    
    printf("%lf", dist_sum / N * 2);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'sqrt' was not declared in this scope
   22 |             dist_sum += sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
      |                         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
int x[8], y[8];
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=0;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;
    do {
        for(int i=0;i<n-1;++i) sum+=dist(v[i],v[i+1]);
            }
    while(next_permutation(v.begin(),v.end()));
    int count=1;
    for(int i=1;i<=n;++i) count*=i;
    cout << sum/count << endl;
    return;
}

int main() {
    solve();
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: expected '}' at end of input
   29 |     return 0;
      |              ^
a.cc:27:12: note: to match this '{'
   27 | int main() {
      |            ^
Language: C++

#include <iostream>
#include<string>
#include<vector>
#include<stdio.h>

using namespace std;


double zahyou[8][2];


double getdis(int i, int j) {
	double sum = 0;

	double dx, dy;

	dx = abs(zahyou[i][0] - zahyou[j][0]);
	dy = abs(zahyou[i][1] - zahyou[j][1]);

	return sqrt(dx * dx + dy * dy);
}




int main()
{
	int n;

	cin >> n;

	double wkx, wky;

	for (int i = 0; i < n; i++) {
		cin >> wkx;
		cin >> wky;

		zahyou[i][0] = wkx;
		zahyou[i][1] = wky;

	}

	double sum = 0;

	for (int i = 1; i < n; i++) {
		for (int j = 0; j < i; j++) {
			sum += getdis(i, j);
		}

	}

	sum *= 2;
	sum /= (double)n;

	printf("%.7lf\n", sum);





	return 0;

}



Compiler output:
a.cc: In function 'double getdis(int, int)':
a.cc:20:16: error: 'sqrt' was not declared in this scope
   20 |         return sqrt(dx * dx + dy * dy);
      |                ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <unordered_map>
#include <queue>

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

double calc_distance(pair<double, double> a, pair<double, double> b){
    double x = pow((a.first - b.first), 2);
    double y = pow((a.second - b.second), 2);
    return sqrt(x + y);
}

int main(){
    int N;
    cin >> N;
    vector<pair<double, double> > towns(N);
    rep(i,N){
        int x,y;
        cin >> x >> y;
        towns[i] = make_pair(x, y);
    }
    sort(towns.begin(), towns.end());
    double ans = 0;
    double count = 0;

    do{
        count++;
        rep(i,N-1){
            ans += calc_distance(towns[i], towns[i+1]);
        }
    } while(next_permutation(towns.begin(), towns.end()));
    printf("%.7f\n", ans/count);

}


Compiler output:
a.cc: In function 'double calc_distance(std::pair<double, double>, std::pair<double, double>)':
a.cc:14:16: error: 'pow' was not declared in this scope
   14 |     double x = pow((a.first - b.first), 2);
      |                ^~~
a.cc:16:12: error: 'sqrt' was not declared in this scope
   16 |     return sqrt(x + y);
      |            ^~~~
Language: C++

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

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


double facctorialMethod(ll k){
    double sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

void solve(long long N, std::vector<long long> x, std::vector<long long> y){
    ll a[N];
    double d=0;
    rep(i,N)a[i]=i;
    do
    {
        rep(i,N-1){
            d+=hypot(x[a[i]]-x[a[i+1]],y[a[i]]-y[a[i+1]]);
        }
    } while (next_permutation(a,a+N));

    cout<<(d/facctorialMethod(N))＜＜endl;;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
      cout << fixed << setprecision(10) << endl;
    long long N;
    scanf("%lld",&N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&x[i]);
        scanf("%lld",&y[i]);
    }
    solve(N, std::move(x), std::move(y));
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, std::vector<long long int>, std::vector<long long int>)':
a.cc:28:34: error: expected ';' before '\U0000ff1c\U0000ff1cendl'
   28 |     cout<<(d/facctorialMethod(N))＜＜endl;;
      |                                  ^~~~~~~~
      |                                  ;
Language: C++

#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
 
using namespace std;
 
int main(int argc, const char *argv[]) {
  int N;
  int count = 0;
  long double sum = 0.0;
  int disx, disy;
 
  cin >> N;
  vector<int> v(N);
  int x[N], y[N];
 
  for (int i = 0; i < N; i++) {
    cin >> x[i] >> y[i];
    v[i] = i + 1;
  }
 
  do {
    for (int i = 0; i < N-1; i++) {
      disx = (x[v[i]-1] - x[v[i+1]-1]);
      disy = (y[v[i]-1] - y[v[i+1]-1]);
      sum += sqrtl(disx * disx + disy * disy);
    }
    count++;
  } while (std::next_permutation(v.begin(), v.end()));
 
  printf("%.10Lf\n", sum / count);
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:30:17: error: 'next_permutation' is not a member of 'std'; did you mean 'is_permutation'?
   30 |   } while (std::next_permutation(v.begin(), v.end()));
      |                 ^~~~~~~~~~~~~~~~
      |                 is_permutation
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.at(i) >> y.at(i);
  }
  long int sum = 0;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      sum += sqrt((x.at(i)-x.at(j))*(x.at(i)-x.at(j))+(y.at(i)-y.at(j))*(y.at(i)-y.at(j))); 
    }
  }
  int n1kai = 1
  for(int i = 1; i < n; i++){
    n1kai *= i;
  }
  int nkai = 1
  for(int i = 1; i < n+1; i++){
    nkai *= i;
  }
  cout << 2 * sum * n1kai / nkai;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'for'
   18 |   for(int i = 1; i < n; i++){
      |   ^~~
a.cc:18:18: error: 'i' was not declared in this scope
   18 |   for(int i = 1; i < n; i++){
      |                  ^
a.cc:22:3: error: expected ',' or ';' before 'for'
   22 |   for(int i = 1; i < n+1; i++){
      |   ^~~
Language: C++

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


pair<double, double>a[(int)1e5 + 7];

double dis(pair<double, double>x, pair<double, double>y) {
	return sqrt((x.first - y.first) * (x.first - y.first) + ((x.second - y.second) * (x.second - y.second)));
}
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second;
	}
	double ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i == j)continue;
			ans += (n-1)*dis(a[i], a[j]);
		}
	}
	double low = 1;
	for (int i = 1; i <= n; i++) {
		low *= i;
	}
	std::cout << std::fixed<<std::setprecision(9) << (ans / low) << endl;

}

Compiler output:
a.cc: In function 'double dis(std::pair<double, double>, std::pair<double, double>)':
a.cc:9:16: error: 'sqrt' was not declared in this scope
    9 |         return sqrt((x.first - y.first) * (x.first - y.first) + ((x.second - y.second) * (x.second - y.second)));
      |                ^~~~
Language: C++

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



int main(){
  int N;
  int x[10];
  int y[10];
  vector<int> p(N);

  rep(i,N){
    p(i) = i;
  }

  auto dist = [&](int i,int j){
    dx = x[i] - x[j];
    dy = x[i] - y[j];
    return sqrt(dx*dx+dy*dy);
  };

  cin >> N;
  rep(i,N){
    cin >> x[i] >> y[i];
  }

  int count = 0;

  double sum = 0;

  do{
    rep(i,N){
      sum += dist(p[i], p[i+1]);
      count++;
    }
  }while(next_permutation(p.begin(),p.end()));

  printf("f.10\n", sum / count);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: no match for call to '(std::vector<int>) (int&)'
   16 |     p(i) = i;
      |     ~^~~
a.cc: In lambda function:
a.cc:20:5: error: 'dx' was not declared in this scope; did you mean 'x'?
   20 |     dx = x[i] - x[j];
      |     ^~
      |     x
a.cc:21:5: error: 'dy' was not declared in this scope; did you mean 'y'?
   21 |     dy = x[i] - y[j];
      |     ^~
      |     y
Language: C++

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

double distance(int a, int b, int c, int d){
    double dx = c - a;
    double dy = d - b;
    double dis = std::pow(dx*dx+dy*dy, 0.5);
    return dis;
}

int main(){
    int n;
    std::cin >> n;

    std::vector<int> x(n+1), y(n+1), v(n);
    x[0] = 0, y[0] = 0;
    for(int i = 0; i < n; i++) {
        std::cin >> x[i+1] >> y[i+1];
        v[i] = i + 1;
    }

    double sum_of_distance = 0.0;
    
    do{
        for(int i = 0; i < ; i++) sum_of_distance += distance(x[v[i]], y[v[i]], x[v[i+1]], y[v[i+1]]);
    }while(next_permutation(v.begin(), v.end()));

    double factorial = 1;
    for(int i = 2; i <= n; i++) factorial *= i;

    double ans = sum_of_distance / factorial;
    printf("%lf\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:28: error: expected primary-expression before ';' token
   27 |         for(int i = 0; i < ; i++) sum_of_distance += distance(x[v[i]], y[v[i]], x[v[i+1]], y[v[i+1]]);
      |                            ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm> 
using namespace std;

double distance(int a, int b, int c, int d){
    double dx = c - a;
    double dy = d - b;
    double dis = std::pow(dx*dx+dy*dy, 0.5);
    return dis;
}

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

    vector<int> x(n+1), y(n+1), v(n);
    x[0] = 0, y[0] = 0;

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

    double sum_of_distance = 0;

    do{
        for(int i = 0; i < n; i++){
            double length_of_path = distance(x[v[i]], y[v[i]], x[v[i+1]], y[v[i+1]]);
            sum_of_distance += length_of_path;
        }
    }while(next_permutation(v.begin(), v.end()));

    long long factorial = 1;
    for(int i = 2; i <= n; i++) factorial *= i;

    double ans = sum_of_distance / (double)factorial;

    printf("%lf\n", ans);

}



Compiler output:
a.cc: In function 'double distance(int, int, int, int)':
a.cc:9:23: error: 'pow' is not a member of 'std'
    9 |     double dis = std::pow(dx*dx+dy*dy, 0.5);
      |                       ^~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm> 
using namespace std;

double distance(int a, int b, int c, int d){
    double dx = c - a;
    double dy = d - b;
    double dis = std::pow(dx*dx+dy*dy, 0.5);
    return dis;
}

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

    vector<int> x(n+1), y(n+1), v(n);
    x[0] = 0, y[0] = 0;

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

    double sum_of_distance = 0;

    do{
        double temp_distance = 0;
        for(int i = 0; i < n; i++){
            double length_of_path = distance(x[v[i]], y[v[i]], x[v[i+1]], y[v[i+1]]);
            temp_distance += length_of_path;
        }
        sum_of_distance += temp_distance;
    }while(next_permutation(v.begin(), v.end()));

    long long factorial = 1;
    for(int i = 2; i <= n; i++) factorial *= i;

    double ans = sum_of_distance / (double)factorial;

    printf("%lf\n", ans);

}



Compiler output:
a.cc: In function 'double distance(int, int, int, int)':
a.cc:9:23: error: 'pow' is not a member of 'std'
    9 |     double dis = std::pow(dx*dx+dy*dy, 0.5);
      |                       ^~~
Language: C++

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

int main(){
	double n , x[10] , y[10],a[10];
  cin >> n;
  for(int i=0; i<n; i++){
  	cin >> x[i] >> y[i];
  }
  vector<int> v(n);
  for(int i=0; i<n; ++i) v(i) = i+1;
  
  double sum=0;
  do{
  	for(int i=0; i<n; ++i) {
    sum += pow( pow(x[v[i]]-x[v[i+1]],2) + pow(y[v[i]] + y[v[i+1]] , 2) , 0.5);
    }
  }while(next_permutation(v.begin(),v.end()));
    
    cout << (double)sum / n;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: no match for call to '(std::vector<int>) (int&)'
   11 |   for(int i=0; i<n; ++i) v(i) = i+1;
      |                          ~^~~
Language: C

#include <stdio.h>
#include <math.h>

#define MAX 8
#define square(n) (n)*(n)

int main(void)
{
  int N;
  int xy[MAX][2];
  int i,j;
  double sum_each_len=0;
  double ave_len=0;

  scanf("%d",&N);
  for(i=0;i<N;i++)scanf("%d %d",&xy[i][0],&xy[i][1]);

  for(i=0;i<N;i++){
    for(j=i+1;j<N;j++){
      sum_each_len += sqrt(square(xy[i][0]-xy[j][0])+square(xy[i][1]-xy[j][1]));
    }
  }
  printf("%lf\n",sum_each_len);
  printf("%d %d %d\n",N-1,combi(N),(N-1)/combi(N));

  if(N>2)ave_len = sum_each_len * 2 / N;
  else ave_len = sum_each_len;
  printf("%lf\n",ave_len);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:24:27: error: implicit declaration of function 'combi' [-Wimplicit-function-declaration]
   24 |   printf("%d %d %d\n",N-1,combi(N),(N-1)/combi(N));
      |                           ^~~~~
Language: C++

#include <algorithm>
#include <vector>
#include <iostream>
#include <math>
using namespace std;

int main(){
  int n;
  vector<pair<int, int>> pairs;
  cin >> n;
  for (int i=0;i<n;++i){
    int a, b;
    cin >> a >> b;
    pairs.push_back(make_pair(a, b));
  }
  
  sort(pairs.begin(), pairs.end());
  
  double sum=0;
  do{
    for( int i=0 ; i < n-1 ; ++i ){
      sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
    }
  }while(next_permutation(pairs.begin(), pairs.end()));
  cout << sum/n << endl;
}

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

#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;

int main(){
  int n;
  vector<pair<int, int>> pairs;
  cin >> n;
  for (int i=0;i<n;++i){
    int a, b;
    cin >> a >> b;
    pairs.push_back(make_pair(a, b));
  }
  
  sort(pairs.begin(), pairs.end());
  
  double sum=0;
  do{
    for( int i=0 ; i < n-1 ; ++i ){
      sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
    }
  }while(next_permutation(pairs));
  cout << sum/n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'pow' was not declared in this scope
   21 |       sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
      |                    ^~~
a.cc:21:14: error: 'sqrt' was not declared in this scope
   21 |       sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
      |              ^~~~
a.cc:23:26: error: no matching function for call to 'next_permutation(std::vector<std::pair<int, int> >&)'
   23 |   }while(next_permutation(pairs));
      |          ~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2939:5: note: candidate: 'template<class _BIter> bool std::next_permutation(_BIter, _BIter)'
 2939 |     next_permutation(_BidirectionalIterator __first,
      |     ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2939:5: note:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

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

int main(){
  int n;
  vector<pair<int, int>> pairs;
  cin >> n;
  for (int i=0;i<n;++i){
    int a, b;
    cin >> a >> b;
    pairs.push_back(make_paar(a, b));
  }
  
  sort(pairs.begin(), pairs.end());
  
  double sum=0;
  do{
    for( int i=0 ; i < n-1 ; ++i ){
      sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
    }
  }while(next_permutation(pairs));
  cout << sum/n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<pair<int, int>> pairs;
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <iostream>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:23: error: expected primary-expression before '>' token
    7 |   vector<pair<int, int>> pairs;
      |                       ^~
a.cc:7:26: error: 'pairs' was not declared in this scope
    7 |   vector<pair<int, int>> pairs;
      |                          ^~~~~
a.cc:12:21: error: 'make_paar' was not declared in this scope
   12 |     pairs.push_back(make_paar(a, b));
      |                     ^~~~~~~~~
a.cc:20:20: error: 'pow' was not declared in this scope
   20 |       sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
      |                    ^~~
a.cc:20:14: error: 'sqrt' was not declared in this scope
   20 |       sum += sqrt( pow( pairs[i].first-pairs[i+1].first, 2) + pairs[i].second-pairs[i+1].second);
      |              ^~~~
Language: Java

import java.util.Scanner;

public final class Main{
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        for(int i=0; i<n; i++){
            x[i] = stdIn.nextInt();
            y[i] = stdIn.nextInt();
        }

        int a = fact(n-2) * 2;
        int b = 2 * fact(n-2);
        int c = fact(n-1)! - (a + b);

        double lSum = 0;
        for(int i=0; i<n-1; i++){
            for(int j=i+1; j<n; j++){
                lSum += Math.sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
            }
        }

        if(n == 2){
            System.out.println((a) *lSum / fact(n));
        }else{
            System.out.println((a + b + c) * lSum / fact(n));
        }
    }

    private static int fact(int n){
        int ans = 1;
        for(int i=n; i>=1; i--){
            ans *= i;
        }
        return ans;
    }
}

Compiler output:
Main.java:16: error: ';' expected
        int c = fact(n-1)! - (a + b);
                         ^
Main.java:16: error: not a statement
        int c = fact(n-1)! - (a + b);
                                ^
Main.java:16: error: ';' expected
        int c = fact(n-1)! - (a + b);
                                   ^
3 errors
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <iomanip>
//#include "test.h"

using namespace std;

class Town {
private:
	int m_nX;
	int m_nY;

public:
	Town(int x, int y) :m_nX(x), m_nY(y) {};

	int GetX() const { return m_nX; }
	int GetY() const { return m_nY; }

	double CalcDistance(const Town& clTown) {
		return sqrt((m_nX - clTown.GetX()) * (m_nX - clTown.GetX()) + (m_nY - clTown.GetY()) * (m_nY - clTown.GetY()));
	}
};

int main()
{
	/*
		2 <= N<=8
		-1000<=x,y<=1000
		移動距離の平均値
	*/
	int n;
	cin >> n;

	double avg_distance = 0;
	vector<Town> towns;

	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		Town town(x, y);

		for (int j = 0; j < i; j++) {
			avg_distance += town.CalcDistance(towns[j]);
		}

		towns.push_back(town);
	}

	cout << fixed << setprecision(7) << avg_distance / (n*(n - 1) / 2) *(n - 1) << endl;
	
}

Compiler output:
a.cc: In member function 'double Town::CalcDistance(const Town&)':
a.cc:22:24: error: 'sqrt' was not declared in this scope
   22 |                 return sqrt((m_nX - clTown.GetX()) * (m_nX - clTown.GetX()) + (m_nY - clTown.GetY()) * (m_nY - clTown.GetY()));
      |                        ^~~~
Language: C++


#include <iostream>
#include <string>
#include <map>
#include <vector>
#include<iomanip>
//#include "test.h"

using namespace std;

class Town {
private:
	int m_nX;
	int m_nY;

public:
	Town(int x, int y) :m_nX(x), m_nY(y) {};

	int GetX() const { return m_nX; }
	int GetY() const { return m_nY; }

	double CalcDistance(const Town& clTown) {
		return sqrt((m_nX - clTown.GetX()) * (m_nX - clTown.GetX()) + (m_nY - clTown.GetY()) * (m_nY - clTown.GetY()));
	}
};

int main()
{
	/*
		2 <= N<=8
		-1000<=x,y<=1000
		移動距離の平均値
	*/
	int n;
	cin >> n;

	double avg_distance = 0;
	vector<Town> towns;

	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		Town town(x, y);

		for (int j = 0; j < i; j++) {
			avg_distance += town.CalcDistance(towns[j]);
		}

		towns.push_back(town);
	}

	cout << fixed << setprecision(7) << avg_distance / (n*(n - 1) / 2) *(n - 1) << endl;
	
}

Compiler output:
a.cc: In member function 'double Town::CalcDistance(const Town&)':
a.cc:23:24: error: 'sqrt' was not declared in this scope
   23 |                 return sqrt((m_nX - clTown.GetX()) * (m_nX - clTown.GetX()) + (m_nY - clTown.GetY()) * (m_nY - clTown.GetY()));
      |                        ^~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class D {
    static int[][] town;
    public static void main(String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        town = new int[N][2];
        for (int i = 0; i < town.length; i++) {
            town[i][0] = sc.nextInt();
            town[i][1] = sc.nextInt();
        }
        final int[] perm = new int[N];
        Arrays.fill(perm, -1);
        final double total = perm(perm, 0);
        int fact = 1;
        for (int i = 2; i <= N; i++) {
            fact *= i;
        }
        System.out.println(total / fact);
    }

    static double perm(int[] perm, int depth) {
        if (depth == perm.length) {
            return totalLength(perm, town);
        }
        double ret = 0;
        for (int i = 0; i < perm.length; i++) {
            if (perm[i] != -1) {
                continue;
            }
            perm[i] = depth;
            ret += perm(perm, depth + 1);
            perm[i] = -1;
        }
        return ret;
    }

    private static double totalLength(final int[] perm, final int[][] town) {
        double ret = 0;
        for (int i = 0; i < perm.length - 1; i++) {
            ret += len(town[perm[i]], town[perm[i + 1]]);
        }
        return ret;
    }

    static double len(int[] a, int[] b) {
        return Math.sqrt((a[0]-b[0]) * (a[0]-b[0]) + (a[1]-b[1]) * (a[1]-b[1]));
    }
}


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

#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
    int N, x[8], y[8];
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> x[i] >> y[i];
    }
    vector<vector<int>> root;
    for(int i = 0; i < N; i++){
        root.push_back({i});
    }
    double sum = 0;
    int count = 0;
    while(root.size() > 0){
        vector<int> a = root[root.size() - 1];
        root.pop_back();
        for(int i = 0; i < N; i++){
            bool flag = 1;
            for(int j = 0; j < a.size(); j++){
                if(i == a[j]){
                    flag = 0;
                    break;
                }
            }
            if(flag){
               vector<int> copy = a;
               copy.push_back(i);
               if(copy.size() == N){
                   for(int k = 0; k < N - 1; k++){
                       sum += sqrt(pow(x[copy[k]] - x[copy[k + 1]], 2) + pow(y[copy[k]] - y[copy[k + 1]], 2));
                   }
                   count++;
               }
               else{
                   root.push_back(copy);
               }
            }
        }
    }
    printf("%lf\n", sum / (double)count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:36: error: 'pow' was not declared in this scope
   33 |                        sum += sqrt(pow(x[copy[k]] - x[copy[k + 1]], 2) + pow(y[copy[k]] - y[copy[k + 1]], 2));
      |                                    ^~~
a.cc:33:31: error: 'sqrt' was not declared in this scope
   33 |                        sum += sqrt(pow(x[copy[k]] - x[copy[k + 1]], 2) + pow(y[copy[k]] - y[copy[k + 1]], 2));
      |                               ^~~~
Language: C++

#include <iostream>
#include <math.h>

int main(){
  long double sum;
  int n;
  long double x[10], y[10];
  
  cin >> n;
  for(int i=0;i<n;i++)
    cin >> x[i] >> y[i];
  
  for(int i=0; i<n; i++)
    for(int j=i+1; j<n; j++)
      sum += sqrt(
      (x[i]-x[j])*(x[i]-x[j])+
      (y[i]-y[j])*(y[i]-y[j]));
  cout << sum / n / (n-1) / 2;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << sum / n / (n-1) / 2;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct position {
    double x;
    double y;
};

int main() {
    int n;
    cin >> n;
    int count = 0;
    vector<position> pos(n);
    vector<int> perm(n);

    for (int i = 0; i < n; i++) {
        double x, y;
        cin >> x;
        cin >> y;
        pos[i] = position{x, y};
        perm[i] = i;
    }

    double sum = 0;
    do {
        for (int i = 0; i < n - 1; i++) {
            sum += sqrt(pow(pos[perm[i + 1]].x - pos[perm[i]].x, 2)
                        + pow(pos[perm[i + 1]].y - pos[perm[i]].y, 2));
        }
        count++;
    } while (next_permutation(perm.begin(), perm.end()));

    cout << (double)(sum / count) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: 'pow' was not declared in this scope; did you mean 'pos'?
   30 |             sum += sqrt(pow(pos[perm[i + 1]].x - pos[perm[i]].x, 2)
      |                         ^~~
      |                         pos
a.cc:30:20: error: 'sqrt' was not declared in this scope
   30 |             sum += sqrt(pow(pos[perm[i + 1]].x - pos[perm[i]].x, 2)
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;

#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cout << #x << " = " << (x) << endl;
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}

const ll INF = 1LL << 60;

ll N,M,H,W,K,A,B;
string S;
//Write From this Line
cin >> 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);
}

int main()
{
	cout << setprecision(10);
	cin >> N;
	for(int i = 1 ; i<= N; i++) cin >> x[i] >> y[i];
	double ans = 0.0;
	for(int i = 1 ; i<= N; i++){
		for(int j = i + 1 ; j <= N ; j++) ans += dist(i,j) * 2 / N ;
	}
	cout << fixed << setprecision(10) << ans << endl;
	//まだ理解してない

}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:11:32: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:12:30: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: At global scope:
a.cc:19:1: error: 'cin' does not name a type
   19 | cin >> N ;
      | ^~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;
#define LOCAL  1
#define UPLOAD 2
#define ll long long
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
template <class T = long long> T input(){T x;cin >> x;return x;}
template <class T> void output(T x){cout << x << endl;}
#define debug(x) cerr << #x<< ": " << x<< '\n';

unsigned long long d(unsigned long long N){
  unsigned digit=0;
  while(N!=0){
      N /= 10;
      digit++;
  }
  return digit;
}

int main()
{
#if ENVIRONMENT == LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
  int N = input();  
  vector<pair<int,int>> X;

  for(int i=0;i<N;i++){
    int x = input();
    int y = input();
    X.push_back({x,y});
  }

  float lengthSum = 0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      float length = sqrt(pow(X[i].first - X[j].first, 2) + pow(X[i].second - X[j].second, 2));
      lengthSum += length;
    }
  }

  float ret = lengthSum * (2.0f/N);

  std::cout << std::setprecision(30) << ret << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:21: error: 'setprecision' is not a member of 'std'
   51 |   std::cout << std::setprecision(30) << ret << endl;
      |                     ^~~~~~~~~~~~
a.cc:7:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    6 | #include <algorithm>
  +++ |+#include <iomanip>
    7 |
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		int[] y = new int[n];
		double d = 0.0;

		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++) {
				d += Math.sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
			}
		}
		System.out.println(d * 2 / n);

	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;

#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cout << #x << " = " << (x) << endl;
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}

const ll INF = 1LL << 60;

ll N,M,H,W,K,A,B;
string S;
//Write From this Line
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()
{
	//写経で提出
	//next_permutationの解法
	cout << setprecision(10);
	cin >> N;
	rep(i,N) cin >> x[i] >> y[i];
	double sum = 0.0;
	vector<int> v(N);
	rep(i,N) v[i] = i + 1;
	
	//1,2,3,4,5,6,7,8の全順列を使う2,6,4,1,3,5,7,8みたいなときは、dist(2,6)を求める。みたいなことをしてくれる。
	//なるほどそんな解法があったのか

	do{
		for(int i = 0 ; i < N - 1 ; i++ ) sum += dist(v[i] , v[i+1]);
	}while (next_pemutation(v.begin(),v.end()));
	int Factorial = 1 ;
	//階乗を求める↓
	for(int i = 2 ;i <= N ; i++) Factorial *= i;
	cout << fixed <<setprecision(10) << sum / Factorial << endl;
	return ;
}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:11:32: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:12:30: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: In function 'int main()':
a.cc:42:17: error: 'next_pemutation' was not declared in this scope
   42 |         }while (next_pemutation(v.begin(),v.end()));
      |                 ^~~~~~~~~~~~~~~
a.cc:47:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   47 |         return ;
      |         ^~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<vector<int>> v(N, vector<int>(2));
  vector<int> ptn(N);
  for (int i = 0; i < N; i++) {
    ptn.at(i) = i;
  }
  
  for (int i = 0; i < N; i++) {
    cin >> v.at(i).at(0) >> v.at(i).at(1);
  }
  
  int xi, xj, yi, yj;
  double sum = 0,
  	  avg = 0;
  do {
    /*for (int i = 0; i < N; i++) {
      cout << ptn.at(i);
      if (i == N - 1) {
        cout << endl;
      } else {
        cout << ':';
      }
    }*/
    for (int i = 1; i < N; i++) {
      int a = ptn.at(i),
          b = ptn.at(i-1);
      
    }
  } while (next_permutation(ptn.begin(), ptn.end()));
    
  avg = sum / cnt;
  cout << fixed << setprecision(10) << avg << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |   avg = sum / cnt;
      |               ^~~
      |               int
Language: Java

import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		double[] x = new double[N];
		double[] y = new double[N];
		double[] ans = new double[40320];
		double[] aa = new double[]{1,2,4,8,16,32,64,128,256};
		double[] bb = new double[]{0,1,2,6,24,120,720,5040,40320};
		for( int i=0; i<N; i++ ){
			x[i] = sc.nextDouble();
			y[i] = sc.nextDouble();
		}
		int count = 0;
		for( int i=0; i<=N-2; i++ ){
			for( int k=i+1; k<=N-1; k++ ){
				ans[count] = Math.sqrt( (x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]) );
				count++;
			}
		}
		double total = 0;
		for( int i=0; i<40320; i++ ){
			total += ans[i];
		}
		System.out.println((total*aa[N-1]/bb[N]);
	}
}


Compiler output:
Main.java:28: error: ')' or ',' expected
		System.out.println((total*aa[N-1]/bb[N]);
		                                        ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

void solve(int n, int prev, double sum);

struct Point
{
	Point() : x(0), y(0) {}
	Point(int x_, int y_) : x(x_), y(y_) {}

	int x;
	int y;
};

double distance(const Point& p1, const Point& p2)
{
	double ans = pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2);
	ans = sqrt(ans);
	return ans;
}

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

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

vector<Point> points;
int N;
vector<bool> used;
vector<double> sums;
int cnt = 0;

double solve()
{
	for (int i = 0; i < N; i++)
	{
		used.at(i) = true;
		solve(N - 1, i, 0);
		used.at(i) = false;
	}

	double sum = 0;

	for (auto i : sums)
	{
		sum += i;
	}

	return sum / factorial(N);
}

void solve(int n, int prev, double sum)
{
	if (n == 0)
	{
		sums.at(cnt++) = sum;
		return;
	}

	for (int i = 0; i < N; i++)
	{
		if (used.at(i))
			continue;

		used.at(i) = true;

		double t = 0;
		if (prev != -1)
		{
			t = sum + distance(points.at(prev), points.at(i));
		}
		solve(n - 1, i, t);

		used.at(i) = false;
	}

}

int main()
{
	cin >> N;
	points.resize(N);
	used.resize(N);
	sums.resize(factorial(N));

	for (int i = 0; i < N; i++)
	{
		cin >> points.at(i).x >> points.at(i).y;
	}

	double ans = solve();

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'double distance(const Point&, const Point&)':
a.cc:20:22: error: 'pow' was not declared in this scope
   20 |         double ans = pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2);
      |                      ^~~
a.cc:21:15: error: 'sqrt' was not declared in this scope
   21 |         ans = sqrt(ans);
      |               ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}




int main(){  
  int n;
  cin>>n;
  vector<int>x(n);
  vector<int>y(n);
  rep(i,n) cin>>x[i]>>y[i];
  ld ave=0;
  rep(i,n){
    rep(j,n){
      if(i!=j)ave+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
    }
  }

  ave/=n;
  cout<<fixed<<setpresicion(6)<<ave<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:59: error: expected ';' before '}' token
   32 |       if(i!=j)ave+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
      |                                                           ^
      |                                                           ;
   33 |     }
      |     ~                                                      
a.cc:37:16: error: 'setpresicion' was not declared in this scope
   37 |   cout<<fixed<<setpresicion(6)<<ave<<endl;
      |                ^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}




int main(){  
  int n;
  cin>>n;
  vector<int>x(n);
  vector<int>y(n);
  rep(i,n) cin>>x[i]>>y[i];
  ld ave=0;
  rep(i,n){
    rep(j,n){
      if(i!=j)ave+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
    }
  }

  ave/=n;
  cout<<fixed<<setpresicion(8)<<ave<<endl;
}


Compiler output:
a.cc:6:1: error: expected initializer before 'typedef'
    6 | typedef pair<int,int> P;
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:29:3: error: 'ld' was not declared in this scope; did you mean 'll'?
   29 |   ld ave=0;
      |   ^~
      |   ll
a.cc:32:15: error: 'ave' was not declared in this scope
   32 |       if(i!=j)ave+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
      |               ^~~
a.cc:36:3: error: 'ave' was not declared in this scope
   36 |   ave/=n;
      |   ^~~
a.cc:37:16: error: 'setpresicion' was not declared in this scope
   37 |   cout<<fixed<<setpresicion(8)<<ave<<endl;
      |                ^~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>

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

using namespace std;

const int INF = 1000;

int N, M;

int d[100];

int A[100][100];

vector<pair<int, int>> V;

int main()
{
	cin >> N;

	rep(i, N) {
		int x, y;
		cin >> x >> y;
		V.push_back(make_pair(x, y));
	}

	double sum = 0;

	vector<int> v;
	rep(i, N)v.push_back(i);

	do {

		rep(i, N - 1) {
			double x = pow(V[i].first - V[i + 1].first, 2);
			double y = pow(V[i].second - V[i + 1].second, 2);

			sum += sqrt(x + y);
		}

	} while (next_permutation(v.begin(), v.end()));

	rep(i, N) sum /= (i + 1);
	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:36: error: 'pow' was not declared in this scope
   41 |                         double x = pow(V[i].first - V[i + 1].first, 2);
      |                                    ^~~
a.cc:44:32: error: 'sqrt' was not declared in this scope
   44 |                         sum += sqrt(x + y);
      |                                ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<map>

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

using namespace std;

const int INF = 1000;

int N, M;

int d[100];

int A[100][100];

vector<pair<int, int>> V;

int main()
{
	cin >> N;

	rep(i, N) {
		int x, y;
		cin >> x >> y;
		V.push_back(make_pair(x, y));
	}

	int sum = 0;

	vector<int> v;
	rep(i, N)v.push_back(i);

	do {

		rep(i, N - 1) {
			int x = pow(V[i].first - V[i + 1].first, 2);
			int y = pow(V[i].second - V[i + 1].second, 2);

			sum += sqrt(x + y);
		}

	} while (next_permutation(v.begin(), v.end()));

	rep(i, N) sum /= (i + 1);
	printf("%.10Lf\n", sum);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:33: error: 'pow' was not declared in this scope
   41 |                         int x = pow(V[i].first - V[i + 1].first, 2);
      |                                 ^~~
a.cc:44:32: error: 'sqrt' was not declared in this scope
   44 |                         sum += sqrt(x + y);
      |                                ^~~~