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

// at_abc145c.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
const int MAXN = 9;
pair<int, int>arr[MAXN];
int main()
{
    int n;cin >> n;
    vector<int>v;
    double dist = 0;
    double fact = 1;
    for (int i = 0;i < n;i++) {
        fact *= (i + 1);
        v.push_back(i);
        cin >> arr[i].first >> arr[i].second;
    }
    do {
        double temp = 0;
        for (int i = 0;i < n-1;i++) {
            //temp += sqrt((arr[v[i]].first - v[i + 1].first) * (arr[i].first - arr[i + 1].first) + (arr[i].second - arr[i + 1].second) * (arr[i].second - arr[i + 1].second));
            dist += sqrt((arr[v[i]].first - arr[v[i + 1]].first) * (arr[v[i]].first - arr[v[i + 1]].first) + (arr[v[i]].second - arr[v[i + 1]].second) * (arr[v[i]].second - arr[v[i + 1]].second));
        }
       /* for (auto x : v) {
            cout << x << " ";
        }
        cout << temp << "\n";*/
    } while (next_permutation(v.begin(), v.end()));
    dist /= fact;
    cout << dist << "\n";
    //printf("%.7f", dist);
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
8

Compiler output:
a.cc:48:1: error: expected unqualified-id before numeric constant
   48 | 8
      | ^
Language: C++

// at_abc145c.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
const int MAXN = 9;
pair<int, int>arr[9];
int main()
{
    int n;cin >> n;
    vector<int>v;
    double dist = 0;
    double fact = 1;
    for (int i = 0;i < n;i++) {
        fact *= (i + 1);
        v.push_back(i);
        cin >> arr[i].first >> arr[i].second;
    }
    do {
        double temp = 0;
        for (int i = 0;i < n-1;i++) {
            //temp += sqrt((arr[v[i]].first - v[i + 1].first) * (arr[i].first - arr[i + 1].first) + (arr[i].second - arr[i + 1].second) * (arr[i].second - arr[i + 1].second));
            dist += sqrt((arr[v[i]].first - arr[v[i + 1]].first) * (arr[v[i]].first - arr[v[i + 1]].first) + (arr[v[i]].second - arr[v[i + 1]].second) * (arr[v[i]].second - arr[v[i + 1]].second));
        }
       /* for (auto x : v) {
            cout << x << " ";
        }
        cout << temp << "\n";*/
    } while (next_permutation(v.begin(), v.end()));
    dist /= fact;
    cout << dist << "\n";
    //printf("%.7f", dist);
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
8

Compiler output:
a.cc:48:1: error: expected unqualified-id before numeric constant
   48 | 8
      | ^
Language: C++

// at_abc145c.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
const int MAXN = 9;
pair<int, int>arr[9];
int main()
{
    int n;cin >> n;
    vector<int>v;
    double dist = 0;
    double fact = 1;
    for (int i = 0;i < n;i++) {
        fact *= (i + 1);
        v.push_back(i);
        cin >> arr[i].first >> arr[i].second;
    }
    do {
        double temp = 0;
        for (int i = 0;i < n-1;i++) {
            //temp += sqrt((arr[v[i]].first - v[i + 1].first) * (arr[i].first - arr[i + 1].first) + (arr[i].second - arr[i + 1].second) * (arr[i].second - arr[i + 1].second));
            dist += sqrt((arr[v[i]].first - arr[v[i + 1]].first) * (arr[v[i]].first - arr[v[i + 1]].first) + (arr[v[i]].second - arr[v[i + 1]].second) * (arr[v[i]].second - arr[v[i + 1]].second));
        }
       /* for (auto x : v) {
            cout << x << " ";
        }
        cout << temp << "\n";*/
    } while (next_permutation(v.begin(), v.end()));
    dist /= fact;
    printf("%.7f", dist);
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
8

Compiler output:
a.cc:47:1: error: expected unqualified-id before numeric constant
   47 | 8
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<float> x(n),y(n);
    for(int i= 0; i < n; i++){
        cin >> x[i] >> y[i];
    }
    float sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            float d = sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] ^ y[j]) * (y[i] - y[j]));
            d *= (n - 1);
            d *= 2;
            sum += d;
        }
    }
    cout << sum / n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:66: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<float>, float>::value_type' {aka 'float'} and '__gnu_cxx::__alloc_traits<std::allocator<float>, float>::value_type' {aka 'float'} to binary 'operator^'
   13 |             float d = sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] ^ y[j]) * (y[i] - y[j]));
Language: C++

#include<iostream>
using namespace std;
int fact(int n)
{
  if(n==1) return 1;
  else return n*fact(n-1);
}

int main()
{
  int n;
  cin>>n;
  int x[n],y[n];
  for(int i=0;i<n;i++)
  {
    cin>>x[i]>>y[i];
  }
  double r=(double)2*fact(n-1);
  double d=0;
  for(int i=0;i<n;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      d+=*sqrt(pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2));
    }
  }
  d=d*r;
  d=d/fact(n);
  cout<<d;
}
    
        
        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: 'pow' was not declared in this scope
   24 |       d+=*sqrt(pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2));
      |                ^~~
a.cc:24:11: error: 'sqrt' was not declared in this scope
   24 |       d+=*sqrt(pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2));
      |           ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <functional>
#include <numeric>
#include <limits>
#include <iomanip>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
using pll = pair<long long, long long>;
#define min(a, b) ((a) < (b) ? (a) : (b))



long long gcd(long long a, long long b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}

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

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

int main() {
	int N;
	cin >> N;
	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;
}


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

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

int main(){
  int N;
  cin >> N;
  int x[10], y[10];
  for(int i=0; i<N; i++){
    cin >> x[i] >> y[i];
  }
  double total = 0.0;
  int perm[N];
  for(int i=0; i<N; i++) perm[i] = i;
  do{
    for(int i=1; i<N; i++){
      total += sqrt(pow(x[i] - x[i-1], 2) + pow(y[j] - y[j-1], 2));
    }
  }while(next_permutation(perm, perm + n));
  int num = 1;
  for(int i=1; i<=N; i++) num *= i;
  double ans = total / num;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:51: error: 'j' was not declared in this scope
   16 |       total += sqrt(pow(x[i] - x[i-1], 2) + pow(y[j] - y[j-1], 2));
      |                                                   ^
a.cc:18:40: error: 'n' was not declared in this scope
   18 |   }while(next_permutation(perm, perm + n));
      |                                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
float ed(pair<int,int> a,pair<int,int> b)
{
  return sqrt((a.first-b.first)*(a.first-b.first) + (a.second-b.second)*(a.second-b.second));
}
float dist(vector<pair<int,int>> &v,vector<int> &p)
{
  float sum=0.0;
  for(int i=0;i<p.size()-1;i++)
    sum += ed(v[p[i]],v[p[i+1]]);
  return sum;
}
int main()
{
  int n;
  vector<int> p;
  cin>>n;
  vector<pair<int,int>> v;
  for(auto &i:v)
    cin>>i.first>>i.second;
  p.resize(n);
  for(int i=0;i<n;i++)
    p[i]=i;
  float k=0.0,sum=0.0;
  do
  {
    sum += dist(v,p);
    k+=1.0;
  }while(next_permutation(p.begin(),p.end());
  cout<<float(sum)/float(k)<<"\n";       
  return 0;
}

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

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

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

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

N=int(input())

P= [tuple(map(int,input().split())) for i in range(N)]


from math import sqrt
def d(p1,p2):
    x1,y1=p1
    x2,y2=p2
    return sqrt((x1-x2)**2 + (y1-y2)**2)

s=0
n=0

import itertools
from functools import reduce
for p in itertools.permutations(P):
    s += sum( [ d(p[i],p[i+1]) for i in range(N-1) ] )
    n+=1
print(s/n)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,a[],b[];
cin>>n;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
a[i]=x;
b[i]=y;
}
int sum=0;
int num=0;
for(int i=0;i<n;i++){
if(a[i]==a[i+1] || b[i]==b[i+1])
continue;
else{
sum+=sqrt((a[i]-a[i+1])^2);
num+=sqrt((b[i]=b[i+1])^2);
}
}
cout<<sum+num;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: storage size of 'a' isn't known
    5 | int n,a[],b[];
      |       ^
a.cc:5:11: error: storage size of 'b' isn't known
    5 | int n,a[],b[];
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,a[1000],b[1000];
cin>>n;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
a[i]=x;
b[i]=y;
}
int sum=0;
int num=0;
for(int i=0;i<n;i++){
if(a[i]==a[i+1] || b[i]==b[i+1])
continue;
else{
sum+=sqrt((a[i]-a[i+1])^2);
num+=sqrt((b[i]=b[i+1])^2);
}
}
cout<<sum+num;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: 'sqrt' was not declared in this scope
   18 | sum+=sqrt((a[i]-a[i+1])^2);
      |      ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,a[1000],b[1000];
cin>>n;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
a[i]=x;
b[i]=y;
}
for(int i=0;i<n;i++){
if(a[i]==a[i+1] || b[i]==b[i+1])
continue;
else{
sum+=sqrt((a[i]-a[i+1])^2);
num+=sqrt((b[i]=b[i+1])^2);
}
}
cout<<sum+num;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:1: error: 'sum' was not declared in this scope
   16 | sum+=sqrt((a[i]-a[i+1])^2);
      | ^~~
a.cc:16:6: error: 'sqrt' was not declared in this scope
   16 | sum+=sqrt((a[i]-a[i+1])^2);
      |      ^~~~
a.cc:17:1: error: 'num' was not declared in this scope; did you mean 'enum'?
   17 | num+=sqrt((b[i]=b[i+1])^2);
      | ^~~
      | enum
a.cc:20:7: error: 'sum' was not declared in this scope
   20 | cout<<sum+num;
      |       ^~~
a.cc:20:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 | cout<<sum+num;
      |           ^~~
      |           enum
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,a[],b[];
cin>>n;
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
a[i]=x;
b[i]=y;
}
for(int i=0;i<n;i++){
if(a[i]==a[i+1] || b[i]==b[i+1])
continue;
else{
sum+=sqrt((a[i]-a[i+1])^2);
num+=sqrt((b[i]=b[i+1])^2);
}
}
cout<<sum+num;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: storage size of 'a' isn't known
    4 | int n,a[],b[];
      |       ^
a.cc:4:11: error: storage size of 'b' isn't known
    4 | int n,a[],b[];
      |           ^
a.cc:16:1: error: 'sum' was not declared in this scope
   16 | sum+=sqrt((a[i]-a[i+1])^2);
      | ^~~
a.cc:16:6: error: 'sqrt' was not declared in this scope
   16 | sum+=sqrt((a[i]-a[i+1])^2);
      |      ^~~~
a.cc:17:1: error: 'num' was not declared in this scope; did you mean 'enum'?
   17 | num+=sqrt((b[i]=b[i+1])^2);
      | ^~~
      | enum
a.cc:20:7: error: 'sum' was not declared in this scope
   20 | cout<<sum+num;
      |       ^~~
a.cc:20:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 | cout<<sum+num;
      |           ^~~
      |           enum
Language: C++

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

double dist(pair<double, double> a, pair<double, double> b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); 
}

int main() {
	int n; cin >> n;
  	vector<pair<double, double> > v(n);
  	for (int i = 0; i < n; i++) {
    	cin >> v[i].first >> v[i].second;
    }
	double avg = 0;
  	sort(v.begin(), v.end());
  	do {
    	for (int i = 1; i < n; i++) {
        	ans += dist(v[i - 1], v[i]);
        }
    }
  	while (next_permutation(v.begin(), v.end());
    double fact = n;
    while (--n) fact *= n;
    cout << avg / fact << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |                 ans += dist(v[i - 1], v[i]);
      |                 ^~~
      |                 abs
a.cc:21:52: error: expected ')' before ';' token
   21 |         while (next_permutation(v.begin(), v.end());
      |               ~                                    ^
      |                                                    )
Language: C++

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

double dist(pair<double, double> a, pair<double, double> b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); 
}

int main() {
	int n; cin >> n;
  	vector<pair<double, double> > v(n);
  	for (int i = 0; i < n; i++) {
    	cin >> v[i].first >> v[i].second;
    }
	double avg = 0;
  	for (int i = 0; i < n; i++) {
     	for (int j = i + 1; j < n; j++) {
        	avg += dist(v[i], v[j]); 
        }
    }
  	avg /= (n - 1) / 2;
  	cout << set_precision(12) << avg << endl;
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'set_precision' was not declared in this scope
   21 |         cout << set_precision(12) << avg << endl;
      |                 ^~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

double dist(pair<double, double> a, pair<double, double> b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); 
}

int main() {
	int n; cin >> n;
  	vector<pair<double, double> > v(n);
  	for (int i = 0; i < n; i++) {
    	cin >> v[i].first >> v[i].second;
    }
	double avg = 0;
  	for (int i = 0; i < n; i++) {
     	for (int j = i + 1; j < n; j++) {
        	avg += dist(v[i], v[j]); 
        }
    }
  	avg /= (n - 1) / 2;
  	cout << set_precision(12) << avg << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'double dist(std::pair<double, double>, std::pair<double, double>)':
a.cc:5:16: error: 'sqrt' was not declared in this scope
    5 |         return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
      |                ^~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<pair<double, double> > v(n);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:10:37: error: expected primary-expression before '>' token
   10 |         vector<pair<double, double> > v(n);
      |                                     ^
a.cc:10:39: error: 'v' was not declared in this scope
   10 |         vector<pair<double, double> > v(n);
      |                                       ^
a.cc:21:17: error: 'set_precision' was not declared in this scope
   21 |         cout << set_precision(12) << avg << endl;
      |                 ^~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

double dist(pair<double, double> a, pair<double, double> b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); 
}

int main() {
	int n; cin >> n;
  	vector<pair<double, double>> v(n);
  	for (int i = 0; i < n; i++) {
    	cin >> v[i].first >> v[i].second;
    }
	double avg = 0;
  	for (int i = 0; i < n; i++) {
     	for (int j = i + 1; j < n; j++) {
        	avg += dist(v[i], v[j]); 
        }
    }
  	avg /= (n - 1) / 2;
  	cout << setprecision(12) << avg << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'double dist(std::pair<double, double>, std::pair<double, double>)':
a.cc:5:16: error: 'sqrt' was not declared in this scope
    5 |         return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
      |                ^~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<pair<double, double>> v(n);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:10:35: error: expected primary-expression before '>' token
   10 |         vector<pair<double, double>> v(n);
      |                                   ^~
a.cc:10:38: error: 'v' was not declared in this scope
   10 |         vector<pair<double, double>> v(n);
      |                                      ^
a.cc:21:17: error: 'setprecision' was not declared in this scope
   21 |         cout << setprecision(12) << avg << endl;
      |                 ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C

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

using namespace std;

double dist(double x1, double x2, double y1, double y2)
{
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int main(void)
{
    int N;
    vector<double> x, y;

    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++)
    {
        double a, b;
        cin >> a >> b;
        x.push_back(a);
        y.push_back(b);
    }
    double sum = 0;
    int count = 0;
    do
    {
        for (int i = 0; N - 1; i++)
        {
            sum += dist(x[v[i]], x[v[i + 1]], y[v[i]], y[v[i + 1]]);
            count++;
        }
    } while (next_permutation(v.begin(), v.end()));

    double ans = sum / count;

    cout << fixed << setprecision(6) << ans << endl;
    return 0;
}

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

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

using namespace std;

double dist(double x1, double x2, double y1, double y2)
{
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int main(void)
{
    int N;
    vector<double> x, y;

    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++)
    {
        double a, b;
        cin >> a >> b;
        x.push_back(a);
        y.push_back(b);
    }
    double sum = 0;
    int count = 0;
    do
    {
        for (int i; N - 1; i++)
        {
            sum += dist(x[v[i]], x[v[i + 1]], y[v[i]], y[v[i + 1]]);
            count++;
        }
    } while (next_permutation(v.begin(), v.end()));

    double ans = sum / count;

    cout << fixed << setprecision(6) << ans << endl;
    return 0;
}

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

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

using namespace std;

double dist(double x1, double x2, double y1, double y2)
{
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int main(void)
{
    int N;
    vector<double> x, y;

    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++)
    {
        double a, b;
        cin >> a >> b;
        x.push_back(a);
        y.push_back(b);
    }
    double sum = 0;
    int count = 0;
    do
    {
        for (int i; N - 1; i++)
        {
            sum += dist(x[v[i]], x[v[i + 1]], y[v[i]], y[v[i + 1]]);
            count++;
        }
    } while (next_permutation(v.begin(), v.end()));

    double ans = sum / count;

    cout << ans << endl;
    return 0;
}

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

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

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> x(N);
	vector<int> y(N);
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	/*順列を用いて経路を全列挙したもの*/
	auto dist = [&](int i, int j) {
		double dx = x[i] - x[j];
		double dy = x[i] - x[j];
		return sqrt(dx * dx + dy * dy);
	};
	vi 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 = len / cnt;
	printf("%.10f\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'vi' was not declared in this scope
   23 |         vi p(N);
      |         ^~
a.cc:25:17: error: 'p' was not declared in this scope
   25 |                 p[i] = i;
      |                 ^
a.cc:31:37: error: 'p' was not declared in this scope
   31 |                         len += dist(p[i], p[i + 1]);
      |                                     ^
a.cc:34:35: error: 'p' was not declared in this scope
   34 |         } while (next_permutation(p.begin(), p.end()));/*順列*/
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> x(N);
	vector<int> y(N);
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[j];
	}
	/*ある辺が何度使われるか：X
	分子＝sum{(辺の長さ)*X}*/
	auto dist = [&](int i, int j) {
		double dx = x[i] - x[j];
		double dy = x[i] - x[j];
		return sqrt(dx * dx + dy * dy);
	};
	double len = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < i; j++) {
			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:9:34: error: 'j' was not declared in this scope
    9 |                 cin >> x[i] >> y[j];
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	vi x(N);
	vi y(N);
	for (int i = 0; i < N; i++) {
		cin >> x.at(i) >> y.at(i);
	}
	/*ある辺が何度使われるか：X
	分子＝sum{(辺の長さ)*X}*/
	auto dist = [&](int i, int j) {
		double dx = x[i] - x[j];
		double dy = x[i] - x[j];
		return sqrt(dx * dx + dy * dy);
	};
	double len = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < i; j++) {
			len += dist(i, j);
		}
	}
		int x = 2; /*分子*/
		for (int i = N - 1; i >= 1; i--) {
			x *= i;
		}
		int fact = 1; /*分母*/
		for (int i = N; i >= 1; i--) {
			fact *= i;
		}
		double ans = (len * x) / fact;
		printf("%.10f\n", ans);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'vi' was not declared in this scope
    6 |         vi x(N);
      |         ^~
a.cc:7:11: error: expected ';' before 'y'
    7 |         vi y(N);
      |           ^~
      |           ;
a.cc:9:24: error: 'x' was not declared in this scope
    9 |                 cin >> x.at(i) >> y.at(i);
      |                        ^
a.cc:9:35: error: 'y' was not declared in this scope
    9 |                 cin >> x.at(i) >> y.at(i);
      |                                   ^
a.cc: In lambda function:
a.cc:14:29: error: 'x' was not declared in this scope
   14 |                 double dx = x[i] - x[j];
      |                             ^
Language: C++

#include<bits/stdc++.H>
using namespace std;
int fact(int n)
{
  int ans=1;
  for(int i=n;i>=2;i--)
  {
    ans*=i;
  }
  return ans;
}
int main()
{
  int n;
  cin>>n;
  int x[n],y[n];
  double ans,sum;
  for(int i=0;i<n;i++)
  {
    cin>>x[i]>>y[i];
  }
  for(int i=0;i<n-1;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      ans=pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2);
      sum+=sqrt(ans);
    }
  }
  sum*=(2*fact(n-1));
  cout<<(sum/fact(n))<<endl;
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++.H: No such file or directory
    1 | #include<bits/stdc++.H>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int x[10];
int y[10];
int p[10];

double d(int i, int j) {
  return sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
}

int main() {
  int n;
  cin >> n;
  for (int i=0; i<n; i++){
    cin >> x[i] >> y[i];
    p[i] = i;
  }
  
  double sum = 0;
  int  cnt = 0;
  
  do {
    for (int i=0; i<n-1; i++){
      sum += d(p[i], p[i+1]);
    }
    cnt++;
  }while(next_permutation(p.begin(),p.end()));
  
  printf("%.8f\n", sum/cnt);
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:29: error: request for member 'begin' in 'p', which is of non-class type 'int [10]'
   28 |   }while(next_permutation(p.begin(),p.end()));
      |                             ^~~~~
a.cc:28:39: error: request for member 'end' in 'p', which is of non-class type 'int [10]'
   28 |   }while(next_permutation(p.begin(),p.end()));
      |                                       ^~~
Language: C++

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

double getlength(int xi, int xj, int yi, int yj) {
  double length;
  int dx = xi-xj;
  int dy = yi-yj;
  length = sqrt(dx*dx + dy*dy);
  return length;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> x(n);
  vector<int> y(n);
  for (int i=0; i<n; i++){
    cin >> x[i];
    xin >> y[i];
  }
  
  double sum = 0.0;
  
  for (int i=0; i<n; i++){
    for (int j=0; j<i; j++){
      sum += getlength(x[i],x[j],y[i],y[j]);
    }
  }
  
  int ni=1;
  for (int i=1; i<=n; i++){
    ni *= i;
  }
  
  cout << sum/ni << endl;
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'xin' was not declared in this scope; did you mean 'sin'?
   20 |     xin >> y[i];
      |     ^~~
      |     sin
Language: C++

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

double getlength(int xi, int xj, int yi, int yj) {
  double length;
  dx = xi-xj;
  dy = yi-yj;
  length = sqrt(dx*dx + dy*dy);
  return length;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> x(n);
  vector<int> y(n);
  for (int i=0; i<n; i++){
    cin >> x[i];
    xin >> y[i];
  }
  
  double sum = 0.0;
  
  for (int i=0; i<n; i++){
    for (int j=0; j<i; j++){
      sum += getlength(x[i],x[j],y[i],y[j]);
    }
  }
  
  int ni=1;
  for (int i=1; i<=n; i++){
    ni *= i;
  }
  
  cout << sum/ni << endl;
  
}



Compiler output:
a.cc: In function 'double getlength(int, int, int, int)':
a.cc:6:3: error: 'dx' was not declared in this scope
    6 |   dx = xi-xj;
      |   ^~
a.cc:7:3: error: 'dy' was not declared in this scope
    7 |   dy = yi-yj;
      |   ^~
a.cc: In function 'int main()':
a.cc:20:5: error: 'xin' was not declared in this scope; did you mean 'sin'?
   20 |     xin >> y[i];
      |     ^~~
      |     sin
Language: C

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define L_T_S_K ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);  
const int mod = 1e18 + 7;
const int N = 21;
std::vector <set <string> > v(N);

int32_t main(){
 L_T_S_K;
 int n;
 cin >> n;
 int x[n] , y[n];
 for(int i = 0 ; i < n ;i++){
  cin >> x[i] >> y[i];
 }
 double ans = 0;
 std::vector<int> v(n , 0);
 iota(v.begin() , v.end() , 0);
 do{
    for(int i = 0 ; i < n - 1  ;i++){
      ans+=sqrt((x[v[i]] - x[v[i + 1]]) * (x[v[i]] - x[v[i + 1]]) + (y[v[i]] - y[v[i + 1]]) * (y[v[i]] - y[v[i + 1]]) );
    }
 }while(next_permutation(v.begin() , v.end()) );
 int fact = 1;
 for(int i = 1 ; i <= n ;i++) fact*=i;
 cout << fixed << setprecision(10) << ans/fact << "\n";
  return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
vector<int> x(10), y(10);
double dist(int i, int j) {
  double dx = x[i] - x[j];
  double dy = y[i] - y[j];
  return sqrt(dx * dx + dy * dy);
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }

  vector<int> s(n);
  for (int i = 0; i < n; i++) {
    s[i] = i;
  }
  double sum = 0;
  int cnt = 0;
  do {
    for (int i = 0; i < n - 1; i++) {
      sum += dist(s[i], s[i + 1]);
    }
    cnt++;
  } while (next_permutation(s.begin(), s.end()));
  double ans = sum / cnt;
  printf("%0.6f\n", ans);
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int N,num;
    num = 0;
    cin >> N;
    vector<int> x;
    vector<int> y;
    double sum = 0;
    for(int i=0;i<N;i++){
        cin >> x[i] >> y[i];
         num *= (i+1);
    }
   
   

    for(int i=0;i<N/2;i++){
        for(int j=N-1;j>N/2;j--){
            sum += sqrt((pow(x[i]-x[j],2.0)+pow(y[i]-y[j],2.0));
        }
    }
    
    cout << fixed << setprecision(10) << sum / num;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:64: error: expected ')' before ';' token
   20 |             sum += sqrt((pow(x[i]-x[j],2.0)+pow(y[i]-y[j],2.0));
      |                        ~                                       ^
      |                                                                )
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    vector<int> x;
    vector<int> y;
    double sum;
    for(int i=0;i<N;i++){
        cin >> x[i] >> y[i];
    }
    int num = 1;
    for(int i=0;i<N;i++){
        num *= (i+1);
    }

    for(int i=0;i<N/2;i++){
        for(int j=N-1;j>N/2;j++){
            sum += sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
        }
    }
    
    cout << (double)sum / num;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:59: error: expected ';' before '}' token
   22 |             sum += sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
      |                                                           ^
      |                                                           ;
   23 |         }
      |         ~
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    vector<int> x;
    vector<int> y;

    for(int i=0;i<N;i++){
        cin >> x[i] >> y[i];
    }
    int num = 1;
    for(int i=0;i<N;i++){
        num *= (i+1);
    }

    for(int i=0;i<N/2;i++){
        for(int j=N-1;j>N/2;j++){
            sum += sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
        }
    }
    
    cout << (double)sum / num;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'sum' was not declared in this scope; did you mean 'num'?
   22 |             sum += sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2))
      |             ^~~
      |             num
a.cc:26:21: error: 'sum' was not declared in this scope; did you mean 'num'?
   26 |     cout << (double)sum / num;
      |                     ^~~
      |                     num
Language: C++

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

double distant(int xi, int xj, int yi, int yj) {
  double dx = xi - xj;
  double dy = yi - yj;
  double dist = pow(dx*dx + dy*dy, 0.5);
  return dist;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> x(n);
  vector<int> y(n);
  for (int i=0; i<n; i++){
    cin >> x[i];
    cin >> y[i];
  }
  
  int factorial=1;
  for (int i=1; i<=n; i++) factorial*=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++){
      double dist = distant(x[i],x[i+1],y[i],y[i+1]);
      sum += dist;
    }
  }while(next_permutaion(v.begin(), v.end()));
  
  cout << fixed << setprecision(6) << sum/factorial << endl;
  
}


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

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

double distant(int xi, int xj, int yi, int yj) {
  double dx = xi - xj;
  double dy = yi - yj;
  double dist = pow(dx*dx + dy*dy, 0.5);
  return dist;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> x(n);
  vector<int> y(n);
  for (int i=0; i<n; i++){
    cin >> x[i];
    cin >> y[i];
  }
  
  int fraction=1;
  for (int i=1; i<=n; i++) fraction*=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++){
      double dist = distant(x[i],x[i+1],y[i],y[i+1]);
      sum += dist;
    }
  }while(next_permutaion(v.begin(), v.end()));
  
  cout << fixed << setput(6) << sum/fraction << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'next_permutaion' was not declared in this scope
   34 |   }while(next_permutaion(v.begin(), v.end()));
      |          ^~~~~~~~~~~~~~~
a.cc:36:20: error: 'setput' was not declared in this scope; did you mean 'setbuf'?
   36 |   cout << fixed << setput(6) << sum/fraction << endl;
      |                    ^~~~~~
      |                    setbuf
Language: C++

#include<cstdio>
#include<set>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdlib>
#include<time.h>
#include<string>
#include<stack>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<complex>
using namespace std;
using namespace tr1;
#define FOR(i,j,k) for(int i=j;i<k;i++)
#define FORD(i,j,k) for(int i=j;i>=k;i--)
#define ll long long
#define ull unsigned long long int
//Make sure no overflow problems
#define pii  pair<int, int>
#define vi vector<int >
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define VAR(i,n) __typeof(n) i = (n)
#define FOREACH(i,c) for(VAR(i,(c).begin());i!=(c).end();i++)
#define FORDEACH(i,c) for( VAR(i,(c).rbegin()),i!=(c).rend();i++)
#define REP(i,n) FOR(i,0,n)
#define ld long double
const int INF = 1000000009;
const long long INFLL = (ll)INF * (ll)INF;
const ld EPS = 10e-9;

int main(){
    ios_base:: sync_with_stdio(false); 
       cin.tie(0);


           int n;
           double total = 0;
        cin >> n;
        int x[n], y[n];
        FOR(i,0,n)
            cin >> x[i] >> y[i];
        FOR(i,0,n)
            FOR(j,i+1,n)
                total += 2*sqrt((x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]));
        cout << setprecision(10) << fixed << total/n << endl;
           return 0;
}



Compiler output:
a.cc:17:17: error: 'tr1' is not a namespace-name
   17 | using namespace tr1;
      |                 ^~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    double ans;
    for(int i=0; i<n; i++){
        cin >> a.at(i) >> b.at(i);
        for(int j=0; j<i; j++){
            ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
        }
    }
    ans = ans * 2 / n;
    cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> a(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> a(n);
      |            ^~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> b(n);
      |            ^~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                ^
a.cc:11:27: error: 'b' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                           ^
a.cc:13:20: error: 'sqrt' was not declared in this scope
   13 |             ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
      |                    ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << ans << endl;
      |     ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vectro<int> b(n);
    double ans;
    for(int i=0; i<n; i++){
        cin >> a.at(i) >> b.at(i);
        for(int j=0; j<i; j++){
            ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
        }
    }
    ans = ans * 2 / n;
    cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> a(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> a(n);
      |            ^~~
a.cc:8:5: error: 'vectro' was not declared in this scope
    8 |     vectro<int> b(n);
      |     ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vectro<int> b(n);
      |            ^~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                ^
a.cc:11:27: error: 'b' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                           ^
a.cc:13:20: error: 'sqrt' was not declared in this scope
   13 |             ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
      |                    ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << ans << endl;
      |     ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vectro<int> b(n);
    double ans;
    for(int i=0; i<n; i++){
        cin >> a.at(i) >> b.at(i);
        for(int j=0; j<i; j++){
            ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
        }
    }
    ans = ans * 2 / n;
    cout << setprecision(10) << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> a(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> a(n);
      |            ^~~
a.cc:8:5: error: 'vectro' was not declared in this scope
    8 |     vectro<int> b(n);
      |     ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vectro<int> b(n);
      |            ^~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                ^
a.cc:11:27: error: 'b' was not declared in this scope
   11 |         cin >> a.at(i) >> b.at(i);
      |                           ^
a.cc:13:20: error: 'sqrt' was not declared in this scope
   13 |             ans += sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
      |                    ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << setprecision(10) << ans << endl;
      |     ^~~~
a.cc:17:13: error: 'setprecision' was not declared in this scope
   17 |     cout << setprecision(10) << ans << endl;
      |             ^~~~~~~~~~~~
a.cc:17:40: error: 'endl' was not declared in this scope
   17 |     cout << setprecision(10) << ans << endl;
      |                                        ^~~~
Language: C++

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

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

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

void solve() {
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for (int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for (int i = 0; i < N-1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));

    int factorial = 1;
    for (int i = 2; i <= N; i++) factorial *= i;
    cout << sum/factorial << endl;
    return;
}

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

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

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

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

void solve() {
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for (int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for (int i = 0; i < N-1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));

    int factorial = 1;
    for (int i = 2; i <= N; i++) factorial *= i;
    cout << sum/factorial << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   26 |     return 0;
      |            ^
Language: C++

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

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

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

void solve() {
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for (int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for (int i = 0; i < N-1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));

    int factorial = 1;
    for (int i = 2; i <= N; i++) factorial *= i;
    cout << sum/factorial << endl;
    
}

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 <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:49: error: expected ')' before ';' token
   26 |     } while(next_permutation(p.begin(), p.end());
      |            ~                                    ^
      |                                                 )
a.cc:27:18: error: 'let' was not declared in this scope; did you mean 'len'?
   27 |     double ans = let/cnt;
      |                  ^~~
      |                  len