Language: C++

#include <iostream>
2.#include <algorithm>
3.#include <vector>
4.#include <utility>
5.#include <cmath>
6.#include <iomanip>
7.using namespace std;
8. 
9.// ?舵?????虫?鎹?????
10.#define MAX_N 10000 + 16
11.int parent[MAX_N];
12.int height[MAX_N];
13. 
14.void init(const int& n)
15.{
16.	for (int i = 0; i < n; ++i)
17.	{
18.		parent[i] = i;
19.		height[i] = 0;
20.	}
21.}
22. 
23.int find(const int& x)
24.{
25.	if (parent[x] == x)
26.	{
27.		return x;
28.	}
29.	else
30.	{
31.		return parent[x] = find(parent[x]);
32.	}
33.}
34. 
35.void unite(int x, int y)
36.{
37.	x = find(x);
38.	y = find(y);
39.	if (x == y)
40.	{
41.		return;
42.	}
43. 
44.	if (height[x] < height[y])
45.	{
46.		parent[x] = y;
47.	}
48.	else
49.	{
50.		parent[y] = x;
51.		if (height[x] == height[y])
52.		{
53.			++height[x];
54.		}
55.	}
56.}
57. 
58.bool same(const int& x, const int& y)
59.{
60.	return find(x) == find(y);
61.}
62.// End Of ?舵???
63. 
64.#define MAX_E MAX_N * MAX_N / 2 + 1
65.struct edge
66.{
67.	int u, v;
68.	double cost;
69.	edge(int u = 0, int v = 0, double cost = 0) : u(u), v(v), cost(cost) {}
70.	bool operator < (const edge & e2) const
71.	{
72.		return cost > e2.cost;
73.	}
74.};
75. 
76.edge es[MAX_E];
77.int V, E;
78.double kruskal()
79.{
80.	sort(es, es + E);    // ??収?冨???????ф?搴?
81.	init(V);
82.	double res = 0;
83.	for (int i = 0; i < E; ++i)
84.	{
85.		edge e = es[i];
86.		if (!same(e.u, e.v))
87.		{
88.			unite(e.u, e.v);
89.		}
90.		else
91.		{
92.			res += e.cost;
93.		}
94.	}
95. 
96.	return res;
97.}
98. 
99.pair<int, int> pile[MAX_N];
100. 
101.///////////////////////////SubMain//////////////////////////////////
102.int main(int argc, char *argv[])
103.{
104.	cin >> V >> E;
105.	
106.	for (int i = 0; i < V; ++i)
107.	{
108.		cin >> pile[i].first >> pile[i].second;
109.	}
110. 
111.	for (int i = 0; i < E; ++i)
112.	{
113.		cin >> es[i].u >> es[i].v;
114.		--es[i].u; --es[i].v;
115.		int dx = pile[es[i].u].first - pile[es[i].v].first;
116.		int dy = pile[es[i].u].second - pile[es[i].v].second;
117.		es[i].cost = sqrt(dx * dx + dy * dy);
118.	}
119. 
120.	cout.setf(ios::showpoint);
121.	cout.precision(3);
122.	cout.setf(ios::fixed);
123.	cout << kruskal() << endl;
124.	return 0;
125.}

Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2.#include <algorithm>
      |   ^
a.cc:3:3: error: stray '#' in program
    3 | 3.#include <vector>
      |   ^
a.cc:4:3: error: stray '#' in program
    4 | 4.#include <utility>
      |   ^
a.cc:5:3: error: stray '#' in program
    5 | 5.#include <cmath>
      |   ^
a.cc:6:3: error: stray '#' in program
    6 | 6.#include <iomanip>
      |   ^
a.cc:10:4: error: stray '#' in program
   10 | 10.#define MAX_N 10000 + 16
      |    ^
a.cc:64:4: error: stray '#' in program
   64 | 64.#define MAX_E MAX_N * MAX_N / 2 + 1
      |    ^
a.cc:76:1: error: exponent has no digits
   76 | 76.edge es[MAX_E];
      | ^~~~~~~
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.#include <algorithm>
      | ^~
a.cc:8:1: error: expected unqualified-id before numeric constant
    8 | 8.
      | ^~
a.cc:12:1: error: expected unqualified-id before numeric constant
   12 | 12.int height[MAX_N];
      | ^~~~~~
a.cc:13:1: error: expected unqualified-id before numeric constant
   13 | 13.
      | ^~~
a.cc:22:1: error: expected unqualified-id before numeric constant
   22 | 22.
      | ^~~
a.cc:34:1: error: expected unqualified-id before numeric constant
   34 | 34.
      | ^~~
a.cc:57:1: error: expected unqualified-id before numeric constant
   57 | 57.
      | ^~~
a.cc:62:1: error: expected unqualified-id before numeric constant
   62 | 62.// End Of ?舵???
      | ^~~
a.cc:75:1: error: expected unqualified-id before numeric constant
   75 | 75.
      | ^~~
a.cc:77:1: error: expected unqualified-id before numeric constant
   77 | 77.int V, E;
      | ^~~~~~
a.cc:78:1: error: expected unqualified-id before numeric constant
   78 | 78.double kruskal()
      | ^~~~~~~~~
a.cc:98:1: error: expected unqualified-id before numeric constant
   98 | 98.
      | ^~~
a.cc:100:1: error: expected unqualified-id before numeric constant
  100 | 100.
      | ^~~~