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

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stdint.h>
#include<cmath>
#include<utility>
#include<algorithm>
using namespace std;
typedef pair<int ,int> pp;

int main(){
    int n;
    cin>>n;
    vector<pp> v;
    for(int i = 0; i < n; i++){
        int a,b;
        cin>>a>>b;
        pp x = make_pair(a, b);
        v.push_back(x);
    }
    double k;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            int p = v[i].first - v[j].first;
            int q = v[i].second - v[j].second;
            k += sqrt(p * p + q * q);
        }
    }
    k = 2 * k / n;
    printf("%f\n", k);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'vector' was not declared in this scope
   14 |     vector<pp> v;
      |     ^~~~~~
a.cc:8:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    7 | #include<algorithm>
  +++ |+#include <vector>
    8 | using namespace std;
a.cc:14:14: error: expected primary-expression before '>' token
   14 |     vector<pp> v;
      |              ^
a.cc:14:16: error: 'v' was not declared in this scope
   14 |     vector<pp> v;
      |                ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int N; cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  rep(i, N) {
    cin >> x[i] >> y[i];
  }
  vector<int> perm_index(N);
  rep(i, N) perm_index[i] = i;
  int sX = x[perm_index[i]];
  int sY = y[perm_index[i]];
  double aaa = 0;
  do {
    rep(i, N) {
    int X = x[perm_index[i]];
    int Y = y[perm_index[i]];
    aaa += sqrt((X - sX) * (X - sX) + (Y - sY) * (Y - sY));
  }
  } while (next_permutation(perm_index.begin(), perm_index.end()));
  printf("%.10f\n", aaa);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'i' was not declared in this scope
   29 |   int sX = x[perm_index[i]];
      |                         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int N; cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  rep(i, N) {
    cin >> x[i] >> y[i];
  }
  vector<int> perm_index(N);
  rep(i, N) perm_index[i] = i;
  int sX = x[perm_index[i]];
  int sY = y[perm_index[i]];
  double aaa = 0;
  do {
    int X = x[perm_index[i]];
    int Y = y[perm_index[i]];
    aaa += sqrt((X - sX) * (X - sX) + (Y - sY) * (Y - sY));
  } while (next_permutation(perm_index.begin(), perm_index.end()));
  printf("%.10f\n", aaa);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'i' was not declared in this scope
   29 |   int sX = x[perm_index[i]];
      |                         ^
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<vector<int> > a(n,vector<int>(2));
  for(int i=0;i<n;i++){
    for(int j=0;j<2;j++){
      cin>>a.at(i).at(j);
    }
  }
  double p=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      p+=sqrt(pow((a.at(i).at(0)-a.at(j).at(0)),2)+pow((a.at(i).at(1)-a.at(j).at(1)),2));
    }
  }
  cout<<fixed<<setprecision(10)
  cout<<2*p/n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: expected ';' before 'cout'
   19 |   cout<<fixed<<setprecision(10)
      |                                ^
      |                                ;
   20 |   cout<<2*p/n<<endl;
      |   ~~~~
Language: C++

#include<bits/stdc++.h>

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

using namespace std;

double dist(pair<int, int> l, pair<int, int> r){
  double dx = l.first-r.first;
  double dy = l.second-r.second;
  return pow(dx*dx+dy*dy, 0.5);
}

int main(){
  int n;
  cin>>n;
  vector<pair<int,int>> xy;
  rep(i, n){
    int x,y;
    cin>>x>>y;
    xy.emplace_back(x,y);
  }
  
  vector<int> ar;
  rep(i,n){
    ar.push_back(i);
  }
  
  double sum = 0;

  do {
    rep(i,n-1){
      sum += dist(xy[ar[i]], xy[ar[i+1]]);
    }
  } while( next_permutation(ar.begin(), ar.end()) );
  
  int fac = 1;
  rep(i,n) fac *= (i+1);

  cout<<fixed(8)<<(sum/fac)<<setprecision(6);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:15: error: invalid initialization of non-const reference of type 'std::ios_base&' from an rvalue of type 'int'
   40 |   cout<<fixed(8)<<(sum/fac)<<setprecision(6);
      |               ^
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1104:19: note: in passing argument 1 of 'std::ios_base& std::fixed(ios_base&)'
 1104 |   fixed(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
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 << fixed(10) << sum / Factorial << endl;
    return;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:24:19: error: invalid initialization of non-const reference of type 'std::ios_base&' from an rvalue of type 'int'
   24 |     cout << fixed(10) << sum / Factorial << endl;
      |                   ^~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1104:19: note: in passing argument 1 of 'std::ios_base& std::fixed(ios_base&)'
 1104 |   fixed(ios_base& __base)
      |         ~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;
ll mod = 1e9 + 7;

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

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

int A,B;
int x[111];
ll coudp[111][111][5555];
string divide[4] = { "dream","dreamer","erase","eraser" };
int main()
{
	solve();
	return 0;

}

Compiler output:
a.cc:48:5: error: conflicting declaration 'int x [111]'
   48 | int x[111];
      |     ^
a.cc:15:5: note: previous declaration as 'int x [10]'
   15 | int x[10], y[10];
      |     ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N;
vector<vector<int>> dist;

int kaizyou(int n) {//nの階乗をを求める
    if(n != 1) {
        int a = n*kaizyou(n-1);
        return a;
    }
    return 1;
}
double dp(int n , int j) {
    double a = 0;
    if(n == 2){
        int i = 2;
        while(i<=N){
            for (int k = i;k<=N;k++){
                double  b;
                b = sqrt(pow(dist[i-1][0]- dist[k][0], 2) + pow(dist[i-1][1]- dist[k][1], 2));
                a += b;
            }
        }
    }
    for (int i = 0;i<N;i++){
        if(i==j) continue;
        double  b;
        b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
        a += dp(n-1, i) + b;
    }
    return a;
}

void input() {
    cin >> N ;
    for(int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        dist[i][0] = a;//x
        dist[i][1] = b;//y
    }
}

void solve(){
    input();
    int n = kaizyou(N);
    ll ans = 0;
    ll sum = 0;
    for (int i=1;i<=N;i++) {//選ぶ町
        sum += dp(N, i);
    }
    ans = sum / n;
    cout << ans << endl;
    return ;
}

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

Compiler output:
a.cc: In function 'double dp(int, int)':
a.cc:45:30: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'first'
   45 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                              ^~~~~
a.cc:45:45: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'first'
   45 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                                             ^~~~~
a.cc:45:69: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'second'
   45 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                                                                     ^~~~~~
a.cc:45:85: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'second'
   45 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                                                                                     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N;
vector<pair<int , int> dist;

int kaizyou(int n) {//nの階乗をを求める
    if(n != 1) {
        int a = n*kaizyou(n-1);
        return a;
    }
    return 1;
}
double dp(int n , int j) {
    double a = 0;
    if(n == 2){
        int i = 2;
        while(i<=N){
            for (int k = i;k<=N;k++){
                double  b;
                b = sqrt(pow(dist[i-1].first- dist[k].first, 2) + pow(dist[i-1].second- dist[k].second, 2));
                a += b;
            }
        }
    }
    for (int i = 0;i<N;i++){
        if(i==j) continue;
        double  b;
        b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
        a += dp(n-1, i) + b;
    }
    retunr a;
}

void input() {
    cin >> N ;
    for(int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        dist[i].first = a;//x
        dist[i].second = b;//y
    }
}

void solve(){
    input();
    int n = kaizyou(N);
    ll ans = 0;
    ll sum = 0;
    for (int i=1;i<=N;i++) {//選ぶ町
        sum += dp(N, i);
    }
    ans = sum / n;
    cout << ans << endl;
    return ;
}

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

Compiler output:
a.cc:21:24: error: template argument 1 is invalid
   21 | vector<pair<int , int> dist;
      |                        ^~~~
a.cc:21:24: error: template argument 2 is invalid
a.cc: In function 'double dp(int, int)':
a.cc:37:30: error: 'dist' was not declared in this scope
   37 |                 b = sqrt(pow(dist[i-1].first- dist[k].first, 2) + pow(dist[i-1].second- dist[k].second, 2));
      |                              ^~~~
a.cc:45:22: error: 'dist' was not declared in this scope
   45 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                      ^~~~
a.cc:48:5: error: 'retunr' was not declared in this scope
   48 |     retunr a;
      |     ^~~~~~
a.cc:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | }
      | ^
a.cc: In function 'void input()':
a.cc:56:9: error: 'dist' was not declared in this scope
   56 |         dist[i].first = a;//x
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N;
vector<pair<int , int> dist;

int kaizyou(int n) {//nの階乗をを求める
    if(n != 1) {
        int a = n*kaizyou(n-1);
        return a;
    }
    return 1;
}
void dp(int n , int j) {
    int a = 0;
    for (int i = 0;i<N;i++){
        if(i==j) continue;
        long long double  b;
        b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
        a += dp(n-1, i) + b;
    }
    retunr a;
}
void input() {
    cin >> N ;
    for(int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        dist[i].first = a;//x
        dist[i].second = b;//y
    }
}

void solve(){
    input();
    int n = kaizyou(N);
    ll ans = 0;
    ll sum = 0;
    for (int i=1;i<=N;i++) {//選ぶ町
        sum += dp(N, i);
    }
    ans = sum / n;
    cout << ans << endl;
    return ;
}

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

Compiler output:
a.cc:21:24: error: template argument 1 is invalid
   21 | vector<pair<int , int> dist;
      |                        ^~~~
a.cc:21:24: error: template argument 2 is invalid
a.cc: In function 'void dp(int, int)':
a.cc:34:14: error: 'long long' specified with 'double'
   34 |         long long double  b;
      |              ^~~~
a.cc:35:22: error: 'dist' was not declared in this scope
   35 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                      ^~~~
a.cc:36:25: error: invalid operands of types 'void' and 'double' to binary 'operator+'
   36 |         a += dp(n-1, i) + b;
      |              ~~~~~~~~~~ ^ ~
      |                |          |
      |                void       double
a.cc:38:5: error: 'retunr' was not declared in this scope
   38 |     retunr a;
      |     ^~~~~~
a.cc: In function 'void input()':
a.cc:45:9: error: 'dist' was not declared in this scope
   45 |         dist[i].first = a;//x
      |         ^~~~
a.cc: In function 'void solve()':
a.cc:56:18: error: void value not ignored as it ought to be
   56 |         sum += dp(N, i);
      |                ~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N
vector<pair<int , int> dist(N);

int kaizyou(int n) {//nの階乗をを求める
    if(n != 1) {
        int a = n*kaizyou(n-1);
        return a;
    }
    return 1;
}
void dp(int n , int j) {
    int a = 0;
    for (int i = 0;i<N;i++){
        if(i==j) continue;
        long long double = b;
        b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
        a += dp(n-1, i) + b;
    }
    retunr a;
}
void input() {
    cin >> N ;
    for(int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        dist[i].first = a;//x
        dist[i].second = b;//y
    }
}

void solve(){
    input();
    int n = kaizyou(N);
    ll ans = 0;
    ll sum = 0;
    for (int i=1;i<=N;i++) {//選ぶ町
        sum += dp(N, i);
    }
    ans = sum / n;
    cout << ans << endl;
    return ;
}

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

Compiler output:
a.cc:21:1: error: expected initializer before 'vector'
   21 | vector<pair<int , int> dist(N);
      | ^~~~~~
a.cc: In function 'void dp(int, int)':
a.cc:32:22: error: 'N' was not declared in this scope
   32 |     for (int i = 0;i<N;i++){
      |                      ^
a.cc:34:26: error: expected unqualified-id before '=' token
   34 |         long long double = b;
      |                          ^
a.cc:35:9: error: 'b' was not declared in this scope
   35 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |         ^
a.cc:35:22: error: 'dist' was not declared in this scope
   35 |         b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
      |                      ^~~~
a.cc:38:5: error: 'retunr' was not declared in this scope
   38 |     retunr a;
      |     ^~~~~~
a.cc: In function 'void input()':
a.cc:41:12: error: 'N' was not declared in this scope
   41 |     cin >> N ;
      |            ^
a.cc:45:9: error: 'dist' was not declared in this scope
   45 |         dist[i].first = a;//x
      |         ^~~~
a.cc: In function 'void solve()':
a.cc:52:21: error: 'N' was not declared in this scope
   52 |     int n = kaizyou(N);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>
#include <pair>

#define fir first
#define sec second
#define get(n) scanf("%d",&n);
#define gets(s) string s;cin >> (s);
#define All(s) (c).begin(), (c).end()
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

int N
vector<pair<int , int> dist(N);

int kaizyou(int n) {//nの階乗をを求める
    if(n != 1) {
        int a = n*kaizyou(n-1);
        return a;
    }
    return 1;
}
void dp(int n , int j) {
    int a = 0;
    for (int i = 0;i<N;i++){
        if(i==j) continue;
        long long double = b;
        b = sqrt(pow(dist[i].first- dist[j].first, 2) + pow(dist[i].second- dist[j].second, 2));
        a += dp(n-1, i) + b;
    }
    retunr a;
}
void input() {
    cin >> N ;
    for(int i=0;i<N;i++){
        int a, b;
        cin >> a >> b;
        dist[i].first = a;//x
        dist[i].second = b;//y
    }
}

void solve(){
    input();
    int n = kaizyou(N);
    ll ans = 0;
    ll sum = 0;
    for (int i=1;i<=N;i++) {//選ぶ町
        sum += dp(N, i);
    }
    ans = sum / n;
    cout << ans << endl;
    return ;
}

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

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

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
using Graph = vector<vector<int> >;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//#define int long long

void solve() {
	int n; cin >> n;
    vector<pair<double, double>> p(n);
    rep(i, n) {
        cin >> p[i].fr >> p[i].sc;
    }
    double ans = 0;
    do {
        double res = 0;
        rep(i, n - 1) {
            res += pow(pow(p[i + 1].fr - p[i].fr, 2) + pow(p[i + 1].sc - p[i].sc, 2), 0.5);
        }
        ans += res;
    } while(next_permutation(all(p)))
    rep1(i, n) {
        ans /= (double)i;
    }
    cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:66:38: error: expected ';' before 'for'
   66 |     } while(next_permutation(all(p)))
      |                                      ^
      |                                      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()

struct point{
    int x,y;
};

int main(){
    struct point p[9];
    int n;
    cin>>n;
    REP(i,n) cin>>p[i].x>>p[i].y;
    long long sum=0;
    REP(i,n-1){
        FOR(j,i+1,n) sum+=10000000*sqrt(pow((double)p[i].x-(double)p[j].x,2)+pow((double)p[i].y-(double)p[j].y,2));
    long long ans=sum*2.0/(double)n;
    cout<<(double)ans/10000000.0<<endl;
}

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

import numpy as np
import itertools

n = int(input())
x = np.empty(n)
y = np.empty(n)
for i in range(n):
    x[i], y[i] = map(float, input().split())

grid = np.zeros((n, n))
for i in range(n):
    for j in range(n):
        grid[i][j] = ((x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2) ** 0.5

sum = 0
cnt = 0

for i in itertools.permutations(np.arange(n)):
    cnt += 1
    dist = 0
    for j in range(n - 1):
        dist += grid[i[j]][i[j + 1]]
    sum += dist
print(sum / cnt)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class C {

    private static List<List<Integer>> permutations(int N) {
        List<List<Integer>> lst = new ArrayList<>();
        boolean[] used = new boolean[N];
        int[] acm = new int[N];
        for (int i = 0; i < N; i++) {
            acm[0] = i;
            used[i] = true;
            dfs(lst, N, 1, used, acm);
            used[i] = false;
        }
        return lst;
    }

    private static void dfs(List<List<Integer>> lst, int N, int idx, boolean[] used, int[] acm) {
        if (idx >= N) {
            lst.add(Arrays.stream(acm).boxed().collect(Collectors.toList()));
            return;
        }

        for (int i = 0; i < N; i++) {
            if (used[i]) continue;

            acm[idx] = i;
            used[i] = true;
            dfs(lst, N, idx+1, used, acm);
            used[i] = false;
        }
    }

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

        int N = sc.nextInt();
        int[] px = new int[N];
        int[] py = new int[N];
        IntStream.range(0, N).forEach(i -> {
            px[i] = sc.nextInt();
            py[i] = sc.nextInt();
        });

        List<List<Integer>> routes = permutations(N);
        List<Double> distances = routes.stream().map(route ->
            IntStream.range(1, N).asDoubleStream().reduce(0, (r, i) -> {
                int x1 = px[route.get((int)i)];
                int y1 = py[route.get((int)i)];
                int x2 = px[route.get((int)i-1)];
                int y2 = py[route.get((int)i-1)];
                double distance = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
                return r + distance;
            })
        ).collect(Collectors.toList());

        Double sum = distances.stream().reduce(0.0, Double::sum);

        System.out.println(sum / distances.size());
    }

}


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

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

int main() {
	int N;
	cin >> N;
	vector<vector<int>> xy(2,vector<int>(N));
	for (int i = 0; i < N; i++) {
		cin >> xy[0][i] >> xy[1][i];
	}
	double val = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 1; j < N; j++) {
			val += sqrt(pow(abs(xy[0][i] - xy[0][j]),2)) + pow(abs(xy[1][i] - xy[1][j]),2);
		}
	}
	cout << val / N;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:37: error: 'pow' was not declared in this scope
   16 |                         val += sqrt(pow(abs(xy[0][i] - xy[0][j]),2)) + pow(abs(xy[1][i] - xy[1][j]),2);
      |                                     ^~~
a.cc:16:32: error: 'sqrt' was not declared in this scope
   16 |                         val += sqrt(pow(abs(xy[0][i] - xy[0][j]),2)) + pow(abs(xy[1][i] - xy[1][j]),2);
      |                                ^~~~
Language: C++

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

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

  vector<pair<int, int>> t(N);
  for (int i = 0; i < N; ++i)
    t[i] = make_pair(x[i], y[i]);

  sort(t.begin(), t.end());

  int u = 1;
  for (int i = 1; i <= N; ++i)
    u *= i;

  double ans = 0;
  do {
    for (int i = 0; i < N - 1; ++i)
      ans += sqrt(abs(t[i].first - t[i + 1].first) *
                      abs(t[i].first - t[i + 1].first) +
                  abs(t[i].second - t[i + 1].second) *
                      abs(t[i].second - t[i + 1].second));
  } while (next_permutation(t.begin(), t.end()));
  ans /= u;

  cout << fixed << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: 'sqrt' was not declared in this scope
   27 |       ans += sqrt(abs(t[i].first - t[i + 1].first) *
      |              ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
signed main() {
	int n; cin >> n;
	int p = 2; for1(i, n - 1)p *= i;
	double a[10], b[10];
	for1(i, n)cin >> a[i] >> b[i];
	double sum = 0;
	for1(i, n)for (int j = i + 1; j <= n; j++) {
		sum += sqrt((a[i] - a[j]) * (a[i] - a[j]) + (b[i] - b[j]) * (b[i] - b[j]))*p;
	}
	printf("%.10f\n", sum / (p / 2 * n));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'sqrt' was not declared in this scope
   15 |                 sum += sqrt((a[i] - a[j]) * (a[i] - a[j]) + (b[i] - b[j]) * (b[i] - b[j]))*p;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

void solve(){
    int n;
    cin>>n;
    vector<int>x(n);
    vector<int>y(n);
    rep(i,n)cin>>x[i]>>y[i];
    double sum=0;
    vector<int>v(n);
  rep(i,n)v[i]=i;
  do{
    rep(i,n-1)sum+=sqrt(pow((x[v[i]]-x[v[i+1]]),2.0)+pow((y[i]-x[j]),2.0));
  }while(next_permutation(v.begin(),v.end()));
cout<<sum<<endl;
}

int main(){
    cout<<std::fixed<<std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:66: error: 'j' was not declared in this scope
   27 |     rep(i,n-1)sum+=sqrt(pow((x[v[i]]-x[v[i+1]]),2.0)+pow((y[i]-x[j]),2.0));
      |                                                                  ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:12: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   13 |       sum+=sqrt(a*a+b*b);
      |            ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | int main(){
main.c:13:12: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   13 |       sum+=sqrt(a*a+b*b);
      |            ^~~~
main.c:13:12: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:15:12: error: implicit declaration of function 'kai' [-Wimplicit-function-declaration]
   15 |   sum=(sum*kai(n-1))/n;
      |            ^~~
main.c:17:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |   printf("%lf",sum);
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

int kai(int a){
  int p=1;
  for(int i=0;i<a;i++) p*=a-i;
  return p;
}

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


Compiler output:
main.c: In function 'main':
main.c:22:12: error: expected expression before 'double'
   22 |       sum+=double sqrt(double a*a+b*b);
      |            ^~~~~~
Language: C

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

int kai(int a){
  int p=1;
  for(int i=0;i<a;i++) p*=a-i;
  return p;
}

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

Compiler output:
main.c: In function 'main':
main.c:19:23: error: expected ';' before ')' token
   19 |     for(int j=i+1;j<=n){
      |                       ^
      |                       ;
main.c:22:12: error: expected expression before 'double'
   22 |       sum+=double sqrt(double a*a+b*b);
      |            ^~~~~~
Language: C++

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

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

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(){
    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 num = fact(n);

    printf("%.9lf\n", ans / num);
}

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

Compiler output:
a.cc: In function 'double dist(int, int)':
a.cc:13:17: error: 'x' was not declared in this scope; did you mean 'dx'?
   13 |     double dx = x[i] - x[j];
      |                 ^
      |                 dx
a.cc:14:17: error: 'y' was not declared in this scope; did you mean 'dy'?
   14 |     double dy = y[i] - y[j];
      |                 ^
      |                 dy
a.cc: In function 'void solve()':
a.cc:22:40: error: 'x' was not declared in this scope
   22 |     for(int i = 1; i <= n; i++) cin >> x[i] >> y[i];
      |                                        ^
a.cc:22:48: error: 'y' was not declared in this scope
   22 |     for(int i = 1; i <= n; i++) cin >> x[i] >> y[i];
      |                                                ^
a.cc:33:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |     printf("%.9lf\n", ans / num);
      |                       ^~~
      |                       abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
double hh(vector<double> x,vector<double> y,vector<int> ff,int i){
  double dx=x[ff[i]-1]-x[ff[i+1]-1];
  double dy=y[ff[i]-1]-y[ff[i+1]-1];
  return sqrt(dx*dx+dy*dy);
}

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> ff(n);
  for(int i=1;i<=n;i++){
    ff[i-1]=i;
  }
  double ans=0;
  do{
        for(int i=0;i<n-1;i++){
        ans+=ff(x,y,ff,i);
        }
    }while(next_permutation(ff.begin(),ff.end()));
  cout<<fixed << setprecision(10);
  double t=1;
  for(int i=1;i<=n;i++){
    t*=i;
  }
  cout<<ans/t<<endl;
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: no match for call to '(std::vector<int>) (std::vector<double>&, std::vector<double>&, std::vector<int>&, int&)'
   25 |         ans+=ff(x,y,ff,i);
      |              ~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
double hh(double x,double xx,double y,double yy){
  double dx=x-xx;
  double dy=y-yy;
  return sqrt(dx*dx+dy*dy);
}

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> ff(n);
  for(int i=1;i<=n;i++){
    ff[i-1]=i;
  }
  double ans=0;
  do{
        for(int i=0;i<n-1;i++){
        ans+=ff(x[ff[i]-1],x[ff[i+1]-1],y[ff[i]-1],y[ff[i+1]-1]);
        }
    }while(next_permutation(ff.begin(),ff.end()));
  cout<<fixed << setprecision(10);
  double t=1;
  for(int i=1;i<=n;i++){
    t*=i;
  }
  cout<<ans/t<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&)'
   25 |         ans+=ff(x[ff[i]-1],x[ff[i+1]-1],y[ff[i]-1],y[ff[i+1]-1]);
      |              ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int N;
    cin >> N;
    vector<double> x(N);
    vector<double> y(N);
    
    for(int i=0;i<n;i++)
   { cin >> x[i]; cin >> y[i]; }
   
        vector<int> v(N);
    
    for(int i=0;i<n;i++)
    v[i] = i;
    
        double su = 0;
    long long int c = 0;
    do {
        c++;
        for(int i=0;i<N - 1;i++)
        {
            double dx = x[v[i + 1]] - x[v[i]];
            double dy = y[v[i + 1]] - y[v[i]];
            su += sqrt(dx * dx + dy * dy);
        }
    } while (next_permutation(v.begin() , v.end());
    cout << su / c << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=0;i<n;i++)
      |                   ^
a.cc:15:19: error: 'n' was not declared in this scope
   15 |     for(int i=0;i<n;i++)
      |                   ^
a.cc:28:51: error: expected ')' before ';' token
   28 |     } while (next_permutation(v.begin() , v.end());
      |             ~                                     ^
      |                                                   )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int N;
    cin >> N;
    vector<double> x(N);
    vector<double> y(N);
    
    for(int i=0;i<n;i++
   { cin >> x[i]; cin >> y[i]; }
   
        vector<int> v(N);
    
    for(int i=0;i<n;i++)
    v[i] = i;
    
        double su = 0;
    long long int c = 0;
    do {
        c++;
        for(int i=0;i<N - 1;i++)
        {
            double dx = x[v[i + 1]] - x[v[i]];
            double dy = y[v[i + 1]] - y[v[i]];
            su += sqrt(dx * dx + dy * dy);
        }
    } while (next_permutation(v.begin() , v.end());
    cout << su / c << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=0;i<n;i++
      |                   ^
a.cc:10:24: error: expected ')' before '{' token
   10 |     for(int i=0;i<n;i++
      |        ~               ^
      |                        )
   11 |    { cin >> x[i]; cin >> y[i]; }
      |    ~                    
a.cc:15:19: error: 'n' was not declared in this scope
   15 |     for(int i=0;i<n;i++)
      |                   ^
a.cc:28:51: error: expected ')' before ';' token
   28 |     } while (next_permutation(v.begin() , v.end());
      |             ~                                     ^
      |                                                   )
Language: C++

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

int x[10], y[10];

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'cin' was not declared in this scope
    8 |     int N; cin >> N;
      |            ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cmath>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:20:12: error: 'next_permutation' was not declared in this scope
   20 |     }while(next_permutation(v.begin(), v.end()));
      |            ^~~~~~~~~~~~~~~~
a.cc:25:5: error: 'printf' was not declared in this scope
   25 |     printf("%.10f\n", sum / n);
      |     ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <cmath>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long double ld;
typedef pair<ld,ld> pt;

int main(){
int n;
  cin>>n;
  vector<pt>v(n);
  for(auto&x:v)cin>>x.first>>x.second;
  vector<int>ind;
  for(int i=0;i<n;i++)ind.push_back(i);
  ld s=0;
  int cnt=0;
  do{
    cnt++;
    ld l=0;
    for(int i=0;i<n-1;i++){
        ld dx=v[i].first-v[i+1].first;
        ld dy=v[i].second-v[i+1].second;
        l+=sqrtl(dx*dx+dy*dy);
    }
    s+=l;
  }while(next_permutation(ind.begin(),ind.end());
cout<<fixed<<setprecision(12)<<s/cnt;
         }

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

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

int len(int a1,int a2,int b1,int b2)
{
  return sqrt(pow((a1-b1),2)+pow((a2-b2),2))
}

int fact(int n)
{
  int sum=1;
  for(int i=1;i<=n;i++)
  {
    sum*=i;
  }
  return sum;
}

int main()
{
  vector<pair<int,int> >vp;
  int n;cin>>n;
  for(int i=0;i<n;i++)
  {
    int a,b;
    cin>>a>>b;
    v.push_back({a,b});  
  }
  int sum=0;
  for(int i=0;i<n-1;i++)
  {
     sum+=len(vp[i].first,v[i].second,vp[i+1].first,v[i+1].second);
  }
  cout<<sum/fact(n)<<endl;
}  

Compiler output:
a.cc: In function 'int len(int, int, int, int)':
a.cc:6:45: error: expected ';' before '}' token
    6 |   return sqrt(pow((a1-b1),2)+pow((a2-b2),2))
      |                                             ^
      |                                             ;
    7 | }
      | ~                                            
a.cc: In function 'int main()':
a.cc:27:5: error: 'v' was not declared in this scope
   27 |     v.push_back({a,b});
      |     ^
a.cc:32:27: error: 'v' was not declared in this scope
   32 |      sum+=len(vp[i].first,v[i].second,vp[i+1].first,v[i+1].second);
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
int main(){
    double N; cin>>N;
    double ans=0;
    vector<vector<double>> x(N,(vector<double>(2)));
    for(int i=0;i<N;i++){
        cin>>x[i][0];
        cin>>x[i][1];
    }

    int count=0;
    for(int i=0;i<N-1;i++) {
        for (int j = i+1; j < N; j++) {
            ans = ans+sqrt(pow((x[i][0] - x[j][0]), 2) + pow((x[i][1] - x[j][1]), 2);
            count++;
        }
    }
    ans=ans*(N-1);
    ans=ans/count;
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:85: error: expected ')' before ';' token
   16 |             ans = ans+sqrt(pow((x[i][0] - x[j][0]), 2) + pow((x[i][1] - x[j][1]), 2);
      |                           ~                                                         ^
      |                                                                                     )
Language: Java

import java.util.*;

public class C {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }


    // int N = Integer.parseInt(scanner.nextLine());
    // int N = scanner.nextInt(), M = scanner.nextInt();
    // scanner.nextLine();
    // int[] n = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    // long[] n = Arrays.stream(scanner.nextLine().split(" ")).mapToLong(Long::parseLong).toArray();
    static void solve(Scanner scanner) {
        int N = Integer.parseInt(scanner.nextLine());
        long[][] c = new long[N][2];
        for (int i = 0; i < N; i++) {
            c[i] = Arrays.stream(scanner.nextLine().split(" ")).mapToLong(Long::parseLong).toArray();
        }
        int div = 1;
        for (int i = 2; i <= N; i++) {
            div *= i;
        }
        double total = dfs(new LinkedHashSet<>(), c, N);
        System.out.println(total / div);
    }


    static double dfs(LinkedHashSet<Integer> visited, long[][] c, int N) {
        if (visited.size() == N) {
            List<Integer> order = new ArrayList<>(visited);
            double sum = 0;
            for (int i = 1; i < visited.size(); i++) {
                long x = c[order.get(i - 1)][0] - c[order.get(i)][0];
                long y = c[order.get(i - 1)][1] - c[order.get(i)][1];
                sum += Math.sqrt(x * x + y * y);
            }
            return sum;
        }

        double total = 0;
        for (int i = 0; i < N; i++) {
            if (!visited.contains(i)) {
                visited.add(i);
                total += dfs(visited, c, N);
                visited.remove(i);
            }
        }
        return total;
    }

}


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

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

int main()
{
    long int N;
    cin >> N;
    vector<double> x(N);
    vector<double> y(N);
    
	for(int i=0;i<N;i++)
	{ cin >> x[i]; cin >> y[i]; }
    
	vector<int> v(N);
	
    for(int i=0;i<N;i++) 
	v[i] = i;
    
	double su = 0;
    long int c = 0;
    do {
        c++;
        
		for(int i=0;i<N - 1;i++)
        {
            double dx = x[v[i + 1]] - x[v[i]];
            double dy = y[v[i + 1]] - y[v[i]];
            su += sqrt(dx * dx + dy * dy);
        }
    } while (next_permutation(v.begin() , v.end());
    cout << su / c << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:51: error: expected ')' before ';' token
   31 |     } while (next_permutation(v.begin() , v.end());
      |             ~                                     ^
      |                                                   )