Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;

#define maxn 10000+10;
#define maxe maxn*maxn/2+1;
int pa[maxn],ran[maxn];

void init(int n){
	for(int i=0; i<n; i++){
		pa[i] = i;
		ran[i] = 0;
	}
}

int find(int x){
	if(pa[x]==x) return x;
	else pa[x] = find(pa[x]);
}

void unite(int x,int y){
	x = find(x); y = find(y);

	if(x==y) return ;
	if(ran[x] < ran[y]){
		pa[x] = y;
	}else{
		pa[y] = x;
		if(ran[x] == ran[y])
			++ran[x];
	}
}

bool same(int x,int y){
	return find(x) == find(y);
}

struct edge{
	int u,v;
	double cost;
	edge(int u=0,int v=0,double cost=0) : u(u),v(v),cost(cost){}
	bool operator<(const edge& rhs) const{
		return cost > rhs.cost;
	}
};
edge es[maxe];
int V,E;

pair<int,int> pile[maxn];

double kruskal(){
	sort(es,es+E);
	init(V);
	double res = 0;
	for(int i=0; i<E; i++){
		edge e = es[i];
		if(!same(e.u,e.v))
			unite(e.u,e.v);
		else
			res += e.cost;
	}

	return res;
}


int main(){
	scanf("%d%d",&V,&E);
	for(int i=0; i<V; i++)
		scanf("%d%d",&pile[i].first,&pile[i].second);

	for(int i=0; i<E; i++){
		scanf("%d%d",&es[i].u,&es[i].v);
		--es[i].u,--es[i].v;
		int dx = pile[es[i].u].first - pile[es[i].v].first;
		int dy = pile[es[i].u].second - pile[es[i].v].second;
		es[i].cost = sqrt(dx*dx+dy*dy);	
	}

	printf("%.3lf\n",kruskal());
}

Compiler output:
a.cc:10:22: error: expected ']' before ';' token
   10 | #define maxn 10000+10;
      |                      ^
a.cc:12:8: note: in expansion of macro 'maxn'
   12 | int pa[maxn],ran[maxn];
      |        ^~~~
a.cc:12:12: error: expected unqualified-id before ']' token
   12 | int pa[maxn],ran[maxn];
      |            ^
a.cc:12:22: error: expected unqualified-id before ']' token
   12 | int pa[maxn],ran[maxn];
      |                      ^
a.cc: In function 'void init(int)':
a.cc:16:17: error: 'pa' was not declared in this scope
   16 |                 pa[i] = i;
      |                 ^~
a.cc:17:17: error: 'ran' was not declared in this scope; did you mean 'tan'?
   17 |                 ran[i] = 0;
      |                 ^~~
      |                 tan
a.cc: In function 'int find(int)':
a.cc:22:12: error: 'pa' was not declared in this scope
   22 |         if(pa[x]==x) return x;
      |            ^~
a.cc: In function 'void unite(int, int)':
a.cc:30:12: error: 'ran' was not declared in this scope; did you mean 'tan'?
   30 |         if(ran[x] < ran[y]){
      |            ^~~
      |            tan
a.cc:31:17: error: 'pa' was not declared in this scope
   31 |                 pa[x] = y;
      |                 ^~
a.cc:33:17: error: 'pa' was not declared in this scope
   33 |                 pa[y] = x;
      |                 ^~
a.cc: At global scope:
a.cc:10:22: error: expected ']' before ';' token
   10 | #define maxn 10000+10;
      |                      ^
a.cc:11:14: note: in expansion of macro 'maxn'
   11 | #define maxe maxn*maxn/2+1;
      |              ^~~~
a.cc:51:9: note: in expansion of macro 'maxe'
   51 | edge es[maxe];
      |         ^~~~
a.cc:10:14: error: expected unqualified-id before numeric constant
   10 | #define maxn 10000+10;
      |              ^~~~~
a.cc:11:19: note: in expansion of macro 'maxn'
   11 | #define maxe maxn*maxn/2+1;
      |                   ^~~~
a.cc:51:9: note: in expansion of macro 'maxe'
   51 | edge es[maxe];
      |         ^~~~
a.cc:11:23: error: expected unqualified-id before '/' token
   11 | #define maxe maxn*maxn/2+1;
      |                       ^
a.cc:51:9: note: in expansion of macro 'maxe'
   51 | edge es[maxe];
      |         ^~~~
a.cc:51:13: error: expected unqualified-id before ']' token
   51 | edge es[maxe];
      |             ^
a.cc:10:22: error: expected ']' before ';' token
   10 | #define maxn 10000+10;
      |                      ^
a.cc:54:20: note: in expansion of macro 'maxn'
   54 | pair<int,int> pile[maxn];
      |                    ^~~~
a.cc:54:24: error: expected unqualified-id before ']' token
   54 | pair<int,int> pile[maxn];
      |                        ^
a.cc: In function 'double kruskal()':
a.cc:57:14: error: 'es' was not declared in this scope
   57 |         sort(es,es+E);
      |              ^~
a.cc: In function 'int main()':
a.cc:75:31: error: 'pile' was not declared in this scope
   75 |                 scanf("%d%d",&pile[i].first,&pile[i].second);
      |                               ^~~~
a.cc:78:31: error: 'es' was not declared in this scope
   78 |                 scanf("%d%d",&es[i].u,&es[i].v);
      |                               ^~
a.cc:80:26: error: 'pile' was not declared in this scope
   80 |                 int dx = pile[es[i].u].first - pile[es[i].v].first;
      |                          ^~~~
a.cc: In function 'int find(int)':
a.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^