criyle/codenet-compile-errors huggingface dataset:
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++)
typedef pair<int,int> P;
typedef long long ll;



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: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;
#define rep(i,n) for (int i = 0; i < (n); i++)
typedef pair<int,int> P;
typedef long long ll;



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:4:17: error: 'atcoder' is not a namespace-name
    4 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'dsu' was not declared in this scope
   14 |     dsu d(n);
      |     ^~~
a.cc:19:13: error: 'd' was not declared in this scope
   19 |             d.merge(u, v);
      |             ^
a.cc:21:17: error: 'd' was not declared in this scope
   21 |             if (d.same(u, v)) {
      |                 ^
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); i++)
typedef pair<int,int> P;
typedef long long ll;



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: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>
typedef long long int ll;
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:2:10: fatal error: atcoder/dsu: No such file or directory
    2 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

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

using namespace std;

int main(){
    int N,Q;
    cin >> N >> Q;
    int query[Q][3];
    for(int i = 0; i < Q; i++){
        cin >> query[i][0]  >> query[i][1] >> query[i][2];
    }
    atcoder::dsu d(N);
    for(int i = 0; i < Q; i++){
        int u = query[i][1];
        int v = query[i][2];
        if(query[i][0] == 0){
            d.merge(u, v);
        }
        else{
            cout << d.same(u, v) << endl;
        }         
    }  
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
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 <atcoder/dsu>
#include <iostream>

using namespace std;
using namespace atcoder;

int main(){
    int N,Q;
    cin >> N >> Q;
    int query[Q][3];
    for(int i = 0; i < Q; i++){
        cin >> query[i][0]  >> query[i][1] >> query[i][2];
    }
    dsu d(N);
    for(int i = 0; i < Q; i++){
        int u = query[i][1];
        int v = query[i][2];
        if(query[i][0] == 0){
            d.merge(u, v);
        }
        else{
            if(d.same(u, v)) cout << 1 << endl;
            else cout << 0 << 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 <atcoder/dsu>
using namespace std;
using namespace atcoder;

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

Compiler output:
a.cc:4:17: error: 'atcoder' is not a namespace-name
    4 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'dsu' was not declared in this scope
   13 |     dsu d(N);
      |     ^~~
a.cc:18:13: error: 'd' was not declared in this scope
   18 |             d.merge(u, v);
      |             ^
a.cc:21:16: error: 'd' was not declared in this scope
   21 |             if(d.same(u, v)) cout << 1 << endl;
      |                ^
Language: C++

#include <iostream>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;

int main(){
    int N,Q;
    cin >> N >> Q;
    int query[Q][3];
    for(int i = 0; i < Q; i++){
        cin >> query[i][0]  >> query[i][1] >> query[i][2];
    }
    dsu d(N);
    for(int i = 0; i < Q; i++){
        int u = query[i][1];
        int v = query[i][2];
        if(query[i][0] == 0){
            d.merge(u, v);
        }
        else{
            if(d.same(u, v)) cout << 1 << endl;
            else cout << 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 <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF INT32_MAX / 2
#define PIE 3.14159265358979323

template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
//#define int long long

#include <atcoder/dsu>

signed main() {
    int n, q, t, u, v;
    cin >> n >> q;
    atcoder::dsu d(n);
    while (q--) {
        cin >> t >> u >> v;
        if (!t) {
            d.merge(u, v);
        }
        cout << d.same(u, v) << endl;
    }
}

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

#include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF INT32_MAX / 2
#define PIE 3.14159265358979323

template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
//#define int long long

#include <atcoder/dsu.hpp>

signed main() {
    int n, q, t, u, v;
    cin >> n >> q;
    atcoder::dsu d(n);
    while (q--) {
        cin >> t >> u >> v;
        if (!t) {
            d.merge(u, v);
        }
        cout << d.same(u, v) << endl;
    }
}

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

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

using ll = long long;
using ld = long double;
const int INF = 1e9+100;
const ll INF64 = 7e18l;
const int mod = 1000000007;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(), (a).end()
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);


int main(){
    FIN;
    ll n,q;
    cin >> n >> q;
    dsu d(n);
    for(ll i=0;i<n;i++){
        ll t,u,v;
        cin >> t >> u >> v;
        if(t == 1) d.merge(u,v);
        else cout << d.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>

#ifndef ONLINE_JUDGE
#include <atcoder/all>
#endif

#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using namespace atcoder;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

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

  dsu d(n);
  rep(i, q) {
    int query, v1, v2;
    cin >> query >> v1 >> v2;
    if (query == 0) {
      d.merge(v1, v2);
    } else {
      bool same = d.same(v1, v2);
      cout << ((same) ? "1" : "0") << endl;
    }
  }
}


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

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using namespace atcoder;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

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

  dsu d(n);
  rep(i, q) {
    int query, v1, v2;
    cin >> query >> v1 >> v2;
    if (query == 0) {
      d.merge(v1, v2);
    } else {
      bool same = d.same(v1, v2);
      cout << ((same) ? "1" : "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 <bits/stdc++.h>

#include "atcoder/dsu.hpp"

#define LOG(FMT...) fprintf(stderr, FMT)

#define fir first
#define sec second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

ostream& operator<<(ostream& os, const pair<char, int>& unit) {
  return os << unit.first << "^" << unit.second;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

int main() {
#ifdef ELEGIA
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

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

#ifdef ELEGIA
  LOG("Time: %dms\n", int ((clock()
      -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}



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

// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>
#include <atcoder/dsu>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;
namespace ac = atcoder;

int main() {
    int n,q; cin >> n >> q;
    ac::dsu uf(n);
    rip(i,q,0) {
        int id, u, v; cin >> id >> u >> v;
        if(id == 0) {
            uf.merge(u, v);
        }
        else  {
            if(uf.same(u,v)) {
                printf("1\n");
            }
            else {
                printf("0\n");
            }
        }
    }
}

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

import java.util.*;
public class DisjointSetUnion {
static Scanner scan=new Scanner(System.in);
static int id[];


public DisjointSetUnion() {
	
}
static void connect(int u,int v){
	int i = root(u);
	int j = root(v);
	id[i] = j;
	
}

static int root(int i) {
	while(i!=id[i]) {
		i=id[i];
		
	}
	return i;
}
static int connected(int u,int v){
	if( root(u)==root(v))
		return 1;
	else return 0;
}
	public static void main(String[] args) {
	//	int isconetted[]=new int [1000];
		id = new int[1000];
		for (int i = 0; i < 1000; i++) id[i] = i;		
int n=scan.nextInt(),Q=scan.nextInt();
int i=0;
while(i!=Q) {
	int q=scan.nextInt();
int u=scan.nextInt();
int v=scan.nextInt();
if(q==0) 
	connect(u, v);
	else if(q==1)
	System.out.println(connected(u, v));
	
i++;
}
/*for(int j=0;j<isconetted.length;j++)
{
System.out.println(isconetted[j]);	
}
	}
*/
}}


Compiler output:
Main.java:2: error: class DisjointSetUnion is public, should be declared in a file named DisjointSetUnion.java
public class DisjointSetUnion {
       ^
1 error
Language: Java

import java.util.*;
public class Disjointsets {
static Scanner scan=new Scanner(System.in);
static int id[];


public Disjointsets() {
	
}
static void connect(int u,int v){
	int i = root(u);
	int j = root(v);
	id[i] = j;
	
}

static int root(int i) {
	while(i!=id[i]) {
		i=id[i];
		
	}
	return i;
}
static int connected(int u,int v){
	if( root(u)==root(v))
		return 1;
	else return 0;
}
	public static void main(String[] args) {
	//	int isconetted[]=new int [1000];
		id = new int[1000];
		for (int i = 0; i < 1000; i++) id[i] = i;		
int n=scan.nextInt(),Q=scan.nextInt();
int i=0;
while(i!=Q) {
	int q=scan.nextInt();
int u=scan.nextInt();
int v=scan.nextInt();
if(q==0) 
	connect(u, v);
	else if(q==1)
	System.out.println(connected(u, v));
	
i++;
}
/*for(int j=0;j<isconetted.length;j++)
{
System.out.println(isconetted[j]);	
}
	}
*/
}}


Compiler output:
Main.java:2: error: class Disjointsets is public, should be declared in a file named Disjointsets.java
public class Disjointsets {
       ^
1 error
Language: C++

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

using namespace std;

using namespace atcoder;
int main(){
  
  
  int n;
  cin>>n;
  int q;
  cin>>q;
  dsu d(n);
  while( q--){
   
    int a;
    if(a==1){
      
      int b,c;
      cin>>b>>c;
      d.merger(b,c);
      
      
    }
    else{
      
      int b,c;
      cin>>b>>c;
      if(d.same(b,c)){
        
       cout<<1<<endl; 
      }
      else{
        cout<<0<<endl;
      }
      
    }
    
    
    
    
  }
  
  
  
}

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

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

using namespace std;

using namespace atcoder;
int main(){
  
  
  int n;
  cin>>n;
  int q;
  cin>>q;
  dsu d(n);
  while( q--){
   
    int a;
    if(a==1){
      
      int b,c;
      cin>>b>>c;
      d.merger(b,c);
      
      
    }
    else{
      
      int b,c;
      cin>>b>>c;
      if(d.same(b,c)){
        
       cout<<1<<endl; 
      }
      else{
        cout<<0<<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<atcoder/all>
using namespace std;
const int N=1e6+3;
int par[N];
int sz[N];
int findRoot(int u){
  while(u!=par[u]){
    u=par[u];
  }
  return u;
}
void merge(int u,int v){
  int Pu = findRoot(u);
  int Pv = findRoot(v);
  if(Pu==Pv)return;
  if(sz[Pu]>=sz[Pv]){
    par[Pv]=Pu;
    sz[Pu]+=sz[Pv];
  }else{
    par[Pu]=Pv;
    sz[Pv]+=sz[Pu];
  }
}
void solve(){
  int n,Q;cin>>n>>Q;
  for(int i=0;i<n;++i){
    par[i]=i;
    sz[i]=1;
  }
  while(Q--){
    int t,u,v;cin>>t>>u>>v;
    if(t==0){//merge
      merge(u,v);
    }else{
      int Pu=findRoot(u);
      int Pv=findRoot(v);
      if(Pu==Pv)cout<<"1"<<endl;
      else cout<<"0"<<endl;
    }
  }
}
int main(){
  solve();
  return 99;
}


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>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define endl "\n"
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
using LD = long double;
using VI = vector<int>;
using VVI = vector<vector<int> >;
using PII = pair<int, int>;
template <typename T> using V = vector<T>;
template <typename T> using VV = vector<vector<T> >;
template <typename T> using VVV = vector<vector<vector<T> > >;
void print() {cout << endl;}
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <typename T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <typename T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template <typename T> void SORT (T &v) {sort(v.begin(), v.end());}
template <typename T> void SORTR (T &v) {sort(v.begin(), v.end(), greater<>());}
template <typename T> T GCD(T x,T y) {return __gcd(x,y);}
template <typename T> T LCM(T x,T y) {return x/__gcd(x,y)*y;}
template <typename T> int SZ(T v) {return v.size();}
template <typename T> T PCNT(T x) {return __builtin_popcountll(x);}
template <typename T> T BIT(T x) {return 1LL<<(x);}
int INF = 2000000000;
long double PI = acosl(-1);
int MOD = 1000000007;


int32_t main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int ans = 0;

    
    
    int N, Q;
    cin >> N >> Q;
    atcoder::dsu dsu(N);
    vector<int> t(Q), u(Q), v(Q);
    REP (i, Q) {
        cin >> t[i] >> u[i] >> v[i];
        if (t[i] == 0) dsu.merge(u[i], v[i]);
        else cout << dsu.same(u[i], v[i]) << endl;
    }


    
    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/practice2/practice2_a && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/practice2/practice2_a && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/practice2/practice2_a && sh shellscripts/submit_cpp.sh
*/


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;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int n, q;
  cin >> n >> q;
  fenwick_tree<ll> fw(n);
  rep(i,n) {
    ll a;
    cin >> a;
    fw.add(i,a);
  }
  rep(i,q) {
    int t, x, y;
    cin >> t >> x >> y;
    if(t == 0) fw.add(x,y);
    else cout << fw.sum(l,r) << 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>

#include <atcoder/dsu>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int, int>;

class Main {
    int N, Q;
    void input() { cin >> N >> Q; }
    void output() {
        dsu d(N);
        REP(q, Q) {
            int t, u, v;
            cin >> t >> u >> v;
            if (t == 0) {
                d.merge(u, v);
            } else {
                cout << d.same(u, v) << endl;
            }
        }
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    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, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int, int>;

class Main {
    int N, Q;
    void input() { cin >> N >> Q; }
    void output() {
        dsu d(N);
        REP(q, Q) {
            int t, u, v;
            cin >> t >> u >> v;
            if (t == 0) {
                d.merge(u, v);
            } else {
                cout << d.same(u, v) << endl;
            }
        }
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    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 <atcoder/dsu>
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, q;
  scanf("%d %d", &n, &q);

  atcoder::dsu dsu(n);
  while (q--) {
    int t, u, v;
    scanf("%d %d %d", &t, &u, &v);

    if (t == 0) {
      dsu.merge(u, v);
    } else if (t == 1) {
      printf("%d\n", (int) dsu.same(u, v));
    }
  }  
  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>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,q;
    cin >> n >> q;
    dsu uf(n);
    rep(i,q){
        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: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>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
using namespace atcoder;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  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;
      }
    }
  }
}

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;

int main()
{
    int N, Q;
    cin >> N >> Q;
    dsu g(N);
    int ti, ui, vi;
    vector<int> res;
    for(int i=0;i<Q;i++){
        cin >> ti >> ui >> vi;
        if(ti == 0){
            g.merge(ui, vi);
        }else if(ti == 1){
            res.push_back(g.same(ui, vi));
        }else{
            abort();
        }
    }
    for(auto v : res) cout << 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 <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
int main() {
    int N,Q;
    cin >> N >> Q;
    dsu uf(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;
        }
    }
}

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 (int i = 0; i < (n); ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int,int>;

int main(){
	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 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++

// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
#include<atcoder/dsu>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
signed main(){
  init_io();
  int n,q;
  cin >> n >> q;
  atcoder::dsu d(n);
  for(int i=0;i<q;i++){
    ll t,u,v;
    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:11:9: fatal error: atcoder/dsu: No such file or directory
   11 | #include<atcoder/dsu>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <atcoder/dsu>

#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
//#define inf 2000000000
#define inf 8000000000000000000
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#define ykh mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;
using namespace atcoder;

const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod;
const int maxn=200005;
//i_am_noob
int n,q,x,u,v;
dsu d(maxn);

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    cin >> n >> q;
    while(q--){
        cin >> x >> u >> v;
        if(!x) d.merge(u,v);
        else print1(d.same(u,v));
    }
    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 <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n, q, i, ans[200100]={0}, cnt=0;
    cin >> n >> q;
    atcoder :: dsu d(n);
    for(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)){
            ans[cnt]=1;
            cnt++;
        }
        else{
            ans[cnt]=0;
            cnt++;
        }
    }
    for(i=0;i<cnt;i++){
        cout << ans[i] <<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 <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

int main()
{
    int N, Q;
    cin >> N >> Q;
    dsu disjoint(N);
    for (int i = 0; i < Q; ++i) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t == 0) 
            disjoint.merge(u, v);
        if (t == 1)
            cout << (disjoint.same(u, v) ? 1 : 0) << 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;

int main() {
	int n; cin >> n;
	int q; cin >> 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: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;

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

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

// A - Disjoint Set Union
#include <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;

int 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) cout<< uf.same(u, v) <<endl;
		else uf.merge(u, v);
	}
}


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 all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Rep(n) for (ll _ = 0; _ < (ll)(n); _++)

template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
ll min(int a,ll b){return min((ll)a,b);} ll min(ll a,int b){return min(a,(ll)b);}

#define PRINT_VECTOR_MAX 100
template <class S> void print(vector<S> &v){for(ll i=0; i<(ll)min(v.size(),PRINT_VECTOR_MAX); i++){cerr << v[i] << ' ';}cerr << endl;}
template <class S> void print(vector<vector<S>> &v) {for (ll i = 0; i < (ll)min(v.size(),PRINT_VECTOR_MAX); i++) {for (ll j = 0; j < (ll)min(v[i].size(),PRINT_VECTOR_MAX); j++) {cerr << v[i][j] << ' ';}cerr << endl;}}

void Main();
int main(){
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	Main();
	return 0;
}

void Main(){
	int n, q; cin >> n >> q;
	dsu graph(n);
	Rep(q){
		int t,u,v; cin >> t >> u >> v;
		if(t == 0){
			graph.merge(u, v);
		}else{
			cout << (int)(graph.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>
using namespace std;

int n,m;
int data[200005];
int op,u,v;
/*
 4 7
 1 0 1
 0 0 1
 0 2 3
 1 0 1
 1 1 2
 0 0 2
 1 1 3
 */

int find(int u){
    if(data[u]<0) return u;
    return data[u]=find(data[u]);
}

bool union_join(int u, int v){
    int a=find(u);
    int b=find(v);
    if(a==b) return false;
    if(a>b)swap(a, b);
    data[a]+=data[b];
    data[b]=a;
    return true;
}

bool same_set(int u, int v){
    return find(u)==find(v);
}

int main() {
    cin>>n>>m;
    memset(data, -1, sizeof(data));
    while(m--){
        cin>>op>>u>>v;
        if(op==0){
            union_join(u, v);
        }else{
            if(same_set(u, v)) cout<<1<<endl;
            else cout<<0<<endl;
        }
    }
    return 0;
}


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

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

using namespace std;

int main(){
    int N, Q; cin >> N >> Q;
    atcoder::dsu d(N);
    for(int _=0;_<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++

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

int main(){
    int n, q; cin >> n >> q;
    dsu data(n);
    while (q--) {
        int t, u, v; cin >> t >> u >> v;
        if (t) cout << (data.same(u,v) ? 1 : 0) << "\n";
        else data.merge(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 <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<pair<int,ll>>>;
using pp=pair<ll,pair<ll,ll>>;
#define MAX 1000000
#define MOD 1000000007
#define INF 1000000000000000000

vector<int> parent;
int find(int x){
  int y=parent[x];
  while(y!=parent[y]){
    y=find(y);
  }
  return parent[x]=y;
}

void unite(int a,int b){
  int x=find(a);
  int y=find(b);
  if(x!=y){
    parent[x]=y;
  }
}

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

  parent.resize(N);
  for(int i=0;i<N;i++){
    parent[i]=i;
  }

  for(int i=0;i<Q;i++){
    int t,u,v;
    cin>>t>>u>>v;
    if(t==0){
      unite(u,v);
    }else{
      if(find(u)==find(v)){
        cout<<1<<endl;
      }else{
        cout<<0<<endl;
      }
    }
  }
}


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/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;
    u--;v--;
    if(t==0){
      d.merge(u,v);
    }else{
      if(d.same(u,v)){
        cout<<1<<endl;
      }else{
        cout<<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;
    u--;v--;
    if(t==0){
      d.merge(u,v);
    }else{
      if(d.same(u,v)){
        cout<<1<<endl;
      }else{
        cout<<0<<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/dsu>
using namespace std;

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

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;
    u--;v--;
    if(t==0){
      d.merge(u,v);
    }else{
      if(d.same(u,v)){
        cout<<1<<endl;
      }else{
        cout<<0<<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 int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
using namespace atcoder;

signed main(){
	fastio
	int n, q;
	cin >> n >> q;
	dsu d(n);
	while(q--){
		int a,b,c;
		cin >> a >> b >> c;
		if(a==0) d.merge(b,c);
		else{
			cout << d.same(b,c) << "\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 int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
using namespace atcoder;

signed main(){
	fastio
	int n, q;
	cin >> n >> q;
	dsu d(n);
	while(q--){
		int a,b,c;
		cin >> a >> b >> c;
		if(a==0) d.merge(b,c);
		else{
			cout << d.same(b,c) << "\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 <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>
#include <atcoder/dsu>
 
using namespace std;
using namespace __gnu_pbds;
using namespace atcoder
 
#define endl '\n'
 
typedef long long ll;
typedef pair<int, int> pii;
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());
 
template<typename T>
static T randint(T lo, T hi){
	return uniform_int_distribution<T>(lo, hi)(rng);
}


int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	// freopen("capastaty_input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

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

	dsu d(n);

	for(int i = 0; i < q; i++){
		int t, a, b;
		cin >> t >> a >> b;

		if(t == 0)
			d.merge(a, b);
		else
			cout << d.same(a, b) << endl;
	}

	return 0;
}


Compiler output:
a.cc:6:10: fatal error: atcoder/dsu: No such file or directory
    6 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
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>
using namespace std;
#pragma region atcoder
#include <atcoder/dsu>
using namespace atcoder;
#pragma endregion
#pragma region macros
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vl = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
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; }
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b){return a / gcd(a, b) * b;}
#pragma endregion
#pragma region debug for var, v, vv
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){cout << endl;int cnt = 0;for(const auto& v : vv){cout << cnt << "th : "; view(v); cnt++;} cout << endl;}
#pragma endregion
const ll mod = 1000000007;
const int inf = 1001001001;
const ll INF = 1001001001001001001;
const int MAX = 2000005;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
    int n; cin >> n;
    dsu tree(n);
    int q; cin >> q;
    while(q--){
        int t, a, b; cin >> t >> a >> b;
        if(t){
            if(tree.same(a, b)) cout << 1 << endl;
            else cout << 0 << endl;
        }
        else{
            tree.unite(a, b);
        }
    }
} 


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