Language: C++

#include<bits/stdc++.h>
#define REP(i,n)    for(int i = 0; i < (n); ++i)
#define RREP(i,n)   for(int i = (n); i >= 0; --i)
#define FOR(i,m,n) for(int i = (m); i < (n); ++i)
#define SZ(x)       ( (int)(x).size() )
#define BIT(n)      ( 1LL << (n) )
#define EXIST(x)    ( (x).find()		!= (x).end() )
#define DEBUG(n)    cerr << #n << " : " << n << '\n';
#define PB  push_back
#define UB  upper_bound			//k <
#define LB  lower_bound			//k	<= 
#define F   first
#define S   second
#define INF 1.0e9


using namespace std;

typedef long long			ll;
typedef pair<int, int>		pii;
typedef pair<long			long, long long>   pll;
typedef vector<int>			vi;
typedef vector<double>		vd;
typedef vector<long long>   vll;

template<class T> void chmax(T &	a, const T & b){ if( a < b ) a = b; }
template<class T> void chmin(T &	a, const T & b){ if( a > b ) a = b; }

int r_up(const int a, const int b){ return (a + b - 1) / b; }

const int dx[] = { 0,  0, 1, -1 };
const int dy[] = { 1, -1, 0,  0 };

struct UFT{                                                                                                                                                   
  vi    p;                                                                                                                                                    
  UFT(){}                                                                                                                                                     
  UFT(int N)       { p.resize( N, -1 ); }                                                                                                                     
  int   par(int a)   { if( p[a] >= 0 ){ p[a]  = par( p[a] ); return p[a]; } return a;  }                                                                      
  int size(int a)  { return -p[par(a)]; }                                                                                                                     
  bool  same(int a, int b) { return par(a)   == par(b); }                                                                                                     
  void unite(int    a, int b){                                                                                                                                
    a                                                     = par(a);  b = par(b);                                                                              
    if( a == b ) return;                                                                                                                                      
    if( size(a) < size(b) ) swap(a,b);                                                                                                                        
    p[a]                                                 -= size(b);                                                                                          
    p[b]                                                  = a;                                                                                                
  }                                                                                                                                                           
};                                                                                                                                                            

int main(){
  int n,m;cin>>n>>m;
  UFT uft(n);
  REP(i,m){
	int a,b,c;cin>>a>>b>>c;
	unit(a-1,b-1);
  }
  bool f[100010]={};
  int cnt=0;
  REP(i,n){
	if(!f[par(i)])cnt++;
	f[par(i)]=1;
  }
  cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: 'unit' was not declared in this scope; did you mean 'uint'?
   55 |         unit(a-1,b-1);
      |         ^~~~
      |         uint
a.cc:60:15: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   60 |         if(!f[par(i)])cnt++;
      |               ^~~
      |               __pstl::execution::v1::par
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc:61:11: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   61 |         f[par(i)]=1;
      |           ^~~
      |           __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~