Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
struct Edge{ int from, to, cost; };

bool comp(const Edge& e1, const Edge& e2){
	return e1.cost < e2.cost;
}

const int N = 10000;
vector<Edge> e;

int par[N];
int rank[N];

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

void unite(int x, int y)
{
	x = find(x);
	y = find(y);
	if(x == y)
		return;
	
	if(rank[x] < rank[y])
		par[x] = y;
	else {
		par[y] = x;
		if(rank[x] == rank[y])
			rank[x]++;
	}
}

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

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	while(1){
		int n, m;
		cin >> n;
		if(n == 0)
			break;
		cin >> m;
		
		int a1, a2, a3;
		char b1, b2;
		for(int i = 0; i != m; ++i){
			cin >> a1 >> b1 >> a2 >> b2 >> a3;
			e.push_back(Edge{a1, a2, a3 / 100 - 1});
		}
		
		for(int i = 0; i != n; ++i){
			par[i] = i;
			rank[i] = 0;
		}
		
		sort(e.begin(), e.end(), comp);
		
		int ans = 0;
		for(int i = 0; i != m; ++i){
			if(!same(e[i].from, e[i].to)){
				unite(e[i].from, e[i].to);
				ans += e[i].cost;
			}
		}
		
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'void unite(int, int)':
a.cc:33:12: error: reference to 'rank' is ambiguous
   33 |         if(rank[x] < rank[y])
      |            ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~
a.cc:33:22: error: reference to 'rank' is ambiguous
   33 |         if(rank[x] < rank[y])
      |                      ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~
a.cc:37:20: error: reference to 'rank' is ambiguous
   37 |                 if(rank[x] == rank[y])
      |                    ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~
a.cc:37:31: error: reference to 'rank' is ambiguous
   37 |                 if(rank[x] == rank[y])
      |                               ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~
a.cc:38:25: error: reference to 'rank' is ambiguous
   38 |                         rank[x]++;
      |                         ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:68:25: error: reference to 'rank' is ambiguous
   68 |                         rank[i] = 0;
      |                         ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:16:5: note:                 'int rank [10000]'
   16 | int rank[N];
      |     ^~~~