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

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1ll, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

#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 s, t, u;
		cin >> s >> t >> u;
		if (s == 0)
			d.merge(t, u);
		else {
			if (d.same(t, u))
				cout << 1 << endl;
			else
				cout << 0 << endl;
		}
	}
	return 0;
}

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

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

int main() {
  int N, Q;
  cin >> N >> Q;
  vector<int> t(Q), u(Q), v(Q);
  for (int i = 0; i < Q; ++i) {
    cin >> t[i] >> u[i] >> v[i];
  }

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


Compiler output:
a.cc:1:10: fatal error: atcoder/dsu.hpp: No such file or directory
    1 | #include <atcoder/dsu.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
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:
main.c:1:10: fatal error: atcoder/dsu: No such file or directory
    1 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/dsu>
using namespace std;
using namespace stcoder;
int main(){
    int n, q;
    cin >> n >> q;
    dsu d(n);
    for(int i = 0; i < q; i++){
        int s, t, u;
        cin >> s >> t >> u;
        if(s == 0)
            d.merge(t, u);
        else{
            if(d.same(t, u))
                cout << 1 << endl;
            else 
                cout << 0 << endl;
        }
    }
    return 0;
}

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

#include<bits/stdc++.h>
#include<atcoder/dsu>
int main(){
    int n, q;
    cin >> n >> q;
    dsu d(n);
    for(int i = 0; i < q; i++){
        int s, t, u;
        cin >> s >> t >> u;
        if(s == 0)
            d.merge(t, u);
        else{
            if(d.same(t, u))
                cout << 1 << endl;
            else 
                cout << 0 << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc:2:9: 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;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
const long long INF = 1LL << 60;
const int MOD = 1e9 + 7;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
	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{
			if(d.same(u,v)){
				cout << 1 << endl;
			}else{
				cout << 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

#include <iostream>
using namespace std;

#pragma warning( disable : 4996 )

#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#define ss(s) scanf("%s", &s)
#define pi(n) printf("%d\n", n)
#define pll(n) printf("%lld\n", n)
#define ps(s) printf("%s\n", s)
#define FOR(i, a, b) for (int i=a;i<=b;i++)


typedef long long ll;

int find(int parent[], int i)
{
	if (parent[i] == -1)
		return i;
	return find(parent, parent[i]);
}


void Union(int parent[], int x, int y)
{
	int xset = find(parent, x);
	int yset = find(parent, y);
	if (xset != yset)
	{
		parent[xset] = yset;
	}
}

void solve() {
	int N, Q;
	cin >> N >> Q;
	
	int* parent = new int[N * sizeof(int)];

	memset(parent, -1, sizeof(int) * N);

	while (Q--) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t) {
			if (find(parent, u) == find(parent, v)) {
				cout << 1 << endl;
			}
			else {
				cout << 0 << endl;
			}
		}
		else {
			Union(parent, u, v);
		}
	}
}


int main() {
	solve();
}

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>
using namespace std;

#pragma warning( disable : 4996 )

#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#define ss(s) scanf("%s", &s)
#define pi(n) printf("%d\n", n)
#define pll(n) printf("%lld\n", n)
#define ps(s) printf("%s\n", s)
#define FOR(i, a, b) for (int i=a;i<=b;i++)


typedef long long ll;

int find(int parent[], int i)
{
	if (parent[i] == -1)
		return i;
	return find(parent, parent[i]);
}


void Union(int parent[], int x, int y)
{
	int xset = find(parent, x);
	int yset = find(parent, y);
	if (xset != yset)
	{
		parent[xset] = yset;
	}
}

void solve() {
	int N, Q;
	cin >> N >> Q;
	
	int* parent = new int[N * sizeof(int)];

	memset(parent, -1, sizeof(int) * N);

	while (Q--) {
		int t, u, v;
		cin >> t >> u >> v;
		if (t) {
			if (find(parent, u) == find(parent, v)) {
				cout << 1 << endl;
			}
			else {
				cout << 0 << endl;
			}
		}
		else {
			Union(parent, u, v);
		}
	}
}


int main() {
	solve();
}

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

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

typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define ALL(obj) (obj).begin(), (obj).end()
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; }

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


int main() {
    cout<<fixed<<setprecision(10);

    int n,q; cin>>n>>q;
    dsu d(n);

    rep(_,q){
        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 <bits/stdc++.h>
using namespace std;
#include <atcoder/dsu>
using namespace atcoder;
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(){
  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{
      if(d.same(u, v)) cout<<1<<endl;
      else cout<<0<<endl;
    }
  }
  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/dsu>

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

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size())

#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange

#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

void solve() {
    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
        {
            if (d.same(u, v))
            {
                cout << 1 << endl;
            }
            else
            {
                cout << 0 << endl;
            }

        }
    }
}

int main() {
    solve();
    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/all>

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

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size())

#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange

#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

void solve() {
    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
        {
            if (d.same(u, v))
            {
                cout << 1 << endl;
            }
            else
            {
                cout << 0 << endl;
            }
            
        }
    }
}

int main() {
    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>
#include <cstdio>
#define dump(x) cerr << #x << "=" << (x) << endl;
using namespace std;
using namespace atcoder;
const int INF = (int)2e9 + 1;
const long long LINF = (long long)9e18 + 1;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    int n, q;
    cin >> n;
    cin >> q;
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        cin >> t;
        cin >> u;
        cin >> 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 <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#include <atcoder/all>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;

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

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

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

	return 0;
}

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

#include <bits/stdc++.h>
#include <atcoder/all>
using Int = long long;  // clang-format off
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Sun Sep 13 18:35:58 JST 2020
 **/

signed main() {
    Int n, Q;
    std::cin >> n >> Q;
    atcoder::dsu uf(n);
    REP(q, Q) {
        Int t, u, v;
        std::cin >> t >> u >> v;
        if (t == 0) {
            uf.merge(u, v);
        } else {
            std::cout << uf.same(u, v) << "\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/all>
using namespace atcoder;
using namespace std;
#ifdef _DEBUG
  #include "_DEBUG.hpp"
#endif
#define int long long
const int INF = 1LL << 60;
const int MOD = 1e9 + 7;

signed main(){

  int n, q; cin >> n >> q;
  dsu uf(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:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
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 <bits/stdc++.h>
#include <atcoder/all>
#define dump(x) cerr << #x << "=" << (x) << endl;
using namespace std;
using namespace atcoder;
const int INF = (int)2e9 + 1;
const long long LINF = (long long)9e18 + 1;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    int n, q;
    cin >> n;
    cin >> q;
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        cin >> t;
        cin >> u;
        cin >> 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 <atcoder/dsu>

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

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

#include <stdio.h>
#include <iostream>
#include <fstream>
#include <atcoder/dsu>

using std::cin;
using std::cout;
using std::endl;
using std::terminate;
using atcoder::dsu;

void solve() {
    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) {
            cout << (d.same(u, v) ? 1 : 0) << endl;
        } else {
            //
        }
    }
}

int main() {

#ifdef DEV
    std::ifstream in("input");
    cin.rdbuf(in.rdbuf());

    int t; cin >> t;
    for (int x = 1; x <= t; ++x) {
        solve();
    }
#else
    solve();
#endif

    return 0;
}


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

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

using namespace std;
using namespace atcoder;
using usize = ::std::size_t;
using u64 = ::std::int_least64_t;
//using u64 = long long;
static constexpr u64 Inf = ::std::numeric_limits<u64>::max() / 2;


int main(int argc, char *argv[])
{
    std::ifstream in("in.txt");
    std::cin.rdbuf(in.rdbuf());
    
    cin.tie(0) ;
    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) {
            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++

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

using namespace std;
using namespace atcoder;
using usize = ::std::size_t;
using u64 = ::std::int_least64_t;
//using u64 = long long;
static constexpr u64 Inf = ::std::numeric_limits<u64>::max() / 2;


int main(int argc, char *argv[])
{
    
    
    cin.tie(0) ;
    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) {
            d.merge(u, v);
        } else {
            cout << (d.same(u, v) ? 1 : 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 <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
using namespace std;

int main()
{
    int N, Q;
    cin >> N >> Q;
    dus t(N);
    rep(_, Q) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t == 0) {
            t.merge(u, v);
        } else if (t == 1) {
            if (t.same(u, v)) {
                cout << "1" << '\n';
            } else {
                cout << "0" << '\n';
            }
        }
    }
    cout << endl;
    return 0;
}


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

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <atcoder/all>
#include <cstdio>
using namespace atcoder;
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){ 
    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{
            if(d.same(u, v))cout << "1" << ln;
            else cout << "0" << ln;
        }
    }
}

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 STRING(str) #str

template <typename T >
void print_vec_1d(vector<T> x, string name) {
	cout << name << endl;
	cout << "[ ";
	for (int i=0;i<x.size();i++) {
		cout << x[i];
		if (i != x.size()-1) cout << ", ";
		else cout << " ]" << endl;
	}
}

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 { // t == 1
			cout << d.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++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include "atcoder/dsu.hpp"

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace atcoder;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 3000000;
const int K = 100000;
const int mod = 1e9 + 7;
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    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) << endl;
        }
    }
}


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

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

struct dsu {
  public:
    dsu() : _n(0) {}
    dsu(int n) : _n(n), parent_or_size(n, -1) {}

    int merge(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        int x = leader(a), y = leader(b);
        if (x == y) return x;
        if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y);
        parent_or_size[x] += parent_or_size[y];
        parent_or_size[y] = x;
        return x;
    }

    bool same(int a, int b) {
        assert(0 <= a && a < _n);
        assert(0 <= b && b < _n);
        return leader(a) == leader(b);
    }

    int leader(int a) {
        assert(0 <= a && a < _n);
        if (parent_or_size[a] < 0) return a;
        return parent_or_size[a] = leader(parent_or_size[a]);
    }

    int size(int a) {
        assert(0 <= a && a < _n);
        return -parent_or_size[leader(a)];
    }

    std::vector<std::vector<int>> groups() {
        std::vector<int> leader_buf(_n), group_size(_n);
        for (int i = 0; i < _n; i++) {
            leader_buf[i] = leader(i);
            group_size[leader_buf[i]]++;
        }
        std::vector<std::vector<int>> result(_n);
        for (int i = 0; i < _n; i++) {
            result[i].reserve(group_size[i]);
        }
        for (int i = 0; i < _n; i++) {
            result[leader_buf[i]].push_back(i);
        }
        result.erase(
            std::remove_if(result.begin(), result.end(),
                           [&](const std::vector<int>& v) { return v.empty(); }),
            result.end());
        return result;
    }

  private:
    int _n;
    std::vector<int> parent_or_size;
};

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)) {
				cout<<1<<endl;
            } else {
                cout<<0<<endl;
            }
        }
    }
    return 0;
}

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

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

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 <atcoder/dsu>
#include <bits/stdc++.h>
 
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:1:10: fatal error: atcoder/dsu: No such file or directory
    1 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/dsu>
#include <bits/stdc++.h>
 
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:1:10: fatal error: atcoder/dsu: No such file or directory
    1 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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:1:10: fatal error: atcoder/dsu: No such file or directory
    1 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>
//#include <atcoder/dsu>
using ll=long long;
using namespace std;
//using namespace atcoder;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'dsu' was not declared in this scope
   12 |     dsu d(N);
      |     ^~~
a.cc:17:16: error: 'd' was not declared in this scope
   17 |             if(d.same(b,c)){
      |                ^
a.cc:23:13: error: 'd' was not declared in this scope
   23 |             d.merge(b,c);
      |             ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
//#include <atcoder/dsu>
using ll=long long;
using namespace std;
using namespace atcoder;

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

    return 0;
}

Compiler output:
a.cc:7:17: error: 'atcoder' is not a namespace-name
    7 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'dsu' was not declared in this scope
   12 |     dsu d(N);
      |     ^~~
a.cc:17:16: error: 'd' was not declared in this scope
   17 |             if(d.same(b,c)){
      |                ^
a.cc:23:13: error: 'd' was not declared in this scope
   23 |             d.merge(b,c);
      |             ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <atcoder/dsu>
using ll=long long;
using namespace std;
using namespace atcoder;

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

    return 0;
}

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

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

using namespace std;

using i64 = long long;

const i64 MOD = i64(1e9) + 7;
const i64 INF = i64(1e18) + 7;


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

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

signed main(){
    using atcoder::dsu;
    int n, q;
    cin >> n >> q;
    dsu uf(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;
    }
}



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

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

using namespace std;

using i64 = long long;

const i64 MOD = i64(1e9) + 7;
const i64 INF = i64(1e18) + 7;


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

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

signed main(){
    using atcoder::dsu;
    int n, q;
    cin >> n >> q;
    dsu uf(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;
    }
}



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 REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
using namespace atcoder;

int main(){
    int n,q;
    std::cin >> n >> q;
    fenwick_tree<ll> fw(int n);
    REP(i,n){
        int input;
        std::cin >> input;
        fw.add(i,input);
    }
    REP(i,q){
        int f,p,x;
        std::cin >> f >> p >> x;
        if(f==0){
            fw.add(p,x);
        }
        else{
            std::cout << fw.sum(p,x) << 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<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const ll MOD=1000000007;
const ll LINF=1ll<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};


int main(){
    int n,q;cin >> n >> q;
    auto uf = dsu(n);
    while(q--){
        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: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;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


int main(){
    ll n, q;
    cin >> n >> q;

    dsu d(n);
    REP(_, q){
        ll t, u, v;
        cin >> t >> u >> v;
        if(t == 0){
            d.merge(u, v);
        }else{
            cout << (int)(d.same(u, v)) << 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 <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
#define INFL 0x6fffffffffffffffLL

int main() {
	ll		a,b,c,w,h,i,j,k,l,m,n,q,x,y,z,t,u,v;
	ll		ans = 0;
	string	s;
	cin >> n >> q;
	//vector<ll>	aa(n);
	//for(i=0;i<n;i++) cin >> aa[i];
	//vector<ll>	dp(n+1,INFL);
	//vector<vector<ll>>	dp2(x , vector<ll>(y,INFL));
	dsu d(n);
	for(i=0;i<q;i++) {
		cin >> t >> u >> v;
		if (t==0) {
			d.merge(u,v);
		} else {
			if (d.same(u,v)) {
				cout << 1 << endl;
			} else {
				cout << 0 << endl;
			}
		}
	}
	//cout << ans << endl;
	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 <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
#define INFL 0x6fffffffffffffffLL

int main() {
	ll		a,b,c,w,h,i,j,k,l,m,n,q,x,y,z,t,u,v;
	ll		ans = 0;
	string	s;
	cin >> n >> q;
	//vector<ll>	aa(n);
	//for(i=0;i<n;i++) cin >> aa[i];
	//vector<ll>	dp(n+1,INFL);
	//vector<vector<ll>>	dp2(x , vector<ll>(y,INFL));
	dsu d(n);
	for(i=0;i<q;i++) {
		cin >> t >> u >> v;
		if (t==0) {
			d.merge(u,v);
		} else {
			if (d.same(u,v)) {
				cout << 1 << endl;
			} else {
				cout << 0 << endl;
			}
		}
	}
	//cout << ans << endl;
	return 0;
}


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 <atcoder/all>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

using namespace std;
using namespace atcoder;

using ll = long long;
using P = pair<int,int>;
constexpr int INF = 1001001001;

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 (a>b) { a=b; return 1; } return 0; }

int main() {
    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;
    }
    
    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 <atcoder/dsu>
#include "bits/stdc++.h"
using namespace std;
using namespace atcoder;

const int N=2e5+20;

int n,q,t,u,v,c;

int main()
{
	scanf("%d%d",&n,&q);
	auto dsa=dsu(n);
	while(q--)
	{
		scanf("%d%d%d",&t,&u,&v);
		if(t==0) dsa.merge(u,v);
		else printf("%d\n",dsa.same(u,v));
	}
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <atcoder/all>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define endl '\n'
#define debug(x) std::cerr << #x << " = " << (x) << endl;

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll N, Q;

int main() {
  std::cin >> N >> Q;

  atcoder::dsu dsu(N+10);

  rep( q, Q ) {
    ll t, u, v;
    std::cin >> t >> u >> v;

    if( !t ) {
      dsu.merge( u, v );
    } else {
      std::cout << dsu.same( u, v ) << endl;
    }
  }

  return 0;
}

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

#include <bits/stdc++.h>
#include <atcoder/all>
//g++ main.cpp -std=c++14

using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw`(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
template<class T> bool isIn(T a,vector<T> v){ for(T x:v){ if(a==x){return true;}} return false;}
string strReplace(string s,string target, string replacement){
    if (!target.empty()) {
      std::string::size_type pos = 0;
      while ((pos = s.find(target, pos)) != std::string::npos) {
        s.replace(pos, target.length(), replacement);
        pos += replacement.length();
      }
    }
    return s;
}
const ll MOD = 1e9+7;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair

bool DEBUG = 0;
template<class T> void dprint(T s){
  if(DEBUG){ cout << s << "\n"; }
}
const ll MAX = MOD;

void solve(){
  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) << "\n";
    }
  }
}

int main(int argc, char *argv[]){
  if(argc>1 && argv[1][0]=='D'){ DEBUG = 1;}
  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/dsu>
using namespace std;
using namespace atcoder;

int main(){
  int n; cin >> n;
  dsu uf(n);
  for(int i=0; i<q; i++){
    int t; cin >> t;
    int a,b; cin >> a >> b;
    a--;
    b--;
    if(t == 0){
      uf.merge(a,b);
    }else{
      cout << uf.same(a,b) << 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 <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;

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


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

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

int main(){
  int n; cin >> n;
  dsu uf(n);
  for(int i=0; i<q; i++){
    int t; cin >> t;
    int a,b; cin >> a >> b;
    a--;
    b--;
    if(t == 0){
      uf.merge(a,b);
    }else{
      cout << uf.same(a,b) << 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>
typedef long long lint;
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;
        cin >> t;
        if (t == 0) {
            int u, v;
            cin >> u >> v;
            d.merge(u, v);
        } else {
            int u, v;
            cin >> u >> v;
            int ans = d.same(u, v) ? 1 : 0;
            cout << ans << 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 <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll solve() {
    ll N, Q;
    cin >> N >> Q;
    int t , u , v;
    atcoder::dsu d(N);
    vector<int> ans;
    for ( int i = 0; i < Q; i++ ) {
        cin >> t >> u >> v;
        if ( t == 0 ) {
            d.merge(u,v);
        } else {
            int x = d.same(u,v) ? 1 : 0;
            ans.push_back(x);
        }
    }
    for ( int i = 0; i < ans.size(); i++ ) {
        cout << ans[i] << "\n";
    }

    return 0;
}

int main() {
    solve();
    return 0;
}

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