Language: C++

#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INF 1000000000000000000LL
using namespace std;
long long prim(int V, vector<pair<long long, long long>> X[]) {
	queue<int> Q; int dist[100], color[100];
	for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; }
	dist[0] = 0; color[0] = GRAY; Q.push(make_pair(0, 0));
	while (!Q.empty()) {
		pair<long long, long long>pa = Q.top(); Q.pop();
		long long a1 = pa.first, a2 = pa.second; color[a2] = BLACK;
		for (int i = 0; i < X[a2].size(); i++) {
			long long to = X[a2][i].first, leng = X[a2][i].second;
			if (dist[to] > leng && color[to] < BLACK) {
				dist[to] = leng; Q.push(make_pair(dist[to], to));
			}
		}
	}
	long long sum = 0; for (int i = 0; i < V; i++) { sum += dist[i]; }//0-indexed
	return sum;
}
int n, m, u, v, w; vector<pair<long long, long long> > g[100];
int main() {
	while(cin >> n >> m) {
		for(int i = 0; i < n; i++) g[i].clear();
		for(int i = 0; i < m; i++) {
			scanf("%d,%d,%d", u, v, w);
			g[u].push_back(make_pair(v, w / 100 - 1));
			g[v].push_back(make_pair(u, w / 100 - 1));
		}
		cout << prim(n, g) << endl;
	}
}

Compiler output:
a.cc: In function 'long long int prim(int, std::vector<std::pair<long long int, long long int> >*)':
a.cc:8:13: warning: overflow in conversion from 'long long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
    8 | #define INF 1000000000000000000LL
      |             ^~~~~~~~~~~~~~~~~~~~~
a.cc:12:49: note: in expansion of macro 'INF'
   12 |         for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; }
      |                                                 ^~~
a.cc:13:45: error: no matching function for call to 'std::queue<int>::push(std::pair<int, int>)'
   13 |         dist[0] = 0; color[0] = GRAY; Q.push(make_pair(0, 0));
      |                                       ~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'std::pair<int, int>' to 'const std::queue<int>::value_type&' {aka 'const int&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'std::pair<int, int>' to 'std::queue<int>::value_type&&' {aka 'int&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:15:50: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   15 |                 pair<long long, long long>pa = Q.top(); Q.pop();
      |                                                  ^~~
      |                                                  pop
a.cc:20:56: error: no matching function for call to 'std::queue<int>::push(std::pair<int, long long int>)'
   20 |                                 dist[to] = leng; Q.push(make_pair(dist[to], to));
      |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'std::pair<int, long long int>' to 'const std::queue<int>::value_type&' {aka 'const int&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'std::pair<int, long long int>' to 'std::queue<int>::value_type&&' {aka 'int&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~