Language: C++

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


 
int main (){
    
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0;i<N;i++)A[i]=i;
    
    vector<pib> xy(N);
    for(pib &i:xy)cin >> i.first >> i.second;
    
    ld dis0=0,count=0;
    do {
        for(int i=0;i<N-1;i++)dis0+=sqrt(pow(xy[A[i]].first-xy[A[i+1]].first,2)+pow(xy[A[i]].second-xy[A[i+1]].second,2));
        count++;
    } while (next_permutation(A.begin(), A.end()));

    printf("%.10Lf",dis0/count);
}


Compiler output:
a.cc:4:13: error: 'pair' does not name a type
    4 | using pib = pair<int, int>;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | //#include <bits/stdc++.h>
a.cc:12:5: error: 'vector' was not declared in this scope
   12 |     vector<int> A(N);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | //#include <bits/stdc++.h>
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> A(N);
      |            ^~~
a.cc:13:25: error: 'A' was not declared in this scope
   13 |     for(int i=0;i<N;i++)A[i]=i;
      |                         ^
a.cc:15:12: error: 'pib' was not declared in this scope
   15 |     vector<pib> xy(N);
      |            ^~~
a.cc:15:17: error: 'xy' was not declared in this scope
   15 |     vector<pib> xy(N);
      |                 ^~
a.cc:16:15: error: found ':' in nested-name-specifier, expected '::'
   16 |     for(pib &i:xy)cin >> i.first >> i.second;
      |               ^
      |               ::
a.cc:16:14: error: 'i' has not been declared
   16 |     for(pib &i:xy)cin >> i.first >> i.second;
      |              ^
a.cc:18:14: error: expected ';' before ',' token
   18 |     ld dis0=0,count=0;
      |              ^
      |              ;
a.cc:18:14: error: expected primary-expression before ',' token
a.cc:18:15: error: 'count' was not declared in this scope
   18 |     ld dis0=0,count=0;
      |               ^~~~~
a.cc:18:22: error: expected ')' before ';' token
   18 |     ld dis0=0,count=0;
      |                      ^
      |                      )
a.cc:16:8: note: to match this '('
   16 |     for(pib &i:xy)cin >> i.first >> i.second;
      |        ^
a.cc:20:31: error: 'dis0' was not declared in this scope
   20 |         for(int i=0;i<N-1;i++)dis0+=sqrt(pow(xy[A[i]].first-xy[A[i+1]].first,2)+pow(xy[A[i]].second-xy[A[i+1]].second,2));
      |                               ^~~~
a.cc:20:49: error: 'A' was not declared in this scope
   20 |         for(int i=0;i<N-1;i++)dis0+=sqrt(pow(xy[A[i]].first-xy[A[i+1]].first,2)+pow(xy[A[i]].second-xy[A[i+1]].second,2));
      |                                                 ^
a.cc:20:42: error: 'pow' was not declared in this scope
   20 |         for(int i=0;i<N-1;i++)dis0+=sqrt(pow(xy[A[i]].first-xy[A[i+1]].first,2)+pow(xy[A[i]].second-xy[A[i+1]].second,2));
      |                                          ^~~
a.cc:20:37: error: 'sqrt' was not declared in this scope
   20 |         for(int i=0;i<N-1;i++)dis0+=sqrt(pow(xy[A[i]].first-xy[A[i+1]].first,2)+pow(xy[A[i]].second-xy[A[i+1]].second,2));
      |                                     ^~~~
a.cc:21:9: error: 'count' was not declared in this scope
   21 |         count++;
      |         ^~~~~
a.cc:22:31: error: 'A' was not declared in this scope
   22 |     } while (next_permutation(A.begin(), A.end()));
      |                               ^
a.cc:22:14: error: 'next_permutation' was not declared in this scope
   22 |     } while (next_permutation(A.begin(), A.end()));
      |              ^~~~~~~~~~~~~~~~
a.cc:24:21: error: 'dis0' was not declared in this scope
   24 |     printf("%.10Lf",dis0/count);
      |                     ^~~~
a.cc:24:26: error: 'count' was not declared in this scope
   24 |     printf("%.10Lf",dis0/count);
      |                          ^~~~~
a.cc:24:5: error: 'printf' was not declared in this scope
   24 |     printf("%.10Lf",dis0/count);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | //#include <bits/stdc++.h>