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

//試行回数が少ないため全探索して平均値を計算すれば良い
//ポイントは誤差を減らすにはどうすれば良いのかということ
//順列を列挙してそれに対応する順に計算すれば良い
//考察はOKなので実装を頑張りましょう
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N ;
  int n=1;
  long double ans =0;
  cin >> N ;
  vector<int> x(N);
  vector<int> y(N);
  vector<int> o(N);
  for(int i=0;i<N;i++){
    n *= N-1;
  }
  for(int i=0;i<N;i++){
    o[i] = i+1;
  }
  for(int i=0;i<N;i++) cin >> x[i] >> y[i] ;
  //入力終わり　次に順列を作る
  do{
    for(int i=0;i<N-1;i++){
    ans += sqrt((x[o[i+1]]-x[o[i]])*(x[o[i+1]]-x[o[i]])+(y[o[i+1]]-y[o[i]])*(y[o[i+1]]-y[o[i]]));
    }
  }while(next_permutation(o.begin(),o.end()))
    
    cout << long double (ans/n) << endl;
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:28:46: error: expected ';' before 'cout'
   28 |   }while(next_permutation(o.begin(),o.end()))
      |                                              ^
      |                                              ;
   29 | 
   30 |     cout << long double (ans/n) << endl;
      |     ~~~~                                      
a.cc:30:13: error: expected primary-expression before 'long'
   30 |     cout << long double (ans/n) << endl;
      |             ^~~~
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
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 << fixed << setprecision(10) << 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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <functional>
#include <math.h>
#include <numeric>
using namespace std;

int main(){
    int n , a , b;
    float sum = 0;
    vector<float> vsum;
    vector<float> x;
    vector<float> y;
    vector<int> count;
    cin >> n;
    for (int i = 0; i < n; i++){
        count.push_back(i);
        cin >> a >> b;
        x.push_back(a);
        y.push_back(b);
    }
    do{
        for (int i = 0; i < n -1; i++){
            sum += sqrt( pow(x.at(count.at(i)) - x.at(count.at(i + 1)), 2) +
                         pow(y.at(count.at(i)) - y.at(count.at(i + 1)), 2)
                        );
        }
        vsum.push_back(sum);
        sum = 0;
    } while( next_permutation(count.begin(), count.end()));
    cout << fixed << setprecision(15) << float(accumulate(vsum.begin(), vsum.end(), 0)) / float(vsum.size()) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: 'setprecision' was not declared in this scope
   34 |     cout << fixed << setprecision(15) << float(accumulate(vsum.begin(), vsum.end(), 0)) / float(vsum.size()) << endl;
      |                      ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <numeric>
  +++ |+#include <iomanip>
    9 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int facctorialMethod(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

int main(){
  int n;
  cin >> n;
  vector<double>x(n);
  vector<double>y(n);
  for(int i=0;i<n;i++){
    cin >> x.at(i) >> y.at(i);
  }
  vector<int>in(n);
  for(int i=0;i<n;i++){
    in.at(i)=i;
  }
  double ans=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      double x_long=pow(x.at(i)-x.at(j),2.0);
      double y_long=poe(y.at(i)-y.at(j),2.0);
      ans+=sqrt(x_long+y_long);
    }
  }
  ans/=facctorialMethod(n);
  ans*=facctorialMethod(n-1);
  cout << fixed << setprecision(10);
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: 'poe' was not declared in this scope; did you mean 'pow'?
   29 |       double y_long=poe(y.at(i)-y.at(j),2.0);
      |                     ^~~
      |                     pow
Language: C++

#include<bits/stdc++.h>
#define db double
using namespace std;
db sr(db a) {
  db mi = 0;
  db ma = a;
  for (int i = 0; i < 100; i ++) {
    db mu = (mi + ma) / 2:
    if (mu * mu < a) mi = mu;
    else ma = mu;
  }
  return ma;
}
db nj(db a) {
  return a * a;
}
int main () {
  int N;
  cin >> N;
  vector<db>x(N);
  vector<db>y(N);
  for (int i = 0; i < N; i ++) cin >> x[i] >> y[i];
  int n = 1;
  for (int i = 1; i <= N; i ++) n *= i;
  db kj = (db)n;
  db ans = 0;
  for (int i = 0; i < N; i ++) {
    for (int j = 0; j < N; j ++) {
      ans += (nj(x[i] - x[j]) + nj(y[i] - y[j]));
    }
  }
  ans = ans * kj;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'double sr(double)':
a.cc:8:26: error: expected ',' or ';' before ':' token
    8 |     db mu = (mi + ma) / 2:
      |                          ^
a.cc:10:5: error: 'else' without a previous 'if'
   10 |     else ma = mu;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	long double n;
	cin>>n;
	ll x[n],y[n];
	for(ll i=0;i<n;i++){
		ll a,b;
		cin>>a>>b;
		x[i]=a;
		y[i]=b;
	}
	long double sum=0;
	for(ll i=0;i<n;i++){
		for(ll j=i+1;j<n;j++){
			long double dx=x[i]-x[j];
			long double dy=y[i]-y[j];
			sum+=sqrt(dx*dx+dy*dy);
		}
	}
	long double ans=2*sum/2;
	printf("%.9Lf",ans);
	// your code goes here
	return 0;
}

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

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

int main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  rep(i,n) cin >> x[i] >> y[i];
  // 距離を求める関数(ラムダ式:無名関数)
  auto dist = [&](int i, int j) {
    double dx = x[i]-x[j];
    double dy = y[i]-y[j];
    return sqrt(dx*dx+dy*dy);
  };

  double len = 0;
  rep(i,n)rep(j,i){
    len += dist(i,j);
  }
  int num = 2;
  for (int i = n-1; i>=1; --i) num *= i;
  int fact = 1;
  for (int i = n; i>=1; --i) fact *= i;
  double ans = (len*num)/fact;
  printf("%.10f\n", ans);
  return 0;

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

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

int main() {
  int n;
  cin >>  n;
  vector<int> x(n), y(n);
  rep(i,n) cin >> x[i] >> y[i];
  // 距離を求める関数(ラムダ式:無名関数)
  auto dist = [&](int i, int j) {
    double dx = x[i]-x[j];
    double dy = y[i]-y[j];
    return sqrt(dx*dx+dy*dy);
  };

  double len = 0;
  rep(i,n)rep(j,i){
    len += dist(i,j);
  }
  int num = 2;
  for (int i = n-1; i>=1; --i) num *= i;
  int fact = 1;
  for (int i = n; i>=1; --i) fact *= i;
  double ans = (len*num)/fact;
  printf("%.10f\n", ans);
  return 0;

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

#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(int(a), int(b), int(c)) {
	return max(max(a, b), c);
}
int Min(int(a), int(b), int(c)) {
	return min(min(a, b), c);
}

int pch(ll H) {
	ll i = 2;
	while (i * i <= H) {
		if (H % i == 0) {
			return -1;
		}
		i++;
	}
	return H;
}
ll kaizyo(ll N) {
	ll k = 1;
	rep(i, N-1) {
		k *= (i + 1);
	}
	return k;
}



int main() {
	ll N,s=0;
	double wa = 0;
	cin >> N;
	vector<double> x(N);
	vector<double> y(N);
	rep(i, N) {
		cin >> x.at(i) >> y.at(i);
	}
	for (ll i = 0; i < N; i++) {
		for (ll j = 0; j < N; j++) {
			wa += 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)));
		}
	}
	cout << fixed << setprecision(10);
	cout <<(wa / N) << endl;
;
	
}





Compiler output:
a.cc: In function 'int main()':
a.cc:62:31: error: 'sqrt' was not declared in this scope
   62 |                         wa += 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)));
      |                               ^~~~
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



int main() {
    int n; cin >> n;
    vector<double> X(n), Y(n); rep(i, n) cin >> X[i] >> Y[i];

    vector<vector<double>> dist(n, vector<double>(n));
    rep(i, n){
        rep(j, n){
            dist[i][j] = sqrt(pow(X[i]-X[j], 2) + pow(Y[i]-Y[j], 2));
        }
    
    vector<vector<int>> per;
    vector<int> array; rep(i, n) array.push_back(i);
    do{
        per.push_back(array);
    }while(next_permutation(all(array))); 

    double res = 0;
    for(vector<int> p: per){
        rep(i, p.size()-1) res += dist[i][i+1];    
    }

    cout << fixed << setprecision(10);
    cout << res / per.size() << ln;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:17:12: note: to match this '{'
   17 | int main() {
      |            ^
Language: C++

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

int main() {
	int n;
	cin >> n;
	pair<int, int>* coord = new pair<int, int>[n];
	int* keiro = new int[n];
	double av;
	double kaijo=1;
	for (int i = 0;i < n;i++) {
		cin >> coord[i].first >> coord[i].second;
		kaijo *= (i + 1);
		keiro[i] = i;
	}
	while (1) {
		for (int i = 0;i < n - 1;i++) {
			av += sqrt((pow(coord[keiro[i + 1]].first - coord[keiro[i]].first, 2) + pow(coord[keiro[i + 1]].second - coord[keiro[i]].second, 2)));
		}
		if (!next_permutation(keiro, keiro + n)) {
			break;
		}
	}
	cout.precision(20);
	cout << av / kaijo << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:37: error: 'pow' was not declared in this scope
   19 |                         av += sqrt((pow(coord[keiro[i + 1]].first - coord[keiro[i]].first, 2) + pow(coord[keiro[i + 1]].second - coord[keiro[i]].second, 2)));
      |                                     ^~~
a.cc:19:31: error: 'sqrt' was not declared in this scope
   19 |                         av += sqrt((pow(coord[keiro[i + 1]].first - coord[keiro[i]].first, 2) + pow(coord[keiro[i + 1]].second - coord[keiro[i]].second, 2)));
      |                               ^~~~
Language: C

int main()
{
  int n;
  scanf("%d", &n);
  int x[n], y[n];
  int i, j, lenx, leny;
  double sum = 0;
  for (i = 0; i < n; i++)
    scanf("%d %d", &x[i], &y[i]);
  for (i = 0; i < n - 1; i++)
  {
    for (j = 0; j < n; j++)
    {
      lenx = x[i] - x[j];
      leny = y[i] - y[j];
      sum += sqrt(lenx * lenx + leny * leny);
    }
  }
  printf("%lf", sum)
}

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d", &n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:16:14: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   16 |       sum += sqrt(lenx * lenx + leny * leny);
      |              ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | int main()
main.c:16:14: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   16 |       sum += sqrt(lenx * lenx + leny * leny);
      |              ^~~~
main.c:16:14: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:19:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |   printf("%lf", sum)
      |   ^~~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:21: error: expected ';' before '}' token
   19 |   printf("%lf", sum)
      |                     ^
      |                     ;
   20 | }
      | ~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
//typedef __int64 LL;
//typedef long long int LL;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef pair<int,int> P;
//typedef pair<LL,LL> PL;

const int MOD=1000000007;

int n;
double x[15],y[15];


double score(vector<int> &v)
{
	double po=0;
	for(int i=0;i<n-1;i++)	
	{
		po+=sqrt((x[v[i+1]]-x[v[i]])*(x[v[i+1]]-x[v[i]])+(y[v[i+1]]-y[v[i]])*(y[v[i+1]]-y[v[i]]));
	}
	return po;	
}

double dfs(vector<int> &v)
{
	if(v.size()==n)
	{
		/*for(int i=0;i<n;i++)
		{
			cout<<v[i];
			
		}
		cout<<"\n";
		cout<<score(v)<<"\n"; */
		return score(v);
	}
	double po=0;
	
	for(int i=0;i<n;i++)
	{
		bool flag=true;
		for(int j=0;j<v.size();j++)
		{
			if(v[j]==i)
			{
				flag=false;
				break;
			}
		}
		if(flag)
		{
			v.push_back(i);
			po+=dfs(v);
			v.pop_back();	
		}		
	}
	return po;
}

int kaijo(int w)
{
	if(w==0)return 1;
	return w*kaijo(w-1);
}
int main(){
	cin>>n;
	for(int i=0;i<n;i++)cin>>x[i]>>y[i];
	
	vector<int> nu;
	cout<<setprecision(15)<<dfs(nu)/((double)kaijo(n))<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'double score(std::vector<int>&)':
a.cc:32:21: error: 'sqrt' was not declared in this scope
   32 |                 po+=sqrt((x[v[i+1]]-x[v[i]])*(x[v[i+1]]-x[v[i]])+(y[v[i+1]]-y[v[i]])*(y[v[i+1]]-y[v[i]]));
      |                     ^~~~
Language: C++

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

int main() {
    int N;
    cin >> N;
    vector<double>x(N);
    vector<double>y(N);
    vector<int>z(N);
    double cnt = 1.0;
    double heikin = 0.0;
    for(int i = 0; i < N; i++) {
        cin >> x[i];
        cin >> y[i];
        z[i] = i;
        cnt *=(i+1)
    }
    for(int i = 0; i < cnt; i++) {
        for(int i = 0; i+1 < N; i++) {
            double X = x[z[i]]-x[z[i+1]];
            double Y = y[z[i]]-y[z[i+1]];
            heikin += sqrt(X*X+Y*Y);
        }
    }next_permutation(z.begin(), z.end());
    cout << fixed << setprecision(20) << heikin/cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before '}' token
   16 |         cnt *=(i+1)
      |                    ^
      |                    ;
   17 |     }
      |     ~
Language: C++

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

int main() {
    int N;
    cin >> N;
    vector<double>x(N);
    vector<double>y(N);
    vector<int>z(N);
    double cnt = 1.0;
    double heikin = 0.0;
    for(int i = 0; i < N; i++) {
        cin >> x[i];
        cin >> y[i];
        z[i] = i;
        cnt a*=(i+1)
    }
    for(int i = 0; i < cnt; i++) {
        for(int i = 0; i+1 < N; i++) {
            double X = x[z[i]]-x[z[i+1]];
            double Y = y[z[i]]-y[z[i+1]];
            heikin += sqrt(X*X+Y*Y);
        }
    }next_permutation(z.begin(), z.end());
    cout << fixed << setprecision(20) << heikin/cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected ';' before 'a'
   16 |         cnt a*=(i+1)
      |            ^~
      |            ;
Language: C++

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

int main() {
    int N;
    cin >> N;
    vector<double>x(N);
    vector<double>y(N);
    vector<int>z(N);
    double cnt = 1.0;
    double heikin = 0.0;
    for(int i = 0; i < N; i++) {
        cin >> x[i];
        cin >> y[i];
        z[i] = i;
        cnt a*=(i+1)
    }
    for(int i = 0; i < cnt; i++) {
        for(int i = 0; i+1 < N; i++) {
            double X = x[z[i]]-x[z[i+1]];
            double Y = y[z[i]]-y[z[i+1]];
            heikin += sqrt(X*X+Y*Y);
        }
    }next_permutation(z.begin(), z.end()));
    cout << fixed << setprecision(20) << heikin/cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected ';' before 'a'
   16 |         cnt a*=(i+1)
      |            ^~
      |            ;
a.cc:24:42: error: expected ';' before ')' token
   24 |     }next_permutation(z.begin(), z.end()));
      |                                          ^
      |                                          ;
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n,j;
  cin>>n;
  double ans=0;
  int a[n],b[n],i;
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]),2));
    }
  }
  cout<<ans*2/n<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: no matching function for call to 'pow(int)'
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]),2));
      |                                  ~~~^~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n,j;
  cin>>n;
  double ans=0;
  int a[n],b[n],i;
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]),2);
    }
  }
  cout<<ans*2/n<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: no matching function for call to 'pow(int)'
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]),2);
      |                                  ~~~^~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int n,j;
  cin>>n;
  double ans=0;
  int a[n],b[n],i;
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
    }
  }
  cout<<ans*2/n<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: no matching function for call to 'pow(int)'
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
      |                                  ~~~^~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  cin>>n;
  double ans=0;
  int a[n],b[n],i;
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
    }
  }
  cout<<ans*2/n<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n;
      |        ^
a.cc:8:17: error: redeclaration of 'int i'
    8 |   int a[n],b[n],i;
      |                 ^
a.cc:5:7: note: 'int i' previously declared here
    5 |   int i,j;
      |       ^
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i]>>b[i];
      |          ^
a.cc:10:16: error: 'b' was not declared in this scope
   10 |     cin>>a[i]>>b[i];
      |                ^
a.cc:14:21: error: 'a' was not declared in this scope
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
      |                     ^
a.cc:14:38: error: 'b' was not declared in this scope
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
      |                                      ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  cin>>n;
  double ans=0;
  int a[n],b[n],i;
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
    }
  }
  cout<<ans*2/n<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n;
      |        ^
a.cc:8:17: error: redeclaration of 'int i'
    8 |   int a[n],b[n],i;
      |                 ^
a.cc:5:7: note: 'int i' previously declared here
    5 |   int i,j;
      |       ^
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i]>>b[i];
      |          ^
a.cc:10:16: error: 'b' was not declared in this scope
   10 |     cin>>a[i]>>b[i];
      |                ^
a.cc:14:21: error: 'a' was not declared in this scope
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
      |                     ^
a.cc:14:38: error: 'b' was not declared in this scope
   14 |       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j]));
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int x[10];
int y[10];
int N;
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 () {
  double answer=0;
  int aaa=1;
  cin >> N ;
  int p[10];
  for (int j = 0; j < N; j++) {
    cin>>x[j]>>y[j];}
    for (int i = 0; i < N ; i++) {
    p[i]=i+1;}
  for (int tmp = 0; tmp < (1 << N); tmp++) {
   do{
     for (int j = 0; j < N-1; j++) {
     answer+=dist(p[j],p[j+1]);}
   }while (next_permutation(p,p+n));
     for (int j = 2; j <= N; j++) {
     aaa*=j;}
    cout << answer/aaa << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: 'n' was not declared in this scope
   24 |    }while (next_permutation(p,p+n));
      |                                 ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:11:13: note: to match this '{'
   11 | int main () {
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int x[10];
int y[10];
int N;
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 () {
  double answer=0;
  int aaa=1;
  cin >> N ;
  int p[10];
  for (int j = 0; j < N; j++) {
    cin>>x[j]>>y[j];}
    for (int i = 0; i < N ; i++) {
    p[i]=i+1;}
  for (int tmp = 0; tmp < (1 << N); tmp++) {
   do{
     for (int j = 0; j < N-1; j++) {
     answer+=dist(p[j],p[j+1]);}
   }while (next_permutation(p.begin(),p.end()));
     for (int j = 2; j <= N; j++) {
     aaa*=j;}
    cout << answer/aaa << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:31: error: request for member 'begin' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                               ^~~~~
a.cc:24:41: error: request for member 'end' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                                         ^~~
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:11:13: note: to match this '{'
   11 | int main () {
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int x[10];
int y[10];
int N;
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 () {
  double answer=0;
  int aaa=1;
  cin >> N ;
  int p[10];
  for (int j = 0; j < N; j++) {
    cin>>x[j]>>y[j];}
    for (int i = 0; i < N ; i++) {
    p[i]=i+1;}
  for (int tmp = 0; tmp < (1 << N); tmp++) {
   do{
     for (int j = 0; j < N-1; j++) {
     answer+=dist(p[i],p[i+1]);}
   }while (next_permutation(p.begin(),p.end()));
     for (int j = 2; j <= N; j++) {
     aaa*=j;}
    cout << answer/aaa << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: 'i' was not declared in this scope
   23 |      answer+=dist(p[i],p[i+1]);}
      |                     ^
a.cc:24:31: error: request for member 'begin' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                               ^~~~~
a.cc:24:41: error: request for member 'end' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                                         ^~~
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:11:13: note: to match this '{'
   11 | int main () {
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int x[10];
int y[10];
int N;
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 () {
  double answer=0;
  int aaa=1;
  cin >> N ;
  int p[10];
  for (int j = 0; j < N; j++) {
    cin>>x[j]>>y[j];}
    for (int i = 0; i < N ; i++) {
    p[i]=i+1;}
  for (int tmp = 0; tmp < (1 << N); tmp++) {
   do{
     for (int j = 0; j < N-1; j++) {
     answer+=dist(p[i],p[i+1]);}
   }while (next_permutation(p.begin(),p.end()));
     for (int j = 2; j <= N; j++) {
     aaa*=j;}
    cout << answer/aaa << endl;
}


Compiler output:
a.cc:6:19: error: expected ',' or '...' before 'int'
    6 | double dist(int i int j){
      |                   ^~~
a.cc: In function 'double dist(int)':
a.cc:7:20: error: 'j' was not declared in this scope
    7 |   double dx=x[i]-x[j];
      |                    ^
a.cc: In function 'int main()':
a.cc:23:21: error: 'i' was not declared in this scope
   23 |      answer+=dist(p[i],p[i+1]);}
      |                     ^
a.cc:24:31: error: request for member 'begin' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                               ^~~~~
a.cc:24:41: error: request for member 'end' in 'p', which is of non-class type 'int [10]'
   24 |    }while (next_permutation(p.begin(),p.end()));
      |                                         ^~~
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:11:13: note: to match this '{'
   11 | int main () {
      |             ^
Language: C++

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

int main()
{
    int N;
	double x[8], y[8];
	cin >> N;
	for(int i=0; i<N; i++)
		cin >> x[i] >> y[i];

	double dxy[8][8];
	for(int i=0; i<N; i++){
		for(int j=0; j<N; j++)
			dxy[i][j] = sqrt( ((x[i]-x[j])*(x[i]-x[j])) + ((y[i]-y[j])*(y[i]-y[j])) );
	}

	int perm[8];
	for(int i=0; i<N; i++){
            perm[i] = i;
	}
	double sum = 0;
	do{
        for(int i=0; i<N-1; i++){
           sum += dxy[perm[i]][perm[i+1]];
		  // cout << perm[i];
        }
		//cout << perm[N-1] << endl;
		//cout << "sum = " << sum << endl;
    }while(next_permutation(perm,perm+N));

	for(int i=0; i<N; i++){
            sum /= (i+1);
	}
	cout << sum << endl;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#define ll long long
using namespace std;
vector<vector<int>> seqs;
int dfs(int index,int size,vector<int> seq){
    if(index==size){
        seqs.push_back(seq);
        return 0;
    }
    
    for(int i=index;i<size;i++){
        swap(seq[index],seq[i]);
        dfs(index+1,size,seq);
        swap(seq[index],seq[i]);
    }
    
}
int main(){
    int n;
    cin>>n;
    vector<double>x(n);
    vector<double>y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    vector<int> seq;
    for(int i=0;i<n;i++){
        seq.push_back(i);
    }
    dfs(0,n,seq);
    double sum=0;
    for(int i=0;i<seqs.size();i++){
        
        for(int j=0;j<seqs[i].size()-1;j++){
            double difx=x[seqs[i][j]]-x[seqs[i][j+1]];
            double dify=y[seqs[i][j]]-y[seqs[i][j+1]];
            sum+=pow(difx*difx+dify*dify,0.5);
        }
    }
    int mul=1;
    for(int i=1;i<=n;i++){
        mul*=i;
    }
    cout<<std::fixed<<std::setprecision(6)<<sum/mul<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:18: error: 'pow' was not declared in this scope
   40 |             sum+=pow(difx*difx+dify*dify,0.5);
      |                  ^~~
a.cc: In function 'int dfs(int, int, std::vector<int>)':
a.cc:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#define ll long long
using namespace std;
vector<vector<int>> seqs;
int dfs(int index,int size,vector<int> seq){
    if(index==size){
        seqs.push_back(seq);
        return 0;
    }
    
    for(int i=index;i<size;i++){
        swap(seq[index],seq[i]);
        dfs(index+1,size,seq);
        swap(seq[index],seq[i]);
    }
    
}
int main(){
    int n;
    cin>>n;
    vector<double>x(n);
    vector<double>y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    vector<int> seq;
    for(int i=0;i<n;i++){
        seq.push_back(i);
    }
    dfs(0,n,seq);
    double sum=0;
    for(int i=0;i<seqs.size();i++){
        
        for(int j=0;j<seqs[i].size()-1;j++){
            double difx=x[seqs[i][j]]-x[seqs[i][j+1]];
            double dify=y[seqs[i][j]]-y[seqs[i][j+1]];
            sum+=pow(difx*difx+dify*dify,0.5);
        }
    }
    int mul=1;
    for(int i=1;i<=n;i++){
        mul*=i;
    }
    cout<<fixed<<setprecision(6)<<sum/mul<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:18: error: 'pow' was not declared in this scope
   40 |             sum+=pow(difx*difx+dify*dify,0.5);
      |                  ^~~
a.cc: In function 'int dfs(int, int, std::vector<int>)':
a.cc:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

int main(){
  cout<<fixed<<setprecision(15);
  int n;
  cin>>n;
  ld x[n],y[n];
  rep(i,n) cin>>x[i]>>y[i];
  vector<int> v(n);
  rep(i,n) v[i]=i;
  ld sum=0;
  do{
    rep(i,n-1){
      ld dx=x[v[i]]-x[v[i+1]];
      ld dy=y[v[i]]-y[v[i+1]]
      sum+=pow(dx*dx+dy*dy,0.5);
    }
  }while(next_permutation(all(v)));
  
  ld u=1;
  rep(i,n) u*=(i+1);
  cout<<sum<<endl;
}
         

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: expected ',' or ';' before 'sum'
   29 |       sum+=pow(dx*dx+dy*dy,0.5);
      |       ^~~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.IntStream;

public class ABC145_C {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int n = stdIn.nextInt();

		List<Town> townList = new ArrayList<Town>();
		IntStream.range(0, n).forEach(i -> townList.add(new Town(stdIn.nextInt(), stdIn.nextInt())));

		Field field = new Field(townList);
		System.out.println(field.average());

		stdIn.close();
	}
}

class Field {
	private List<Town> townList;
	private List<Path> allPaths;

	public Field(List<Town> townList) {
		this.townList = townList;
		this.allPaths = new ArrayList<>();
		permutation(new Path());
	}

	public double average() {
		double sum = 0;

		for (Path path : allPaths) {
			for (int i = 0; i < path.size(); i++) {
				Town current = townList.get(path.getCurrent(i)-1);
				Town next = townList.get(path.getNext(i)-1);

				sum += Town.getDistance(current, next);
			}
		}

		return sum / allPaths.size();
	}

	private void permutation(Path target) {

		int size = target.size();

		if (size == townList.size()) {
			allPaths.add(target);
			return;
		}

		for (int i = 0; i <= size; i++) {
			Path nextpath = (Path) target.clone();
			nextpath.add(i, size + 1);
			permutation(nextpath);

		}
	}

	public List<Town> getTownList() {
		return townList;
	}

	public List<Path> getAllPaths() {
		return allPaths;
	}

}

class Path extends ArrayList<Integer> {

	public int getCurrent(int index) {
		return get(index);
	}

	public int getNext(int index) {

		if (index == this.size() - 1) {
			return get(index);
		}

		return get(index + 1);
	}

}

class Town {
	private int x;
	private int y;

	public Town(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public static double getDistance(Town former, Town latter) {
		return Math.sqrt((former.x - latter.x) * (former.x - latter.x) + (former.y - latter.y) * (former.y - latter.y));
	}

	@Override
	public String toString() {
		return "Town [x=" + x + ", y=" + y + "]";
	}

}


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

#include<bits/stdc++.h>
using namespace std;
  
int main(){
  
  int N;
  cin >> N;
  vector<int> x(N), y(N), Junb(N);;
  
  for(i = 0; i < N; i++){
    cin >> x.at(i) >> y.at(i);
    Junb.at(i) = i;
  }
 
  do {
    
    cout << Junb.at(0);
  } while (next_permutation(Junb.begin(), Junb.end()))
  
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i = 0; i < N; i++){
      |       ^
a.cc:18:55: error: expected ';' before 'return'
   18 |   } while (next_permutation(Junb.begin(), Junb.end()))
      |                                                       ^
      |                                                       ;
......
   22 |   return 0;
      |   ~~~~~~
Language: C++

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


double Length(int x0,int y0,int x1,int y1){
    double res = ( x0 - x1 ) * ( x0 - x1 ) +  ( y0 - y1 ) * ( y0 - y1 );
    res = sqrt(res);
    return res;
}

int factorial( int N ){
    int res = 1;
    for ( int i = 1; i <= N; ++i){
        res = res * i;
    }
    return res;
}

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);
    }
    
    vector<int> C(N);
    for ( int i = 0; i < N; ++i){
        C.at(i) = i;
    }
    
    double res_all = 0;
    do {
        double res = 0;
        for ( int i = 0; i < N-1; ++i){
            res += Length(x.at(C.at(i)),y.at(C.at(i)),x.at(C.at(i+1)),y.at(C.at(i+1)));
        }
        //cout << res << endl;
        res_all += res;
    } while ( next_permutation(C.begin(),C.end()) );
    
    //cout << res_all / factorial(N) << endl;
    printf("%10.10f \n", res_all / factorial(N)  );
    
    return 0;
}


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

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

int n;
int x[n], y[n];

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(){
    cin >> n;
    rep(i,n) cin >> x[i] >> y[i];
    double ans = 0.0;
    rep(i,n){
        for(int j = i+1;j < n;j++) ans += dist(i,j) * 2 / n;
    }
    cout << fixed << setprecision(10) << ans << endl;
}

Compiler output:
a.cc:8:7: error: size of array 'x' is not an integral constant-expression
    8 | int x[n], y[n];
      |       ^
a.cc:8:13: error: size of array 'y' is not an integral constant-expression
    8 | int x[n], y[n];
      |             ^
Language: C++

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

int n;
int x[n], y[n];

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(){
    cin >> n;
    rep(i,n) cin >> x[i] >> y[i];
    double ans = 0.0;
    rep(i,n){
        rep(j,n) ans += dist(i,j) * 2 / n;
    }
}

Compiler output:
a.cc:8:7: error: size of array 'x' is not an integral constant-expression
    8 | int x[n], y[n];
      |       ^
a.cc:8:13: error: size of array 'y' is not an integral constant-expression
    8 | int x[n], y[n];
      |             ^
Language: C++

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

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;
    int x[n],y[n];
    rep(i,n) cin >> x[i] >> y[i];
    double ans = 0.0;
    rep(i,n){
        rep(j,n) ans += dist(i,j) * 2 / n;
    }
}

Compiler output:
a.cc: In function 'double dist(int, int)':
a.cc:8:17: error: 'x' was not declared in this scope; did you mean 'dx'?
    8 |     double dx = x[i] - x[j];
      |                 ^
      |                 dx
a.cc:9:17: error: 'y' was not declared in this scope; did you mean 'dy'?
    9 |     double dy = y[i] - y[j];
      |                 ^
      |                 dy
Language: C++

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

int main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  for(int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  double v = 0, dn = n;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      if(!(i == j)) {
        v += sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
      }
    }
  }
  cout << v * 2 / dn;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: 'sqrt' was not declared in this scope
   18 |         v += 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[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++) xin >> 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; 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;
}
         
int main(){
  solve();
  return 0;
}
         

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:29: error: 'xin' was not declared in this scope; did you mean 'sin'?
   14 |   for(int i=1; i <= N; i++) xin >> x[i] >> y[i];
      |                             ^~~
      |                             sin
a.cc:20:46: error: expected ')' before ';' token
   20 |   }while(next_permutation(v.begin(), v.end());
      |         ~                                    ^
      |                                              )
a.cc:23:35: error: expected primary-expression before ':' token
   23 |   cout << sum / Factorial << endl;:
      |                                   ^
Language: C++

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

int main() {
	int n;
	cin>>n;
	vector<int>x(n),y(n);
	rep(i,n)cin>>x[i]>>y[i];
	
	auto dist=[&](int i,int j){
		double dx=x[i]-x[j];
		double dy=y[i]-y[j];
		return sqrt(dx*dx+dy*dy);
	};
	
	//初期順列
	vector<int>p(n);
	rep(i,n)p[i]=i;
	
	double len=0;
	int cnt=0;
	
	do{
		rep(i,n-1)len+=dist(p[i],p[i+1]);//iはn-1までで全部計算される
		cnt++;
	}while(next_permutation(p.begin(),p.end()));
	
	double ans=len/cnt;
	
	cout<<fixed<<<<setprecision(10)<<ans<<endl;
}


//ラムダ式
//do-while文
//next_permutationの使い方(順列全探索)

//写経のはずが3WA

Compiler output:
a.cc: In function 'int main()':
a.cc:32:22: error: expected primary-expression before '<<' token
   32 |         cout<<fixed<<<<setprecision(10)<<ans<<endl;
      |                      ^~
Language: C

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

int main(void){
    int i, j, n, x[9], y[9];
    double sum = 0;
    scanf("%d", &n);
    for( i = 0; i < n; i++ ){
        scanf("%d %d", &x[i], &y[i]);
    }
    
    for( i = 0; i < n-1; i++ ){
        for( j = i+1; j < n; j++ ){
            sum += sqrt( (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]) );
        }
    }
    
    printf("%.10lf\n", sum*2/n);
    return 0;

Compiler output:
main.c: In function 'main':
main.c:19:5: error: expected declaration or statement at end of input
   19 |     return 0;
      |     ^~~~~~