criyle/codenet-compile-errors huggingface dataset:
Language: C++

#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

// template version 2.0
using namespace std;
#include <bits/stdc++.h>

// varibable settings
const long long INF = 1e18;
template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T, class U> inline void chmax(T &a, const U &b) { if ((a) < (b)) (a) = (b); }
template <class T, class U> inline void chmin(T &a, const U &b) { if ((a) > (b)) (a) = (b); }
template <typename X, typename T> auto make_table(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_table(X x, Y y, Z z, Zs... zs) { auto cont = make_table(y, z, zs...); return vector<decltype(cont)>(x, cont); }

#define cdiv(a, b) (((a) + (b)-1) / (b))
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x) sort(all(x)); x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
void check_input() { assert(cin.eof() == 0); int tmp; cin >> tmp; assert(cin.eof() == 1); }

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;
struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

int solve() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t) {
            puts(d.same(u, v) ? "1" : "0");
        } else {
            d.merge(u, v);
        }
    }
    return 0;
}

int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/



Compiler output:
solve.cpp: In function 'int solve()':
solve.cpp:8:5: error: 'dsu' was not declared in this scope
solve.cpp:13:18: error: 'd' was not declared in this scope
solve.cpp:15:13: error: 'd' was not declared in this scope
Language: C++

#include <atcoder/dsu>
#include <cstdio>

using namespace std;
using namespace atcoder;

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                printf("1\n");
            } else {
                printf("0\n");
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:1:10: fatal error: atcoder/dsu: No such file or directory
    1 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional> 
#include <iomanip>
#include <unordered_map>
#include <memory.h>
#include <cstring>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <cassert>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, q;

	cin >> n >> q;
	dsu uf(n + 1);
	for (int i = 0; i < q; i++)
	{
		int t, u, v;
		cin >> t >> u >> v;
		if (t == 0)
		{
			uf.merge(u, v);
		}
		else
		{
			cout << uf.same(u, v) << '\n';
		}
	}
	return 0;
}

Compiler output:
a.cc:27:10: fatal error: atcoder/dsu: No such file or directory
   27 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/all>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define LL long long

int main(){
    int n,q;
    cin>>n>>q;
    auto uf = atcoder::dsu(n);
    REP(i,q){
        int m,u,v;
        cin>>m>>u>>v;
        if(m==0){
            uf.merge(u, v);
        }else{
            if(uf.same(u,v)){
                cout<<1<<endl;
            }else{
                cout<<0<<endl;
            }
        }
    }
    
}

Compiler output:
a.cc:1:10: fatal error: atcoder/all: No such file or directory
    1 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <atcoder/all>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
using ll = long long;
using ull = unsigned long long;
#define REP(i, m, n) for (ll(i) = (ll)(m); i < (ll)(n); ++i)
#define REP2(i, m, n) for (ll(i) = (ll)(n)-1; i >= (ll)(m); --i)
#define rep(i, n) REP(i, 0, n)
#define rep2(i, n) REP2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using Edge = pair<int, long long>;
using Graph = vector<vector<Edge>>;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
// constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
template <class T> inline void print(T x) { cout << x << '\n'; }
template <class T> bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }

// ~~~~~~~~~~~~~~memo~~~~~~~~~~~~~~
// for (int i = 0; i < n; ++i)
// v ector<long long> v(n), c(n);
// cout << res << endl;
// cout << res << '\n';
// int型の2次元配列(h×w要素の)の宣言
// vector<vector<int>> data(h, vector<int>(w));
// rotate(s.begin(), s.begin() + 1, s.end());
// sort(all(a),greater<int>());
// s.substr(0,2) 先頭から2文字切り出す
// for (auto it = mp.rbegin();it != mp.rend(); ++it)
// vector<vector<vector<int>>> dp(n + 1, vector<vector<int>>(w + 1,
// vector<int>(k+1, 0)));

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, q;
    cin >> n >> q;
    dsu uf(n);
    rep(i, q) {
        ll t, u, v;
        cin >> t >> u >> v;
        if (t == 0) {
            uf.merge(u, v);
        } else {
            if (uf.same(u,v)) {
                print(1);
            } else {
                print(0);
            }
            
        }
    }
    return 0;
}


Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,a) rng(i,0,a)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,a) gnr(i,0,a)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define print(x) cout<<(x)<<'\n'
using ll=long long;
using pl=pair<ll,ll>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vs=vector<string>;

void solve() {
    ll N, Q;
    cin >> N >> Q;
    dsu d(N);
    ll t, u, v;
    rep(i,Q){
        cin >> t >> u >> v;
        if(t){
            print(d.same(u, v));
        }else{
            d.merge(u, v);
        }
    }
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
    //int q; cin >> q;
	//while (q--)
		solve();
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all> 

#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)

// policy-based
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;	


using namespace std;
using namespace atcoder;

typedef long long ll; // int or long long
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;

/*
typedef tree<
ll,
null_type,
less<ll>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
*/
 
const ll MAX = 5e6 + 100;
const ll inf = 1e9;

int main(){
	fastio;	
	ll n,q,t,u,v;
	cin >> n >> q;
	dsu d(n);
	while(q--){
		cin >> t >> u >> v;
		if(t == 0) d.merge(u,v);
		else{
			if(d.same(u,v)) cout <<"1\n";
			else cout << "0\n";
		}
	}
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;
using namespace atcoder;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LLP;

int main() {
  
  int N, Q;
  cin >> N >> Q;

  dsu d(N);
  rep(qi,Q) {
    int t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      d.merge(u, v);
    } else {
      cout << (d.same(u, v) ? 1 : 0) << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++


//#pragma GCC target("avx2")
#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (ll i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (ll i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n, q;
    cin >> n >> q;

    dsu d(n);

    REP(i, q) {
        int t, a, b;
        cin >> t >> a >> b;
        if (t == 0) {
            d.merge(a, b);
        } else {
            if (d.same(a, b)) print("1");
            else print("0");
        }
    }
}


Compiler output:
a.cc:7:10: fatal error: atcoder/all: No such file or directory
    7 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;

int main() {
  int n, q;
  cin >> n >> q;
  dsu d(n);
  for (int i = 0; i < q; i++) {
    int t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      d.merge(u, v);
    } else {
      cout << d.same(u, v) << endl;
    }
  }
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> LP;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
    int N, Q, com, u, v;
    cin >> N >> Q;
    dsu uf(N);
    rep(_,Q){
        cin >> com >> u >> v;
        if(com == 0)uf.merge(u, v);
        else cout << uf.same(u, v) << endl;
    }
    return 0;
}


Compiler output:
a.cc:14:10: fatal error: atcoder/all: No such file or directory
   14 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <atcoder/dsu>

int main() {
  int N, Q;
  std::cin >> N >> Q;
  atcoder::dsu dsu(N);
  for (int i = 0; i < Q; i++) {
    int type, u, v;
    std::cin >> type >> u >> v;
    if (type == 0) {
      dsu.merge(u,v);
    } else {
      if (dsu.same(u,v)) std::cout << 1 << std::endl;
      else std::cout << 0 << std::endl;
    }
  }
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <atcoder/dsu.hpp>

int main() {
  int N, Q;
  std::cin >> N >> Q;
  atcoder::dsu dsu(N);
  for (int i = 0; i < Q; i++) {
    int type, u, v;
    std::cin >> type >> u >> v;
    if (type == 0) {
      dsu.merge(u,v);
    } else {
      if (dsu.same(u,v)) std::cout << 1 << std::endl;
      else std::cout << 0 << std::endl;
    }
  }
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu.hpp: No such file or directory
    2 | #include <atcoder/dsu.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include "atcoder/dsu.hpp"

int main() {
  int N, Q;
  std::cin >> N >> Q;
  atcoder::dsu dsu(N);
  for (int i = 0; i < Q; i++) {
    int type, u, v;
    std::cin >> type >> u >> v;
    if (type == 0) {
      dsu.merge(u,v);
    } else {
      if (dsu.same(u,v)) std::cout << 1 << std::endl;
      else std::cout << 0 << std::endl;
    }
  }
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu.hpp: No such file or directory
    2 | #include "atcoder/dsu.hpp"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
#include<atcoder/dsu>
using namespace std;
using namespace atcoder;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
//const ll MOD = 1e9 + 7;
const ll MOD = 998244353;



int main() {
	int n, q;
	cin >> n >> q;
	
	dsu d(n);
	for (int i = 0; i < q; i++) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t) {
			cout << d.same(u, v) << endl;
		}
		else {
			d.merge(u, v);
		}
	}
}

Compiler output:
a.cc:14:9: fatal error: atcoder/dsu: No such file or directory
   14 | #include<atcoder/dsu>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
const ll INF = LONG_LONG_MAX / 2;
const ll mod = 1000000000 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  int N, Q;
  cin >> N >> Q;
  dsu d(N);
  for (int i = 0; i < Q; i++) {
    int t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      d.merge(u, v);
    } else if (t == 1) {
      if (d.same(u, v))
        cout << "1" << endl;
      else
        cout << "0" << endl;
    }
  }
}


Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <cstring>
#include <queue>
#include <assert.h>
#include <cmath>
#include <stack>
#include <deque>
#include <set>
#include <unordered_map>
#include <complex>
#include <fstream>
#include <map>
#include <numeric>
#include <functional>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
const int mxn = 1e5+10;


int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int n, q; cin>>n>>q;
	dsu d(n);
	while(q--) {
		int t, u, v; cin>>t>>u>>v;
		if(!t) {
			d.merge(u, v);
		}
		else {
			cout << d.same(u, v) << '\n';
		}
	}

	return 0;
}
//comparator function in sorting
//swapping arguments
//missing cases in dp
//dividing in modulo
//Beware of overflow and modulo
//Be mindful of overflow
//s is a matrix but forget
//length of ranges
//working with bit using ull

Compiler output:
a.cc:18:10: fatal error: atcoder/dsu: No such file or directory
   18 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

int main() {
  int N, Q;
  cin >> N >> Q;
  dsu d(N);
  for (int i = 0; i < Q; ++i) {
    int t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      d.merge(u, v);
    } else {
      if (d.same(u, v)) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <cstring>
#include <queue>
#include <assert.h>
#include <cmath>
#include <stack>
#include <deque>
#include <set>
#include <unordered_map>
#include <complex>
#include <fstream>
#include <map>
#include <numeric>
#include <functional>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
const int mxn = 1e5+10;


int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int n, q; cin>>n>>q;
	dsu d(n);
	while(q--) {
		int t, u, v; cin>>t>>u>>v;
		if(!t) {
			d.merge(u, v);
		}
		else {
			cout << d.same(u, v) << '\n';
		}
	}

	return 0;
}
//comparator function in sorting
//swapping arguments
//missing cases in dp
//dividing in modulo
//Beware of overflow and modulo
//Be mindful of overflow
//s is a matrix but forget
//length of ranges
//working with bit using ull

Compiler output:
a.cc:18:10: fatal error: atcoder/all: No such file or directory
   18 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
int main(){
  int N, Q;
  cin >> N >> Q;
  dsu G(N);
  for (int i = 0; i < Q; i++){
    int t, u, v;
    cin >> t >> u >> v;
    if (t == 0){
      G.merge(u, v);
    }
    if (t == 1){
      cout << G.same(u, v) << endl;
    }
  }
}

Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

#include <atcoder/dsu>
using namespace atcoder;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n, q;
    cin >> n >> q;
    dsu d(n);
    while(q--) {
        int t, u, v;
        cin >> t >> u >> v;
        if(t == 0)
            d.merge(u, v);
        else
            cout << d.same(u, v) << "\n";
    }

    return 0;
}

Compiler output:
a.cc:20:10: fatal error: atcoder/dsu: No such file or directory
   20 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<cmath>
#include <bits/stdc++.h>
#include "dsu.hpp"
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
#define ALL(a) a.begin(), a.end()
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
typedef vector<ll> vec;
typedef vector<vec> mat;

using namespace atcoder;

int main(){
    int n,q;
    cin >> n>> q;
    dsu tree=dsu(n);
    rep(i,q){
        int t,u,v;
        cin >> t>> u>> v;
        if(t==0){
            tree.merge(u,v);
        }else{
            if(tree.same(u,v)){
                cout<<1<<endl;
            }else{
                cout<<0<<endl;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: dsu.hpp: No such file or directory
    3 | #include "dsu.hpp"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;
#define REP(i,j,n) for(int i=j;i<n;i++)
#define rep(i,n) REP(i,0,n)

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,q;
    cin >> n >> q;

    dsu d(n);
    rep(i,q)
    {
        int t,u,v;
        cin >> t >> u >> v;
        if (t==0)
        {
           d.merge(u, v);
        }
        else
        {
            cout << d.same(u, v) << endl;
        }
    }
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

// template version 2.0
using namespace std;
#include <bits/stdc++.h>

// varibable settings
const long long INF = 1e18;
template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T, class U> inline void chmax(T &a, const U &b) { if ((a) < (b)) (a) = (b); }
template <class T, class U> inline void chmin(T &a, const U &b) { if ((a) > (b)) (a) = (b); }
template <typename X, typename T> auto make_table(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_table(X x, Y y, Z z, Zs... zs) { auto cont = make_table(y, z, zs...); return vector<decltype(cont)>(x, cont); }

#define cdiv(a, b) (((a) + (b)-1) / (b))
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x) sort(all(x)); x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
void check_input() { assert(cin.eof() == 0); int tmp; cin >> tmp; assert(cin.eof() == 1); }

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;
struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#include <atcoder/dsu>
using namespace atcoder;

int solve() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t) {
            puts(d.same(u, v) ? "1" : "0");
        } else {
            d.merge(u, v);
        }
    }
    return 0;
}

int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/



Compiler output:
solve.cpp:5:10: fatal error: atcoder/dsu: No such file or directory
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;

int main(){
    int n,q;
	cin >> n >> q;
    atcoder::dsu uf(n);
    int t,u,v;
    for(int i=0;i<q; i++){
        cin >> t >> u >> v;
        if(t)cout << uf.same(u,v) << endl;
        else uf.merge(u, v);
    }
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;

int main()
{
    size_t N, Q;
    cin >> N >> Q;
    atcoder::dsu dsu(N);

    int t, u, v;
    for (size_t i = 0; i < Q; i++)
    {
        cin >> t >> u >> v;
        if (t == 0)
        {
            dsu.merge(u, v);
        }
        else
        {
            cout << dsu.same(u, v) << endl;
        }
    }
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

class UnionFind {
public:
    vector<int> par;
    int N;
    UnionFind(int n) {
        par.resize(n, -1);
        N = n;
    }
    int Find(int n) {
        return par[n] < 0 ? n : par[n] = Find(par[n]);
    }
    bool Union(int x, int y) {
        x = Find(x);
        y = Find(y);
        if (x == y) return false;
        if (-par[x] > -par[y]) swap(x, y);
        par[y] += par[x];
        par[x] = y;
        N--;
        return true;
    }
    bool Same(int x, int y) {
        return Find(x) == Find(y);
    }
    int size(int x) {
        return -par[Find(x)];
    }
    int size() {
        return N;
    }
};


int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, q;
    cin, n, q;
    UnionFind uf(n);
    REP(i, 0, q) {
        int t, a, b;
        cin, t, a, b;
        if (t == 0) {
            uf.Union(a, b);
        } else {
            print(uf.Same(a, b));
        }
    }
    return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;

int main() {
	int n, q;
	scanf("%d %d", &n, &q);
	dsu d(n);
	for (int i = 0; i < q; i++) {
		int t, u, v;
		scanf("%d %d %d", &t, &u, &v);
		if (t) {
			puts(d.same(u, v) ? "1" : "0");
		} else {
			d.merge(u, v);
		}
	}
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>
#include <atcoder/dsu.hpp>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, q, a, b, c;
    cin >> n >> q;
    atcoder::dsu d(n+1);
    for(int i=0;i<q;++i) {
        cin >> a >> b >> c;
        if(a == 0) {
            d.merge(b, c);
        } else {
            cout << d.same(b, c) << endl;
        }
    }
}

Compiler output:
a.cc:21:10: fatal error: atcoder/dsu.hpp: No such file or directory
   21 | #include <atcoder/dsu.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>
#include <atcoder/dsu>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, q, a, b, c;
    cin >> n >> q;
    atcoder::dsu d(n+1);
    for(int i=0;i<q;++i) {
        cin >> a >> b >> c;
        if(a == 0) {
            d.merge(b, c);
        } else {
            cout << d.same(b, c) << endl;
        }
    }
}

Compiler output:
a.cc:21:10: fatal error: atcoder/dsu: No such file or directory
   21 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

#include <dsu.hpp>

using namespace std;
using namespace atcoder;

#define unionFind dsu

typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}


int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(0);

	int N, Q; cin >> N >> Q;
	unionFind uf = unionFind(N);
	for (int i = 0; i < Q; i++) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t == 0) {
			uf.merge(u, v);
		}
		else {
			cout << uf.same(u, v) << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:22:10: fatal error: dsu.hpp: No such file or directory
   22 | #include <dsu.hpp>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>
#include <atcoder/dsu.hpp>

using namespace std;
using namespace atcoder;

#define unionFind dsu

typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}


int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(0);

	int N, Q; cin >> N >> Q;
	unionFind uf = unionFind(N);
	for (int i = 0; i < Q; i++) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t == 0) {
			uf.merge(u, v);
		}
		else {
			cout << uf.same(u, v) << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:21:10: fatal error: atcoder/dsu.hpp: No such file or directory
   21 | #include <atcoder/dsu.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<atcoder/all>
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;
using namespace atcoder;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}


// dsu d(int n) // n頂点(頂点番号 0 ~ n-1) 0辺の無向グラフの作成。グラフ名をdとして使うときは "dsu d(n);"
// d.merge(int a, int b) // 辺(a,b)の追加
// bool d.same(int a, int b) // 頂点a,bが連結かどうかを返す
// int d.size(int a) // 頂点aの属する連結成分のサイズを返す
// vector<vector<int>> d.groups() // グラフを連結成分に分け、その情報を返す。返り値は「「一つの連結成分の頂点番号のリスト」のリスト」。


signed main(){
    int n,q;
    cin >> n >> q;
    dsu d(n);

    REP(i,q){
        int t1,u1,v1;
        cin >> t1 >> u1 >> v1;
        if(t1==0){
            d.merge(u1,v1);
        }
        else{
            cout << d.same(u1,v1) << endl;
        }
    }
    

    



    return 0;
}


Compiler output:
a.cc:1:9: fatal error: atcoder/all: No such file or directory
    1 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;

int main() {
    int N,Q;
    cin >> N >> Q;
    dsu d(N);
    for(int i=0;i<Q;i++) {
        int t, u, v;
        cin >> t >> u >> v;
        if(t==0) {
            d.merge(u,v);
        }else{
            cout << (d.same(u, v) ? 1:0) << endl;
        }
    }
}

Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

int main() {
    int N, Q;
    cin >> N >> Q;
    dsu d(N);
    for (int i = 0; i < Q; i++) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t) {
            cout << d.same(u, v) << endl;
        } else {
            d.merge(u, v);
        }
    }
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;

#define REP(i, n) for (int i=0; i<(n); ++i)
#define FOR(i, a, n) for (int i=(a); i<(n); ++i)

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[";
  REP(i, SZ(v)) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template<class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n, q; cin >> n >> q;
  dsu uf(n);
  REP(_, q) {
    int t; cin >> t;
    if(t == 0) {
      int u, v; cin >> u >> v;
      uf.merge(u, v);
    } else {
      cout << uf.same(u, v) << endl;
    };
  }

  return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
typedef long long ll;
int main() {
	int N, Q;
	cin >> N >> Q;
	dsu d(N);
	for (int i = 0; i < Q; ++ i) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t == 0) {
			d.merge(u, v);
		} else {
			cout << (d.same(u, v) ? 1 : 0) << endl;
		}
	}
}


Compiler output:
a.cc:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>
#include <cassert>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;
typedef long long ll;

int main()
{
   int N, Q;
   cin >> N >> Q;
   dsu d(N);
   for (int i = 0; i < Q; i++)
   {
      int t, u, v;
      cin >> t >> u >> v;
      if (t == 0)
         d.merge(u, v);
      else
         cout << (d.same(u, v) ? 1 : 0) << endl;
   }

   return 0;
}


Compiler output:
a.cc:22:10: fatal error: atcoder/dsu: No such file or directory
   22 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << "\n"

void solve(){
    ll N,Q;
    cin >> N >> Q;
    dsu d(N+1);
    while(Q--){
        ll t,u,v;
        cin >> t >> u >> v;
        if(t == 0){
            d.merge(u,v);
        }else{
            print(d.same(u,v));
        }
    }



}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}

Compiler output:
a.cc:4:17: error: 'atcoder' is not a namespace-name
    4 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'void solve()':
a.cc:20:5: error: 'dsu' was not declared in this scope
   20 |     dsu d(N+1);
      |     ^~~
a.cc:25:13: error: 'd' was not declared in this scope
   25 |             d.merge(u,v);
      |             ^
a.cc:27:19: error: 'd' was not declared in this scope
   27 |             print(d.same(u,v));
      |                   ^
Language: C++

#include<atcoder/all>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
using namespace atcoder;

#define ll long long
#define pal pair<ll,ll>
#define pad pair<double,double>
#define PB push_back
#define MP make_pair
#define F first
#define S second



int main(){
    ll n,q;
    cin >> n >>q;
    dsu d(n);
    for(ll i=0;i<q;i++){
        ll a,b,c;
        cin >> a >> b >> c;
        if(a==1){
            cout << d.same(b,c) << endl;
        }else{
            d.merge(b,c);
        }
    }
}

Compiler output:
a.cc:1:9: fatal error: atcoder/all: No such file or directory
    1 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long int;
using lc = complex<double>;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    constexpr double PI = acos(-1);
    cout << fixed << setprecision(32);
    cin.tie(0); ios::sync_with_stdio(false);

    ll n, q;
    cin >> n >> q;
    dsu d(n);
    while(q--) {
        ll t, a, b;
        cin >> t >> a >> b;
        if(t)
            cout << d.same(a, b) << endl;
        else
            d.merge(a, b);
    }
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;


void solve()
{
    int n,q,u,v,x;
    cin>>n>>q;
    dsu dsu(n);
    while(q--)
    {
        cin>>x>>u>>v;
        if(x==0)
        {
            dsu.merge(u,v);
        }
        else
        {
            cout<<dsu.same(u,v)<<endl;
            
        }
        
    }
}
int main() {
    int t;
    cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: atcoder/dsu: No such file or directory
    3 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using namespace atcoder;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

signed main(){
    ll N, Q;
    cin >> N >> Q;
    dsu uf(N);
    ll t, u, v;
    REP(i, Q){
        cin >> t >> u >> v;
        if(t == 0) uf.merge(u, v);
        else PRINT(uf.same(u, v));
    }
    return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <atcoder/dsu>

namespace ac = atcoder;

void solve() {
    int n, q;
    std::cin >> n >> q;

    ac::dsu dsu(n);
    while (q--) {
        int t, u, v;
        std::cin >> t >> u >> v;

        switch (t) {
            case 0:
                dsu.merge(u, v);
                break;
            case 1:
                std::cout << dsu.same(u, v) << "\n";
                break;
        }
    }
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


Compiler output:
a.cc:3:10: fatal error: atcoder/dsu: No such file or directory
    3 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.