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

#include <bits/stdc++.h>
#include <atcoder/convolution>
#include <atcoder/dsu>
#include <atcoder/fenwicktree>
#include <atcoder/lazysegtree>
#include <atcoder/math>
#include <atcoder/maxflow>
#include <atcoder/mincostflow>
#include <atcoder/modint>
#include <atcoder/scc>
#include <atcoder/segtree>
#include <atcoder/string>
#include <atcoder/twosat>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;


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;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;
using namespace atcoder;

void solve(){
	// ll t1,t2;
	// cin>>t1>>t2;
	// ll a1,a2,b1,b2;
	// cin>>a1>>a2>>b1>>b2;
	// if(a1*t1+a2*t2==b1*t1+b2*t2){
	// 	cout<<"infinity\n";
	// }
	// else if(a1*t1<b1*t1&&a2*t2<b2*t2){
	// 	cout<<0<<"\n";
	// }
	// else if(a1*t1>b1*t1&&a2*t2>b2*t2){
	// 	cout<<0<<"\n";
	// }
	// else{
	// 	ll ans=0;
	// 	ll x=abs(a1-b1)*t1;
	// 	ll y=abs(a1*t1+a2*t2-b1*t1-b2*t2);
	// 	ans+=x/y*2;
	// 	if(x<y)ans=1;
	// 	else if(x%y)++ans;
	// 	cout<<ans<<"\n";
	// }
	int n,q;
	cin>>n>>q;
	dsu tree(n);
	while(q--){
		int t,u,v;
		cin>>t>>u>>v;
		if(t==0)tree.merge(u,v);
		else{
			cout<<tree.same(u,v)<<"\n";
		}
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


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

#include <bits/stdc++.h>
#include <atcoder/dsu>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
using namespace atcoder;

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

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

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

void union(int a, int b, vector <int> &parent, vector <int> &size)
{
  	int p1 = find_parent(a);
  	int p2 = find_parent(b);
  	if (size[p2] > size[p1])
    {
      	size[p2]+=size[p1];
      	parent[p1]=p2;
    }
  	else
    {
      	size[p1]+=size[p2];
      	parent[p2]=p1;
    }
}

int find_parent(int a, vector <int> &parent)
{
  	if (parent[a]==a) return a;
  	return parent[a]=find_parent(parent[a], parent);
}

int main()
{
	int N,Q;
  	cin >> N >> Q;
  	vector <int> parent(N), size(N,1);
  	for (int i=0; i<N; ++i) parent[i]=i;
  	while (Q--)
    {
      	int type, node1, node2;
      	cin >> type >> node1 >> node2;
      	if (type==0) union(node1, node2, parent,size);
      	else cout << (find_parent(node1, parent) == find_parent(node2,parent)) << "\n";
    }
}

Compiler output:
a.cc:4:11: error: expected identifier before '(' token
    4 | void union(int a, int b, vector <int> &parent, vector <int> &size)
      |           ^
a.cc:4:12: error: expected unqualified-id before 'int'
    4 | void union(int a, int b, vector <int> &parent, vector <int> &size)
      |            ^~~
a.cc:4:12: error: expected ')' before 'int'
    4 | void union(int a, int b, vector <int> &parent, vector <int> &size)
      |           ~^~~
      |            )
a.cc: In function 'int main()':
a.cc:36:22: error: expected primary-expression before 'union'
   36 |         if (type==0) union(node1, node2, parent,size);
      |                      ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <atcoder/dsu>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;
using namespace atcoder;

int main(){
  int n, q;
  cin >> n >> q;
  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;
}
  return 0;
}

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

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

int main()
{
	int N,Q;
	cin >> N >> Q;
	atcoder::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 <bits/stdc++.h>
#include <atcoder/dsu>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
using namespace atcoder;

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

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

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;
const int INF = 1e9;
const int MAX = 1e6;
// const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// struct edge {int to, cost;};
// vector<edge> graph[MAX];
// bool visited[MAX];
// int dist[MAX];

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

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

#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;
const int INF = 1e9;
const int MAX = 1e6;
// const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// struct edge {int to, cost;};
// vector<edge> graph[MAX];
// bool visited[MAX];
// int dist[MAX];

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

Compiler output:
a.cc:3:17: error: 'atcoder' is not a namespace-name
    3 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'int main()':
a.cc:23:5: error: 'dsu' was not declared in this scope
   23 |     dsu d(n);
      |     ^~~
a.cc:28:13: error: 'd' was not declared in this scope
   28 |             d.merge(u, v);
      |             ^
a.cc:30:17: error: 'd' was not declared in this scope
   30 |             if (d.same(u, v)) {
      |                 ^
Language: C++

#include<atcoder/dsu.cpp>
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
using namespace atcoder;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;

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; }

__attribute__ ((constructor))
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(10);
}

signed main(){
  int n,q;
  cin >> n >> q;
  dsu uf(n);
  vector<int> ans;
  rep(i,q){
    int t,u,v;
    cin >> t >> u >> v;
    if(t == 0) uf.merge(u,v);
    if(t == 1){
      if(uf.same(u,v)) ans.push_back(1);
      else ans.push_back(0);
    }
  }
  for(auto u : ans) cout << u << endl;
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: atcoder/dsu.cpp: No such file or directory
    1 | #include<atcoder/dsu.cpp>
      |         ^~~~~~~~~~~~~~~~~
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++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;
const int INF = 1e9;
const int MAX = 1e6;
// const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// struct edge {int to, cost;};
// vector<edge> graph[MAX];
// bool visited[MAX];
// int dist[MAX];

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

Compiler output:
a.cc: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 atcoder;
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
const ll mod = 1e9+7;
const ll INF = 1e18;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define Rep(i,a,n) for (ll i = (a); i < (n); ++i)
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
using Graph = vector<vector<ll>>;
using V = vector<ll>;
using P = pair<ll,ll>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  chrono::system_clock::time_point start,end;
  start = chrono::system_clock::now();

  ll n, q;
  cin >> n >> q;
  dsu d(n);
  rep(i,q) {
    ll a, b, c;
    cin >> a >> b >> c;
    if (a == 0) {
      d.marge(b, c);
    } 
    else {
      if (d.same(b, c)) {
        cout << 1 << '\n';
      } 
      else {
        cout << 0 << '\n';
      }
    }
  }

  end = chrono::system_clock::now();
  auto elapsed = chrono::duration_cast< chrono::milliseconds >(end - start).count();
  cerr << elapsed << "ms" << '\n';
}

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

constexpr bool isDebugMode = true;
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long recgcd(T1 a, T2 b){return a % b ? recgcd(b , a % b) : b;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

int main(){
    ll N, Q; cin >> N >> Q;
    dsu g(N);
    rep(i, Q){
        ll q, a, b; cin >> q >> a >> b;
        if(q) g.merge(a, b);
        else pt(g.same(a, b));
    }
    return 0;
}

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

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

using namespace std;
using namespace atcoder;

int main(){
    int n, q;
    cin >> n >> q;
    dsu uf(n);
    rep(i, q){
        int t, u, v;
        cin >> t >> u >> v;
        if(!t)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>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<ll,pair<ll,ll>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'atcoder' has not been declared
   20 |     atcoder::dsu uf(n);
      |     ^~~~~~~
a.cc:24:15: error: 'uf' was not declared in this scope; did you mean 'u'?
   24 |         if(!t)uf.merge(u, v);
      |               ^~
      |               u
a.cc:25:22: error: 'uf' was not declared in this scope; did you mean 'u'?
   25 |         else cout << uf.same(u, v) << endl;
      |                      ^~
      |                      u
Language: C++

#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<ll,pair<ll,ll>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;
using namespace atcoder;

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

Compiler output:
a.cc:16:17: error: 'atcoder' is not a namespace-name
   16 | using namespace atcoder;
      |                 ^~~~~~~
a.cc: In function 'int main()':
a.cc:21:5: error: 'dsu' was not declared in this scope
   21 |     dsu uf(n);
      |     ^~~
a.cc:24:19: error: 'uf' was not declared in this scope; did you mean 'u'?
   24 |         if(t == 1)uf.merge(u, v);
      |                   ^~
      |                   u
a.cc:25:22: error: 'uf' was not declared in this scope; did you mean 'u'?
   25 |         else cout << uf.same(u, v) << endl;
      |                      ^~
      |                      u
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int n,q;
  cin >> n >> q;
  atcoder::dsu uf(n);
  rep(i,q) {
    int t;
    cin >> t;
    int a,b;
    cin >> a >> b;
    if(t) {
      cout << uf.same(a,b) << endl;
    } else {
      uf.merge(a,b);
    }
  }
  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>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 3e5 + 10;
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    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>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<ll,pair<ll,ll>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'dsu' was not declared in this scope
   20 |     dsu uf(n);
      |     ^~~
a.cc:23:19: error: 'uf' was not declared in this scope; did you mean 'u'?
   23 |         if(t == 1)uf.merge(u, v);
      |                   ^~
      |                   u
a.cc:24:22: error: 'uf' was not declared in this scope; did you mean 'u'?
   24 |         else cout << uf.same(u, v) << endl;
      |                      ^~
      |                      u
Language: C++

#include <bits/stdc++.h>
#include<atcoder/dsu>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 3e5 + 10;
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    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 <atcoder/dsu>
#include <iostream>

using namespace std;
using namespace atcoder;

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

using namespace std;
using namespace atcoder;

int main() {
    int n, q;
    cin >>n >> q;
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                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 "bits/stdc++.h"

#include <atcoder/convolution>
#include <atcoder/dsu>
#include <atcoder/fenwicktree>
#include <atcoder/lazysegtree>
#include <atcoder/math>
#include <atcoder/maxflow>
#include <atcoder/mincostflow>
#include <atcoder/modint>
#include <atcoder/scc>
#include <atcoder/segtree>
#include <atcoder/string>
#include <atcoder/twosat>

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

/*
#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
*/
 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-12;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
//#define endl "\n"  //インタラクティブで消す！！！！！！！！！！！！！！！！！！！！！
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=50000;
    rep(y,1,P){
        ll x=mod(y*k);
        
        if(abs(x)<=P||x+P>=i_7){
            if(x+P>=i_7){
                x-=i_7;
            }
            cout<<x<<"/"<<y<<endl;
            //cout<<setprecision(5)<<(dd)x/(dd)y;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
typedef vector<ll> vl;
//////////////////////////

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


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

#include <cstdio>
#include <atcoder/all>
using namespace std;
int main(){
  int a, b,c,d,e;
  cin >> a >> b;
  dsu d(a);
  for(int i = 0;i<b;i++){
    cin >> c >> d >> e;
    if(c==0) d.merge(d, e);
    else{
      if(d.same(d, e))cout << 1;
      else cout << 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 <cstdio>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
int main(){
  int a, b,c,d,e;
  cin >> a >> b;
  dsu d(a);
  for(int i = 0;i<b;i++){
    cin >> c >> d >> e;
    if(c==0) d.merge(d, e);
    else{
      if(d.same(d, e))cout << 1;
      else cout << 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>
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
	int n, q; cin >> n >> q;
	atcoder::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 if (uf.same(u, v)) printf("1\n");
		else printf("0\n");
	}
	return 0;
}


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

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
using vs = vector<string>;
using vb = vector<bool>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
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> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

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) ? 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++

// https://atcoder.jp/contests/practice2/tasks/practice2_a

#include <atcoder/all>

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
template <typename T>
using VV = V<V<T>>;
using VVL = VV<ll>;
template <typename T>
using VVV = VV<V<T>>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
using asc_pq = priority_queue<T, V<T>, greater<T>>;

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>
inline ll len(V<T> arr) {
  return arr.size();
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  ll N, Q;
  cin >> N >> Q;

  dsu d(N);

  rep(i, Q) {
    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:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

// URL : https://atcoder.jp/contests/practice2/tasks/practice2_a
#include <atcoder/all>
using namespace atcoder;
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

signed main() {
    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:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/all>
using namespace std;
int main(){
  int a, b,c,d,e;
  cin >> a >> b;
  dsu d(int a);
  for(int i = 0;i<b;i++){
    cin >> c >> d >> e;
    if(c==0) int d.merge(int d, int e);
    else{
      if(bool d.same(int d, int f))cout << 1;
      else cout << 0;
    }
  }
}
    
  


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

// #define _GLIBCXX_DEBUG
// #pragma GCC optimize("Ofast")
#pragma GCC diagnostic ignored "-Wsign-compare"
#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, n) for (i64 i = 0; i < (i64)(n); ++i)
#define reps(i, s, n) for (i64 i = s; i < (i64)(n); ++i)

void solve() {
    int n, q;
    cin >> n >> q;
    atcoder::dsu d(n);

    int t, u, v;
    while (q--) {
        cin >> t >> u >> v;
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                cout << "1\n";
            } else {
                cout << "0\n";
            }
        }
    }
}
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    // cout << fixed << setprecision(15);
    solve();
}

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

#include <atcode/all>
using namespace std;
int main(){
  int a, b,c,d,e;
  cin >> a >> b;
  dsu d(int a);
  for(int i = 0;i<b;i++){
    cin >> c >> d >> e;
    if(c==0) int d.merge(int d, int e);
    else{
      if(bool d.same(int d, int f))cout << 1;
      else cout << 0;
    }
  }
}
    
  

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

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
using vs = vector<string>;
using vb = vector<bool>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
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> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

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) ? 1 : 0) << endl;
    }
}


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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    atcoder::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) << '\n';
        else uf.merge(u, v);
    }
    return 0;
}


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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    atcoder::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) << '\n';
        else uf.merge(u, v);
    }
    return 0;
}


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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    atcoder::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) << '\n';
        else uf.merge(u, v);
    }
    return 0;
}


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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    atcoder::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) << '\n';
        else uf.merge(u, v);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'atcoder' has not been declared
   10 |     atcoder::dsu uf(n);
      |     ^~~~~~~
a.cc:14:24: error: 'uf' was not declared in this scope; did you mean 'u'?
   14 |         if (t) cout << uf.same(u, v) << '\n';
      |                        ^~
      |                        u
a.cc:15:14: error: 'uf' was not declared in this scope; did you mean 'u'?
   15 |         else uf.merge(u, v);
      |              ^~
      |              u
Language: C++

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

using namespace std;
using ll = long long;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'atcoder' has not been declared
   10 |         atcoder::dsu tree(n);
      |         ^~~~~~~
a.cc:14:33: error: 'tree' was not declared in this scope; did you mean 'free'?
   14 |                         cout << tree.same(b, c) << endl;
      |                                 ^~~~
      |                                 free
a.cc:16:25: error: 'tree' was not declared in this scope; did you mean 'free'?
   16 |                         tree.merge(b, c);
      |                         ^~~~
      |                         free
Language: C++

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n, q;
    cin >> n >> q;
    atcoder::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) << '\n';
        else uf.merge(u, v);
    }
    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 ll = long long;

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

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

#include"bits/stdc++.h"
#include<atcoder/dsu.hpp>
using namespace std;
using namespace atcoder;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

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


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

#include"bits/stdc++.h"
#include<atcoder/dsu>
using namespace std;
using namespace atcoder;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

int main()
{
    int N, Q;
    cin >> N >> Q;
    dsu uf(N);
    rep(_, Q) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t == 0) {
            uf.merge(u, v);
        }
        else {
            cout << (uf.same(u, v) ? 1 : 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 <iostream>

using namespace std;

struct Unionfind {
    vector<int> par;
    vector<int> rank;

    void init(int n) {
        par.resize(n);
        rank.resize(n);
        for (int i = 0; i < n; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;
        else return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        x = root(x), y = root(y);
        if (x == y) return;
        else {
            if (rank[x] < rank[y]) par[x] = y;
            else {
                par[y] = x;
                if (rank[x] == rank[y]) rank[x]++;
            }
        }
    }

    bool issame(int x, int y) { return root(x) == root(y); }
};

int main(){
  int n,q;
  cin>>n>>q;
  Unionfind uf;
  uf.init(n);
  for(int i=0;i<q;i++){
    int query,a,b;
    cin>>query>>a>>b,a--,b--;
    if(query==0)uf.unite(a,b);
    else cout<<(uf.issame(a,b)?1:0)<<endl;
  }
}

Compiler output:
a.cc:6:5: error: 'vector' does not name a type
    6 |     vector<int> par;
      |     ^~~~~~
a.cc:7:5: error: 'vector' does not name a type
    7 |     vector<int> rank;
      |     ^~~~~~
a.cc: In member function 'void Unionfind::init(int)':
a.cc:10:9: error: 'par' was not declared in this scope
   10 |         par.resize(n);
      |         ^~~
a.cc:11:13: error: expected unqualified-id before '.' token
   11 |         rank.resize(n);
      |             ^
a.cc: In member function 'int Unionfind::root(int)':
a.cc:16:13: error: 'par' was not declared in this scope
   16 |         if (par[x] == x) return x;
      |             ^~~
a.cc: In member function 'void Unionfind::unite(int, int)':
a.cc:24:21: error: expected unqualified-id before '[' token
   24 |             if (rank[x] < rank[y]) par[x] = y;
      |                     ^
a.cc:24:36: error: 'par' was not declared in this scope
   24 |             if (rank[x] < rank[y]) par[x] = y;
      |                                    ^~~
a.cc:26:17: error: 'par' was not declared in this scope
   26 |                 par[y] = x;
      |                 ^~~
a.cc:27:25: error: expected unqualified-id before '[' token
   27 |                 if (rank[x] == rank[y]) rank[x]++;
      |                         ^
a.cc:27:48: error: expected initializer before '++' token
   27 |                 if (rank[x] == rank[y]) rank[x]++;
      |                                                ^~
a.cc:27:48: error: expected ';' before '++' token
Language: C++

//\\//\\ * * * //\\// ||
#include <bits/stdc++.h> 

#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;

template <typename T>
class fenwick {
 public:
  vector<T> fenw;
  int n;
  
  fenwick(int _n) n:(_n) {
    fenw.resize(n);
  }
  
  void modify(int x, T v) {
    while (x < n) {
      fenw[x] += v;
      x |= (x + 1);
    }
  }
 
  T get(int x) {
    T v{};
    while (x >= 0) {
      v += fenw[x];
      x = (x & (x + 1)) - 1;
    }
    return v;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, tt;
  cin >> n >> tt;
  fenwick<ll> fenw(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    fenw.modify(i, x);
  }
  while (tt--) {
    int q;
    cin >> q;
    if (q == 1) {
      int l, r;
      cin >> l >> r;
      cout << fenw.get(l, r - 1) << '\n';
    } else {
      int p;
      cin >> p;
      ll x;
      cin >> x;
      fenw.modify(p, x);
    }
  }
  return 0;
}


Compiler output:
a.cc:16:17: error: expected ';' at end of member declaration
   16 |   fenwick(int _n) n:(_n) {
      |                 ^
      |                  ;
a.cc:16:19: error: 'n' does not name a type
   16 |   fenwick(int _n) n:(_n) {
      |                   ^
a.cc: In function 'int main()':
a.cc:54:23: error: no matching function for call to 'fenwick<long long int>::get(int&, int)'
   54 |       cout << fenw.get(l, r - 1) << '\n';
      |               ~~~~~~~~^~~~~~~~~~
a.cc:27:5: note: candidate: 'T fenwick<T>::get(int) [with T = long long int]'
   27 |   T get(int x) {
      |     ^~~
a.cc:27:5: note:   candidate expects 1 argument, 2 provided
Language: C++

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

#pragma region lib_fenwick_tree
namespace lib {
  /*
    class FenwickTree
    usage: Fenwicktree f(100), FenwickTree<long long> f(100)
  */
  template <class T = int> class FenwickTree {
    public:
    FenwickTree() {}
    FenwickTree(int s) :
        size(s), data(s + 1, (T) 0) {}
    FenwickTree(const vector<T> &d) {
      size = d.size();
      data = vector<T>(size + 1, (T) 0);
      for (int i = 0; i < size; i++) add(i, d[i]);
    }

    /* index value must be 0-indexed */
    void add(int idx, const T &diff) {
      for (idx++; idx <= size; idx += (idx & -idx)) {
        data[idx] += diff;
      }
    }

    /* sum of the interval [0, idx] (inclusive, 0-indexed) */
    T sum(int idx) {
      T ret = 0;
      for (idx++; idx > 0; idx -= (idx & -idx)) {
        ret += data[idx];
      }
      return ret;
    }

    /* sum of the interval [l, r] (inclusive, 0-indexed) */
    T rangeSum(int l, int r) {
      return sum(r) - sum(l - 1);
    }

    private:
    int size;
    vector<T> data;
  };
}  // namespace lib
#pragma endregion

int main() {
  int N, Q;
  cin >> N >> Q;
  
  vector<long long> a(N);
  for (int &in : a) cin >> in;
  
  lib::FenwickTree<long long> f(a);
  
  while (Q--) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x == 0)
      f.add(y, z);
    else
      cout << f.rangeSum(y, z - 1) << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:18: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   54 |   for (int &in : a) cin >> in;
      |                  ^