criyle/codenet-compile-errors huggingface dataset:
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<<ans<<setprecision(10)<<endl;
}


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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected primary-expression before ']' token
   12 |         auto dist[&](int i,int j){
      |                    ^
a.cc:13:17: error: expected primary-expression before 'double'
   13 |                 double dx=x[i]-x[j];
      |                 ^~~~~~
a.cc:13:17: error: expected '}' before 'double'
a.cc:12:34: note: to match this '{'
   12 |         auto dist[&](int i,int j){
      |                                  ^
a.cc:14:29: error: 'i' was not declared in this scope
   14 |                 double dy=y[i]-y[j];
      |                             ^
a.cc:14:34: error: 'j' was not declared in this scope
   14 |                 double dy=y[i]-y[j];
      |                                  ^
a.cc:15:29: error: 'dx' was not declared in this scope; did you mean 'dy'?
   15 |                 return sqrt(dx*dx+dy*dy);
      |                             ^~
      |                             dy
a.cc: At global scope:
a.cc:18:22: error: 'n' was not declared in this scope; did you mean 'yn'?
   18 |         vector<int>p(n);
      |                      ^
      |                      yn
a.cc:2:19: error: expected unqualified-id before 'for'
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:19:9: note: in expansion of macro 'rep'
   19 |         rep(i,n)p[i]=i;
      |         ^~~
a.cc:19:13: error: 'i' does not name a type
   19 |         rep(i,n)p[i]=i;
      |             ^
a.cc:2:35: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
a.cc:19:13: error: 'i' does not name a type
   19 |         rep(i,n)p[i]=i;
      |             ^
a.cc:2:49: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                                 ^
a.cc:23:9: error: expected unqualified-id before 'do'
   23 |         do{
      |         ^~
a.cc:26:10: error: expected unqualified-id before 'while'
   26 |         }while(next_permutation(p.begin(),p.end()));
      |          ^~~~~
a.cc:30:9: error: 'cout' does not name a type
   30 |         cout<<ans<<setprecision(10)<<endl;
      |         ^~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: Java

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

Compiler output:
Main.java:7: error: incompatible types: String[] cannot be converted to double[]
        double [] y = new String [a];
                      ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<pair<double,double>>X(N);
  for(int i=0;i<N;i++){
    cin>>X.at(i).first>>X.at(i).second;
  }
  double sum=0;
  sort(X.begin(),X.end());
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      sum=sum+sqrt((X.at(i).first-X.at(j).first)**2+(X.at(i).second-X.at(j).second)**2);
    }
  }
  int NN=N;
  for(int i=1;i<N;i++){
    NN=NN*i;
  }
  cout<<fixed<<setprecision(10)<<sum/NN<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:50: error: invalid type argument of unary '*' (have 'int')
   14 |       sum=sum+sqrt((X.at(i).first-X.at(j).first)**2+(X.at(i).second-X.at(j).second)**2);
      |                                                  ^~
a.cc:14:85: error: invalid type argument of unary '*' (have 'int')
   14 |       sum=sum+sqrt((X.at(i).first-X.at(j).first)**2+(X.at(i).second-X.at(j).second)**2);
      |                                                                                     ^~
Language: Java

import java.util.*;
public static List<String> list = new ArrayList<>();
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int sum2 = 0;
		int buf = 0;
		Map<Integer,ArrayList<Integer>> town = new HashMap<>();
		for(int i = 0;i < N;i++){
			ArrayList<Integer> point = new ArrayList<>();
			point.add(sc.nextInt());
			point.add(sc.nextInt());
			town.put(i,point);
		}
		list = new ArrayList<>();
		permutation(N);
		for(String s : list){
			for(int i = 0;i < N-1;i++){
				List<Integer> buf = new ArrayList<>();
				List<Integer> buf2 = new ArrayList<>();
				int town1 = s.charAt(i) - '0';
				int town2 = s.charAt(i+1) - '0';
				buf = town.get(town1);
				buf2 = town.get(town2);
				sum += Math.sqrt((buf[0] - buf2[0]) * (buf[0] - buf2[0]) + (buf[1] - buf2[1]) * (buf[1] - buf2[1]));
			}
			sum2 += sum;
			buf++;
		}
		System.out.println(sum2 / buf);
	}
	public static void permutation(int N){
		String number = null;
		boolean flg = true;
		for(int i = 0;i < N;i++){
			number += String.valueOf('0' + i);
		}
		while(flg){
			list.add(number);
			for(int i = N-1;i > 0;i--){
				if(number.charAt(i) > number.charAt(i-1)){
					if(i == N-1){
						number = number.substring(i - 1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1));
						continue;
					}else{
						number = number.substring(i-1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1)) + number.substring(i + 1,N);
						continue;
					}
				}else if(i == 1){
					flg = false;
				}
			}
		}
	}
}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static List<String> list = new ArrayList<>();
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;
public static ArrayList<String> list;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int sum2 = 0;
		int buf = 0;
		Map<Integer,ArrayList<Integer>> town = new HashMap<>();
		for(int i = 0;i < N;i++){
			ArrayList<Integer> point = new ArrayList<>();
			point.add(sc.nextInt());
			point.add(sc.nextInt());
			town.put(i,point);
		}
		list = new ArrayList<>();
		permutation(N);
		for(String s : list){
			for(int i = 0;i < N-1;i++){
				List<Integer> buf = new ArrayList<>();
				List<Integer> buf2 = new ArrayList<>();
				int town1 = s.charAt(i) - '0';
				int town2 = s.charAt(i+1) - '0';
				buf = town.get(town1);
				buf2 = town.get(town2);
				sum += Math.sqrt((buf[0] - buf2[0]) * (buf[0] - buf2[0]) + (buf[1] - buf2[1]) * (buf[1] - buf2[1]));
			}
			sum2 += sum;
			buf++;
		}
		System.out.println(sum2 / buf);
	}
	public static void permutation(int N){
		String number = null;
		boolean flg = true;
		for(int i = 0;i < N;i++){
			number += String.valueOf('0' + i);
		}
		while(flg){
			list.add(number);
			for(int i = N-1;i > 0;i--){
				if(number.charAt(i) > number.charAt(i-1)){
					if(i == N-1){
						number = number.substring(i - 1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1));
						continue;
					}else{
						number = number.substring(i-1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1)) + number.substring(i + 1,N);
						continue;
					}
				}else if(i == 1){
					flg = false;
				}
			}
		}
	}
}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static ArrayList<String> list;
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;
static List<String> list;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int sum2 = 0;
		int buf = 0;
		Map<Integer,ArrayList<Integer>> town = new HashMap<>();
		for(int i = 0;i < N;i++){
			ArrayList<Integer> point = new ArrayList<>();
			point.add(sc.nextInt());
			point.add(sc.nextInt());
			town.put(i,point);
		}
		list = new ArrayList<>();
		permutation(N);
		for(String s : list){
			for(int i = 0;i < N-1;i++){
				List<Integer> buf = new ArrayList<>();
				List<Integer> buf2 = new ArrayList<>();
				int town1 = s.charAt(i) - '0';
				int town2 = s.charAt(i+1) - '0';
				buf = town.get(town1);
				buf2 = town.get(town2);
				sum += Math.sqrt((buf[0] - buf2[0]) * (buf[0] - buf2[0]) + (buf[1] - buf2[1]) * (buf[1] - buf2[1]));
			}
			sum2 += sum;
			buf++;
		}
		System.out.println(sum2 / buf);
	}
	public static void permutation(int N){
		String number = null;
		boolean flg = true;
		for(int i = 0;i < N;i++){
			number += String.valueOf('0' + i);
		}
		while(flg){
			list.add(number);
			for(int i = N-1;i > 0;i--){
				if(number.charAt(i) > number.charAt(i-1)){
					if(i == N-1){
						number = number.substring(i - 1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1));
						continue;
					}else{
						number = number.substring(i-1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1)) + number.substring(i + 1,N);
						continue;
					}
				}else if(i == 1){
					flg = false;
				}
			}
		}
	}
}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
static List<String> list;
       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;
public static List<String> list;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int sum2 = 0;
		int buf = 0;
		Map<Integer,ArrayList<Integer>> town = new HashMap<>();
		for(int i = 0;i < N;i++){
			ArrayList<Integer> point = new ArrayList<>();
			point.add(sc.nextInt());
			point.add(sc.nextInt());
			town.put(i,point);
		}
		list = new ArrayList<>();
		permutation(N);
		for(String s : list){
			for(int i = 0;i < N-1;i++){
				List<Integer> buf = new ArrayList<>();
				List<Integer> buf2 = new ArrayList<>();
				int town1 = s.charAt(i) - '0';
				int town2 = s.charAt(i+1) - '0';
				buf = town.get(town1);
				buf2 = town.get(town2);
				sum += Math.sqrt((buf[0] - buf2[0]) * (buf[0] - buf2[0]) + (buf[1] - buf2[1]) * (buf[1] - buf2[1]));
			}
			sum2 += sum;
			buf++;
		}
		System.out.println(sum2 / buf);
	}
	public static void permutation(int N){
		String number = null;
		boolean flg = true;
		for(int i = 0;i < N;i++){
			number += String.valueOf('0' + i);
		}
		while(flg){
			list.add(number);
			for(int i = N-1;i > 0;i--){
				if(number.charAt(i) > number.charAt(i-1)){
					if(i == N-1){
						number = number.substring(i - 1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1));
						continue;
					}else{
						number = number.substring(i-1) + String.valueOf(number.charAt(i)) + String.valueOf(number.charAt(i - 1)) + number.substring(i + 1,N);
						continue;
					}
				}else if(i == 1){
					flg = false;
				}
			}
		}
	}
}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static List<String> list;
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  double N;
  cin>>N;
  double x[8], y[8];
  for(int i=0; i<N; i++) {cin>>x[i]; cin>>y[i];}
  double sum=0;
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
     sum+=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2));
    }}
  double ans=(2*sum)/N;
  cout<<fixed<<setprecision(30)<<ans<<endl;
}
  


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

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


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

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


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

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


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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before '<' token
   11 |     for(int j=i+1, j<N; j++){
      |                     ^
      |                     ;
a.cc:11:21: error: expected primary-expression before '<' token
a.cc:12:16: error: 'pow' was not declared in this scope
   12 |      sum+=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2))
      |                ^~~
a.cc:12:11: error: 'sqrt' was not declared in this scope
   12 |      sum+=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2))
      |           ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:44: error: 'i' was not declared in this scope
    8 |   for(int i=0; i<N; i++) cin>>x[i]; cin>>y[i];
      |                                            ^
a.cc:11:21: error: expected ';' before '<' token
   11 |     for(int j=i+1, j<N; j++){
      |                     ^
      |                     ;
a.cc:11:21: error: expected primary-expression before '<' token
a.cc:12:16: error: 'pow' was not declared in this scope
   12 |      sum+=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2))
      |                ^~~
a.cc:12:11: error: 'sqrt' was not declared in this scope
   12 |      sum+=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2))
      |           ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

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

int32_t main(){
    IOS;
    int n;
    cin>>n;
    int x[n],y[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    double ans=0;
    for(int i=2;i<n;i++) fact*=i;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            ans+=calc(x[i],y[i],x[j],y[j])*2;
        }
    }
    cout<<setprecision(10)<<ans/n<<endl;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:31:26: error: 'fact' was not declared in this scope
   31 |     for(int i=2;i<n;i++) fact*=i;
      |                          ^~~~
Language: C++

/* 
	今日も一日がんばるぞい
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<< '\n'

int main(){
    int n;
    cin >> n;
    int x[n],y[n];
    REP(i,n) cin >> x[i] >> y[i];
    
    double ans = 0;
    vector<int> v(n);
    REP(i,n) v[i] = i;
  　int count = 0;
    do{
        double dis = 0;
        for(int i=0;i<n-1;i++){
            double dx = x[v[i]] - x[v[i+1]];
            double dy = y[v[i]] - y[v[i+1]];
            dis += sqrt(dx*dx + dy*dy);
        }
        count++;
        ans += dis;
    }while(next_permutation(v.begin(),v.end()));
    ans /= count;
    cout << fixed << setprecision(15) << ans << endl;
    return 0;
}


Compiler output:
a.cc:27:3: error: extended character 　 is not valid in an identifier
   27 |   　int count = 0;
      |   ^
a.cc: In function 'int main()':
a.cc:27:3: error: '\U00003000int' was not declared in this scope
   27 |   　int count = 0;
      |   ^~~~~
a.cc:35:14: error: no post-increment operator for type
   35 |         count++;
      |              ^~
a.cc:38:12: error: overloaded function with no contextual type information
   38 |     ans /= count;
      |            ^~~~~
Language: C++

/* 
	今日も一日がんばるぞい
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<< '\n'

int main(){
    int n;
    cin >> n;
    int x[n],y[n];
    REP(i,n) cin >> x[i] >> y[i];
    
    double ans = 0;
    vector<int> v(n);
    REP(i,n) v[i] = i;
    do{
        double dis = 0;
        int count = 0;
        for(int i=0;i<n-1;i++){
            double dx = x[v[i]] - x[v[i+1]];
            double dy = y[v[i]] - y[v[i+1]];
            dis += sqrt(dx*dx + dy*dy);
        }
        count++;
        ans += dis;
    }while(next_permutation(v.begin(),v.end()));
    ans /= count;
    cout << fixed << setprecision(15) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: overloaded function with no contextual type information
   38 |     ans /= count;
      |            ^~~~~
Language: Java

package aaaa;

import java.util.Scanner;

public class E {
	  public static void main(String[] args) {
		    Scanner sc = new Scanner(System.in);
		    int N = sc.nextInt();
		    int x[] = new int[N];
		    int y[] = new int[N];
		    
		    for (int i = 0; i < N; i++) {
		      x[N] = sc.nextInt();
		      y[N] = sc.nextInt();
		    }
        	double sum = 0.0;
 			for(int i = 0; i < n; i++){
      			for(int j = i + 1; j < n; j++){
            	  sum += Math.sqrt((x[j] - x[i]) * (x[j] - x[i]) + (y[j] - y[i]) * (y[j] - y[i]));
                }
            }
	  }
}

Compiler output:
Main.java:5: error: class E is public, should be declared in a file named E.java
public class E {
       ^
Main.java:17: error: cannot find symbol
 			for(int i = 0; i < n; i++){
 			                   ^
  symbol:   variable n
  location: class E
Main.java:18: error: cannot find symbol
      			for(int j = i + 1; j < n; j++){
      			                       ^
  symbol:   variable n
  location: class E
3 errors
Language: C++

n=int(input())
XY=[]
for i in range(n):
    x,y=map(int,input().split())
    XY.append((x,y))
from itertools import permutations
perm=permutations(XY)

dists=[]
for i in perm:
    dist=0
    for j in range(1,3):
        dist+=((i[j][0]-i[j-1][0])**2+(i[j][1]-i[j-1][1])**2)**0.5
    dists.append(dist)
ans=sum(dists)/len(dists)
print(ans)


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

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

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 dis=0;
  int cnt=0;
  do{
      rep(i,n-1){
        dis+=dit(p[i],p[i+1]);
  }
    cnt++;
}while(next_permutation(p.begin(),p.end()));
  double ans=dis/cnt;
  printf("%.6f\n",ans);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before ']' token
   10 |   auto dist [&](int i,int j){
      |               ^
a.cc:11:5: error: expected primary-expression before 'double'
   11 |     double dx=x[i]-x[j];
      |     ^~~~~~
a.cc:11:5: error: expected '}' before 'double'
a.cc:10:29: note: to match this '{'
   10 |   auto dist [&](int i,int j){
      |                             ^
a.cc:12:17: error: 'i' was not declared in this scope
   12 |     double dy=y[i]-y[j];
      |                 ^
a.cc:12:22: error: 'j' was not declared in this scope
   12 |     double dy=y[i]-y[j];
      |                      ^
a.cc:13:17: error: 'dx' was not declared in this scope; did you mean 'dy'?
   13 |     return sqrt(dx*dx+dy*dy);
      |                 ^~
      |                 dy
a.cc: At global scope:
a.cc:15:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |   vector<int>p(n);
      |                ^
      |                yn
a.cc:3:18: error: expected unqualified-id before 'for'
    3 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:16:3: note: in expansion of macro 'rep'
   16 |   rep(i,n)p[i]=i;
      |   ^~~
a.cc:16:7: error: 'i' does not name a type
   16 |   rep(i,n)p[i]=i;
      |       ^
a.cc:3:30: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:16:7: error: 'i' does not name a type
   16 |   rep(i,n)p[i]=i;
      |       ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:19:3: error: expected unqualified-id before 'do'
   19 |   do{
      |   ^~
a.cc:24:2: error: expected unqualified-id before 'while'
   24 | }while(next_permutation(p.begin(),p.end()));
      |  ^~~~~
a.cc:26:9: error: expected constructor, destructor, or type conversion before '(' token
   26 |   printf("%.6f\n",ans);
      |         ^
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

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

int main(){
  int n; cin >> n;
  int a[n];
  for(int i = 0; i < n; i++){
    a[i] = i + 1;
  }
  int x[10];
  int y[10];
  for(int i = 0; i < n; i++){
    cin >> x[i] >> y[i];
  }
  double sum = 0;
  int cnt = 0;
  do{
    for(int i = 0; i < n; i++){
      int xdis = (x[a[i]] - x[a[i + 1]]);
      int ydis = (y[a[i]] - y[a[i + 1]]);
      sum += sqrt(xdis*xdis + ydis*ydis);
      cnt++;
    }
  }while(next_permutation(a.begin(), a.end()));
  printf("%.10lf", sum/cnt);
}
    
      

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected ';' before '}' token
   20 |     cnt++
      |          ^
      |          ;
   21 | }while(next_permutation(p.begin(),p.end()))
      | ~         
a.cc:21:44: error: expected ';' before 'double'
   21 | }while(next_permutation(p.begin(),p.end()))
      |                                            ^
      |                                            ;
   22 |   double ans=dis/cnt;
      |   ~~~~~~                                    
a.cc:23:22: error: expected '}' at end of input
   23 |   printf("%.6f",ans);
      |                      ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>

int main(){
    int N;std::cin>>N;
    std::vector<int> x(N),y(N);
    for(int i=0;i<N;++i) std::cin>>x[i]>>y[i];
    std::vector<int> ord(N);
    std::iota(begin(ord),end(ord),0);
    double ans=0;
    do{
        double tmp=0;
        for(int i=0;i+1<N;++i) tmp+=sqrt(pow(x[ord[i]]-x[ord[i+1]],2)+pow(y[ord[i]]-y[ord[i+1]],2));
        ans+=tmp;
    }while(next_permutation(begin(ord),end(ord));
    for(int i=1;i<N;++i) ans/=i+1;
    printf("%.16f\n",ans);
}


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

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
 
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> per;
    for (int i = 0; i < N; i++) per.push_back(i);
    double sum = 0;
    do {
        
        for (int i = 0; i < N - 1; i++) {
            sum += sqrt((x[per[i]] - x[per[i + 1]]) * (x[per[i]] - x[per[i + 1]]) + (y[per[i]] - y[per[i + 1]]) * (y[per[i]] - y[per[i + 1]]));
        }
    } while (next_permutation(per.begin(), per.end()));
 
    double pro = 1;
    for (int i = 1; i <= N; i++) pro *= i;
    cout << setprecision(10)<< sum / pro << endl;
}

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


#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
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]);
    }wile(next_permutation(v.begin(),v.end()));

    int Factorial = 1;
    for(int i = 2; i <= n;i++) Factorial; *= i;
    cout << fixed << setprecision(7) << sum / Factorial << endl;
    return;
}

int main(){
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:27: error: 'N' was not declared in this scope
   22 |         for(int i = 0;i < N - 1;i++) sum += dist(v[i],v[i+1]);
      |                           ^
a.cc:23:6: error: expected 'while' before 'wile'
   23 |     }wile(next_permutation(v.begin(),v.end()));
      |      ^~~~
a.cc:23:6: error: expected '(' before 'wile'
   23 |     }wile(next_permutation(v.begin(),v.end()));
      |      ^~~~
      |      (
a.cc:23:6: error: 'wile' was not declared in this scope
   23 |     }wile(next_permutation(v.begin(),v.end()));
      |      ^~~~
a.cc:23:47: error: expected ')' before ';' token
   23 |     }wile(next_permutation(v.begin(),v.end()));
      |      ~~~~                                     ^
      |                                               )
a.cc:26:43: error: expected primary-expression before '*=' token
   26 |     for(int i = 2; i <= n;i++) Factorial; *= i;
      |                                           ^~
a.cc:26:46: error: 'i' was not declared in this scope
   26 |     for(int i = 2; i <= n;i++) Factorial; *= i;
      |                                              ^
Language: C++

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

using namespace std;
typedef long long ll;

ll mx,sum,mn=1e8,cnt;
double ans;
int main(){
	ll n;
	cin>>n;
	ll a[n],b[n];
	for(int i=0; i<n; i++){
		cin>>a[i]>>b[i];
	}

	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			if(i!=j){
				double x=(a[i]-a[j])*(a[i]-a[j]);
				double y=(b[i]-b[j])*(b[i]-b[j]);
				double res=sqrt(x+y);
				ans+=res;
				
			}
		}
	}
	cout<<fixed<<setprecision(10)<<ans/n;
	
}

.

Compiler output:
a.cc:39:1: error: expected unqualified-id before '.' token
   39 | .
      | ^
Language: C++

from itertools import permutations
import sys
import heapq
from collections import Counter
from collections import deque
from math import gcd
from math import factorial
from math import sqrt
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


#ここから書き始める
n = int(input())
a = []
for i in range(n):
    x, y = map(int, input().split())
    a.append([x, y])
total = 0
for i in permutations(a):
    # print(i)
    for j in range(1, n):
        x_distance = i[j][0] - i[j - 1][0]
        y_distance = i[j][1] - i[j - 1][1]
        d = sqrt(x_distance ** 2 + y_distance ** 2)
        total += d
ans = total / factorial(n)
print(ans)

Compiler output:
a.cc:57:26: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   57 |         return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      |                          ^~~~~~~~
a.cc:60:2: error: invalid preprocessing directive #\U00003053\U00003053\U0000304b\U00003089\U000066f8\U0000304d\U000059cb\U00003081\U0000308b
   60 | #ここから書き始める
      |  ^~~~~~~~~~~~~~~~~~
a.cc:68:7: error: invalid preprocessing directive #print
   68 |     # print(i)
      |       ^~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from itertools import permutations
      | ^~~~
a.cc:56:5: error: 'def' does not name a type
   56 |     def __str__(self):
      |     ^~~
Language: C++

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

using namespace std;

#define ll long long int

int main(){
  int N;
  cin >> N;
  vector<int> X,Y,number;
  for(int i=0;i<N;i++){
    int x,y;
    cin >> x >> y;
    X.push_back(x);
    Y.push_back(y);
    number.push_back(i);
  }
  double sum=0;
  int count=0;
  do{
    float total_dis=0;
    for(int i=0;i<N-1;i++){
      int now = number[i];
      int next = number[i+1];
      float dis = sqrt(pow(X[next]-X[now],2)+pow(Y[next]-Y[now],2));
      total_dis += dis;
    }
    sum+=total_dis;
    count++;
  }while(next_permutation(number.begin(),number.end()));
  cout << sum/count << endl;

  return 0;
}

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

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

int main(){

  
    long min_wk=10000000000000;
  long n;
  cin >> n;
  for(long i=1;i*i<=n;i++){
    if(n%i==0)
      mini = min(mini,i+n/i-2);}
    
	cout<< mini;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'mini' was not declared in this scope
   12 |       mini = min(mini,i+n/i-2);}
      |       ^~~~
a.cc:14:16: error: 'mini' was not declared in this scope
   14 |         cout<< mini;
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int N;
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(){
	cin >> N;
	rep(i,N) cin >> x[i] >> y[j];
	double sum = 0.0;
	vector<int> v(N);
  	rep(i,N) 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(i=2;i<=N;i++) factorial *= 1;
  cout << fixed << setprecision(10) << sum/factorial << endl;
  return 0;
}

Compiler output:
a.cc:5:1: error: 'x' does not name a type
    5 | x[10],y[10];
      | ^
a.cc: In function 'double dist(int, int)':
a.cc:8:13: error: 'x' was not declared in this scope; did you mean 'dx'?
    8 | double dx = x[i]-x[j];
      |             ^
      |             dx
a.cc:9:13: error: 'y' was not declared in this scope; did you mean 'dy'?
    9 | double dy = y[i]-y[j];
      |             ^
      |             dy
a.cc: In function 'int main()':
a.cc:15:25: error: 'x' was not declared in this scope
   15 |         rep(i,N) cin >> x[i] >> y[j];
      |                         ^
a.cc:15:33: error: 'y' was not declared in this scope
   15 |         rep(i,N) cin >> x[i] >> y[j];
      |                                 ^
a.cc:15:35: error: 'j' was not declared in this scope
   15 |         rep(i,N) cin >> x[i] >> y[j];
      |                                   ^
a.cc:23:7: error: 'i' was not declared in this scope
   23 |   for(i=2;i<=N;i++) factorial *= 1;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int x[n];
int y[n];
for(int i=0;i<n;i++){
    cin >> x[i] >> y[i];
}
long double ans=0;
int dict[n];
for(int i=0;i<n;i++){
    dict[i]=i+1;
}
do{
    for(int i=0,i<n-1;i++){
        int tmp_x=x[i+1]-x[i];
        int tmp_y=y[i+1]-x[i];
        ans+=sqrt(tmp_x*tmp_x+tmp_y*tmp_y);
    }
}while(next_permutation(dict,dict+n));
long long avg=1;
for(int i=1;i<=n;i++)avg*=i;
cout << fixed << secprecision(15) << ans/avg << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before '<' token
   17 |     for(int i=0,i<n-1;i++){
      |                  ^
      |                  ;
a.cc:17:18: error: expected primary-expression before '<' token
a.cc:25:18: error: 'secprecision' was not declared in this scope
   25 | cout << fixed << secprecision(15) << ans/avg << endl;
      |                  ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    double goukei=0.0;
    int x[n],y[n];
    for(int i=0;i<n;i++)cin >> x[i] >> y[i];

    vector<int>a(n);
    for(int i=0;i<n;i++)a[i]=i+1;
    do{
        for(int i=1;i<n-1;i++){
            double dx = x[a[i]]-x[a[i+1]];
            double dy = y[a[i]]-y[a[i+1]];
            goukei += pow(dx*dx+dy*dy,0.5)
        }
    }while(next_permutation(a.begin(),a.end()));
    int Factorial=1;
    for(int i=2;i<=n;i++)Factorial*=i;//ｎの階上を作ってる
    cout << fixed << setprecision(10) << goukei / Factorial << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:43: error: expected ';' before '}' token
   16 |             goukei += pow(dx*dx+dy*dy,0.5)
      |                                           ^
      |                                           ;
   17 |         }
      |         ~
Language: C

#include<stdio.h>
#include<math.h>
int main(void){
  int n;
  scanf("%d",&n);
  int a[n],b[n],i,ans=0;
  for(i=0;i<n;i++){
  scanf("%d%d",&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));
    }
  }
  printf("%d",ans*2/n);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: 'j' undeclared (first use in this function)
   11 |     for(j=i+1;j<n;j++){
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>
int main(void){
  int n,i,j;
  scanf("%d",&n);
  int a[n],b[n];
  for(i=0;i<n;i++){
    scanf("%d%d",&a[i],&b[i]);
  }
  double ans=0;
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j],2));
    }
  }
  printf("%d",s/n*2);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:15: error: 's' undeclared (first use in this function)
   16 |   printf("%d",s/n*2);
      |               ^
main.c:16:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>
int main(void){
  int n,i,j;
  scanf("%d",&n);
  int a[n],b[n];
  for(i=0;i<n;i++){
    scanf("%d%d",&a[i],&b[i]);
  }
  double ans=0;
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      ans+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
    }
  }
  printf("%d",s/n*2);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:13:21: error: 'x' undeclared (first use in this function)
   13 |       ans+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
      |                     ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:38: error: 'y' undeclared (first use in this function)
   13 |       ans+=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
      |                                      ^
main.c:16:15: error: 's' undeclared (first use in this function)
   16 |   printf("%d",s/n*2);
      |               ^
Language: C++

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

int main() {
  int N;
  int x[10], y[10];
  cin>>N;
   for(int i = 1; i <= N; i++){
     cin >> x.at(i) >> y.at(i);
   }
  for(int i = 1; i <= N; i++){
    for (int j=1; j<N;j++){
      double ans=0.0;
    double dx(int i ,int j) = x.at(i) - x.at(j);
    double dy(int i ,int j) = y.at(i) - y.at(j);
     double dist(int i, int j);
      dist=pow(dx * dx + dy * dy, 0.5);
      ans += dist(i, j) * 2 / N;
      cout<<ans<<endl;
    }
  }
  
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: request for member 'at' in 'x', which is of non-class type 'int [10]'
    9 |      cin >> x.at(i) >> y.at(i);
      |               ^~
a.cc:9:26: error: request for member 'at' in 'y', which is of non-class type 'int [10]'
    9 |      cin >> x.at(i) >> y.at(i);
      |                          ^~
a.cc:14:27: warning: declaration of 'double dx(int, int)' has 'extern' and is initialized
   14 |     double dx(int i ,int j) = x.at(i) - x.at(j);
      |                           ^
a.cc:14:32: error: invalid pure specifier (only '= 0' is allowed) before '.' token
   14 |     double dx(int i ,int j) = x.at(i) - x.at(j);
      |                                ^
a.cc:14:12: error: function 'double dx(int, int)' is initialized like a variable
   14 |     double dx(int i ,int j) = x.at(i) - x.at(j);
      |            ^~
a.cc:15:27: warning: declaration of 'double dy(int, int)' has 'extern' and is initialized
   15 |     double dy(int i ,int j) = y.at(i) - y.at(j);
      |                           ^
a.cc:15:32: error: invalid pure specifier (only '= 0' is allowed) before '.' token
   15 |     double dy(int i ,int j) = y.at(i) - y.at(j);
      |                                ^
a.cc:15:12: error: function 'double dy(int, int)' is initialized like a variable
   15 |     double dy(int i ,int j) = y.at(i) - y.at(j);
      |            ^~
a.cc:17:19: error: invalid operands of types 'double(int, int)' and 'double(int, int)' to binary 'operator*'
   17 |       dist=pow(dx * dx + dy * dy, 0.5);
      |                ~~ ^ ~~
      |                |    |
      |                |    double(int, int)
      |                double(int, int)
a.cc:17:29: error: invalid operands of types 'double(int, int)' and 'double(int, int)' to binary 'operator*'
   17 |       dist=pow(dx * dx + dy * dy, 0.5);
      |                          ~~ ^ ~~
      |                          |    |
      |                          |    double(int, int)
      |                          double(int, int)
Language: C++

//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
#define ifYN(x) cout<<(x?"Yes":"No")<<"\n"

ll GCD(ll a,ll b) { return b ? GCD(b,a%b) : a; }
ll LCM(ll a,ll b) { return a/GCD(a,b)*b; }
ll Factorial(ll n){ ll m=1;while(n>=1)m*=n--;return m; }
ll modPow(ll x,ll n,ll mod=MOD){
    return (!n?1:!n%2?modPow(x*x,n/2,mod)%mod:x%mod*modPow(x,n-1,mod)%mod);
}
ll GetDigit(ll num){
    ll digit=0;
    while(num!=0){num/=10;digit++;}
    return digit;
}
using namespace std;
//-------------------------------------------
ld dist(pair<ld,ld> p1,pair<ld,ld> p2){
	ld dx=p2.first-p1.first;
	ld dy=p2.second-p1.second;
	return sqrt(dx*dx+dy*dy);
}
int main(void){
  ll N;cin>>N;
  vector<pair<ld,ld>> p(N);
  REP(i,N)cin>>p[i].first>>p[i].second;
  ld sumd=0;int c=0;
  do{
  	c++;
    REPS(i,N-1)sumd+=dist(p[i-1],p[i]);
  }while(next_permutation(ALLv(p)));
  cout<<ld/c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected primary-expression before 'long'
    7 | #define ld long double
      |            ^~~~
a.cc:56:9: note: in expansion of macro 'ld'
   56 |   cout<<ld/c;
      |         ^~
Language: C++

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

using namespace std;

struct Point
{
	int x, y;

	bool operator<(const Point &p) const
	{
		return make_pair(x, y) < make_pair(p.x, p.y);
	}
};

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

	vector<Point> P(n);
	for (int i = 0; i < n; i++)
	{
		cin >> P[i].x >> P[i].y;
	}

	sort(P.begin(), P.end());
	double sum = 0;
	int count = 0;
	do
	{
		double distance = 0;
		
		for (int i = 0; i < P.size() - 1; i++)
		{
			int dx = P[i].x - P[i + 1].x, dy = P[i].y - P[i + 1].y;
			distance += sqrt(dx * dx + dy * dy);
		}

		sum += distance;
		count++;
	} while (next_permutation(P.begin(), P.end()));

	double ans = sum / count;
	printf("%.10f\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:37: error: 'sqrt' was not declared in this scope
   39 |                         distance += sqrt(dx * dx + dy * dy);
      |                                     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'c' was not declared in this scope
   28 |     c*=i;}
      |     ^
a.cc:29:12: error: 'c' was not declared in this scope
   29 |   cout<<am/c<<endl;
      |            ^
Language: C++

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

double dis(int x1, int y1, int x2, int y2) {
  return sqrt(pow(x1-x2, 2) + pow(y1-y2, 2));
}
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);
  int s = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++)
      s += dis(x.at(i), y.at(i), x.at(j), y.at(j));
  }
  cout << s/N << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before ')' token
   11 |   for (int i = 0; i < N, i++)
      |                             ^
      |                             ;