Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX = 1000;

int par[MAX],rank[MAX],n,m;

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

int find(int x){
  if(par[x] == x) return x;
    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 kruskal(pair<int,pair<int,int> > es[MAX]){
  sort(es,es + m);
  init(n);
  int res = 0;
  for(int i = 0 ; i < m ; i++){
    int a = es[i].second.first;
    int b = es[i].second.second;
    if(!same(a,b)){
      res += es[i].first;
      unite(a,b);
    }
  }
  return res;
}

int main(){
  while(cin >> n,n){
    cin >> m;
    pair<int,pair<int,int> > es[MAX];
    for(int i = 0 ; i < m ; i++){
      scanf("%d,%d,%d", &es[i].second.first, &es[i].second.second,&es[i].first);
    }
    for(int i = 0 ; i < m ; i++){
      es[i].first = es[i].first/100-1;
    }

    cout << kruskal(es) << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:12:5: error: reference to 'rank' is ambiguous
   12 |     rank[i] = 0;
      |     ^~~~
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:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~
a.cc: In function 'void unite(int, int)':
a.cc:25:6: error: reference to 'rank' is ambiguous
   25 |   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:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~
a.cc:25:16: error: reference to 'rank' is ambiguous
   25 |   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:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~
a.cc:29:8: error: reference to 'rank' is ambiguous
   29 |     if(rank[x] == rank[y]) rank[x]++;
      |        ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~
a.cc:29:19: error: reference to 'rank' is ambiguous
   29 |     if(rank[x] == rank[y]) rank[x]++;
      |                   ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~
a.cc:29:28: error: reference to 'rank' is ambiguous
   29 |     if(rank[x] == rank[y]) rank[x]++;
      |                            ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:14: note:                 'int rank [1000]'
    7 | int par[MAX],rank[MAX],n,m;
      |              ^~~~