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

#include <stdio.h>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

const std::string YES = "Yes";
const std::string NO = "No";

void print_vector(const std::vector<long long> &vec) {
    for (size_t i = 0; i < vec.size(); i++) {
        printf("%lld", vec[i]);

        if (i == vec.size()-1) {
            printf("\n");
        } else {
            printf(" ");
        }
    }
    
}

bool satisfy(const long long &N, const std::vector<long long> &A, const std::vector<long long> &B){
    for (size_t i = 0; i < N; i++) {
        if (A[i] == B[i]) {
            return false;
        }
    }
    return true;
}

void solve(long long N, std::vector<long long> A, std::vector<long long> B){
    do {
        if (satisfy(N, A, B)) {
            printf("%s\n", YES.c_str());
            print_vector(B);
            return ;
        }
    } while (std::next_permutation(B.begin(), B.end()));
    printf("%s\n", NO.c_str());
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    std::vector<long long> B(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&B[i]);
    }
    solve(N, std::move(A), std::move(B));
    return 0;
}


Compiler output:
main.c:2:10: fatal error: string: No such file or directory
    2 | #include <string>
      |          ^~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main2 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

      	int length = sc.nextInt();
      	int nums[] = new int[length];
      	int nums2[] = new int[length];
      	for( int i = 0; i < length; i++ ) {
			nums[i] = sc.nextInt();
        }
      	for( int i = 0; i < length; i++ ) {
			nums2[i] = sc.nextInt();
		}
		
		int res[] = new int[length];

		int numscount[][] = new int[2][length + 1];
		int numscount2[][] = new int[2][length + 1];
      	
		for( int i = 0; i < length; i++ ) {
			for( int j = 0; j < length - 1; j++ ) {
				if(numscount[0][j] == nums[i]) {
					numscount[1][j]++;
					break;
				}
				if(numscount[0][j + 1] == 0 && numscount[0][j] == 0 && numscount[0][j] == 0) {
					numscount[0][j] = nums[i];
					numscount[1][j]++;
				}
			}
		}
		for( int i = 0; i < length; i++ ) {
			for( int j = 0; j < length - 1; j++ ) {
				if(numscount2[0][j] == nums2[i]) {
					numscount2[1][j]++;
					break;
				}
				if(numscount2[0][j + 1] == 0 && numscount2[0][j] == 0 && numscount2[0][j] == 0) {
					numscount2[0][j] = nums2[i];
					numscount2[1][j]++;
				}
			}
		}
	
		for( int i = 0; i < length; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount[0][j] == 0) {
					break;
				}
			}
		}

      	System.out.println("1");
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int>v, v2;
    multiset<int>st;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        v.push_back(x);
    }
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        v2.push_back(x);
        st.insert(x);
    }
    int k = 1;
    vector<int>ans;
    for(int i = 0; i < n; i++){
        multiset<int>::iterator it = st.upper_bound(v[i]);
        if(it == st.end()){
            it = st.begin();
        }
        ans.push_back(*it);
        st.erase(it);
    }
    for(int i = 0; i < n; i++){
        if(ans[i] == v[i]){
            k = 0;
        }
    }
    if(k == 1){
        cout << "Yes\n";
        for(int i = 0; i < n; i++){
            cout << ans[i] << ' ';
        }
    }
    int r = 1;
    else{
        vector<int>cnt(n + 3, 0);
        for(int i = 0; i < n; i++){
            cnt[v2[i]]++;
        }
        int p = -1, mx = 0;
        for(int i = 1; i <= n; i++){
            if(cnt[i] > mx){
                mx = cnt[i];
                p = i;
            }
        }
        int idx = -1;
        for(int i = 0; i < n; i++){
            if(v2[i] == p && idx == -1){
                idx = i;
            }
            v2.push_back(v2[i]);
        }
        vector<int>ans2;
        for(int i = idx; i < idx + n; i++){
            ans2.push_back(v2[i]);
        }
        int r = 1;
        for(int i = 0; i < n; i++){
            if(v[i] == ans2[i]){
                r = 0;
            }
        }
        if(r == 1){
            cout << "Yes\n";
            for(int i = 0; i < n; i++){
                cout << ans2[i] << ' ';
            }
        }
    }
    if(r == 0){
        for(int i = 0; i < n; i++){
            v2.push_back(v2[i]);
        }
        int idx = -1;
        for(int i = 0; i < n; i++){
            if(v2[i] == v2[n - 1] && idx == -1){
                idx = i;
            }
            v2.push_back(v2[i]);
        }
        vector<int>res;
        for(int i = idx; i < idx + n; i++){
            res.push_back(v2[i]);
        }
        int p = 1;
        for(int i = 0; i < n; i++){
            if(res[i] == v[i]){
                p = 0;
            }
        }
        if(p == 1){
            cout << "Yes\n";
            for(int i = 0; i < n; i++){
                cout << res[i] << ' ';
            }
        }
        else{
            cout << "No\n";
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'else' without a previous 'if'
   41 |     else{
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#define int long long
using namespace std;
mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
bool cmp(int a,int b){
    return a>b;
}
signed main(){
    int N;
    cin >> N;
    int a[N],b[N];
    for(int i=0;i<N;i++)cin>>a[i];
    for(int i=0;i<N;i++)cin>>b[i];
    sort(b,b+N,cmp);
    bool chk=true;
    for(int i=0;i<N;i++)chk&=(a[i]!=b[i]);
    if(chk){
        cout<<"Yes\n";
        for(int i=0;i<N;i++)cout<<a[i]<<" ";
        cout<<"\n";
        for(int i=0;i<N;i++)cout<<b[i]<<" ";
        cout<<"\n";
        return 0;
    }
    vector<int>way;
    sort(b,b+N);
    way.push_back(b[N-1]);
    for(int i=N-2;i>=0;i--){
        if(way[0]==b[i]){
            way.push_back(way[0]);
        }
        else{
            break;
        }
    }
    for(int i=0;i<N;i++){
        if(way[0]!=b[i]){
            way.push_back(b[i]);
        }
        else{
            break;
        }
    }
    chk=true;
    for(int i=0;i<N;i++)chk&=(a[i]!=b[i]);
    if(chk){
        cout<<"Yes\n";
        for(int i=0;i<N;i++)cout<<a[i]<<" ";
        cout<<"\n";
        for(int i=0;i<N;i++)cout<<b[i]<<" ";
        cout<<"\n";
        return 0;
    }
    for(int i=0;i<1000;i++){
        shuffle(b,b+N,rng);
        chk=true;
        for(int j=0;j<N;j++)chk&=(a[j]!=b[j]);
        if(chk){
            cout<<"Yes\n";
            for(int i=0;i<N;i++)cout<<a[i]<<" ";
            cout<<"\n";
            for(int i=0;i<N;i++)cout<<b[i]<<" ";
            cout<<"\n";
            return 0;
        }
    }
    cout<<"No\n";
}

Compiler output:
a.cc:6:1: error: 'mt19937' does not name a type
    6 | mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:57:23: error: 'rng' was not declared in this scope
   57 |         shuffle(b,b+N,rng);
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
#define repl(i, l, r) for (int i = l; i < r; ++i)
#define rep(i, n) repl(i, 0, n)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define chmax(x,y) x = max(x, y)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using G = vector<vector<int>>;
const int MOD = 1000000007;
const int INF = 1001001001;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};

int main()
{
    int n;
    cin >> n;
    vector<int> a(n), b(n), A(n);
    rep(i, n) {
        cin >> a[i];
        A[i] = a[i];
    }
    rep(i, n) cin >> b[i];
    vector<int> ans(n, -1);
    bool ng = false;
    int c = 0;
    rep(i, n) {
        auto itr = upper_bound(all(a), b[i]);
        int index = itr - a.begin();
        if(index == n) {
            if(b[i] <= a[0]) {
                ng = true;
                break;
            }
            c = i;
            break;
        }
        a[index] = b[i];
        ans[index] = b[i];
    }
    if(ng) {
        cout << "No" << endl;
        return 0;
    }
    int cnt = 0;
    vector<int> res;
    repl(i, c, n) {
        if(A[cnt] == b[i]) {
            res.pb(i);
            ++cnt;
            continue;
        }
        if(ans[cnt] == -1 && A[cnt] != b[i]) {
            ans[cnt] = b[i];
        }
        ++cnt;
    }
    int cnt = 0;
    for(int x : res) {
        if(ans[cnt] == -1) ans[cnt] = b[x];
        ++cnt;
    }
    cout << "Yes" << endl;
    rep(i, n) cout << ans[i] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: redeclaration of 'int cnt'
   63 |     int cnt = 0;
      |         ^~~
a.cc:50:9: note: 'int cnt' previously declared here
   50 |     int cnt = 0;
      |         ^~~
Language: C++

vector<pair<int, int> > matchings;
        multiset<int> cands;
        for (auto y : c) {
            if (y.second.second + y.second.first > N) {
                cout << "No" << endl;
                return;
            }
            for (int i = 0; i < y.second.first; i++) {
                cands.insert(y.first);
            }
        }

        sort(c.begin(), c.end(), [&](pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
            return max(a.second.first, a.second.second) > max(b.second.first, b.second.second);
        });
        auto it = cands.begin();

        rotate(c.begin(), c.begin() + rot, c.end());
        for (auto y : c) {
            int crash = 0;
            int fail = 0;
            for (int i = 0; i < y.second.second; i++) {
                if (it == cands.end()) {
                    it = cands.begin();
                    crash++;
                    if (crash > 3) {
                        goto retry;
                    }
                }
                if (*it != y.first) {
                    matchings.push_back({*it, y.first});
                    it = cands.erase(it);
                } else {
                    ++it;
                    --i;
                }
            }
        }

        vector<int> BX(N);
        for (auto i : matchings) {
            BX[pos[i.first].back()] = i.second;
            pos[i.first].pop_back();
        }
        cout << "Yes" << endl;
        for (auto i : BX) {
            cout << i << " ";
        }
        cout << endl;

Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<pair<int, int> > matchings;
      | ^~~~~~
a.cc:2:9: error: 'multiset' does not name a type
    2 |         multiset<int> cands;
      |         ^~~~~~~~
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for (auto y : c) {
      |         ^~~
a.cc:13:13: error: expected constructor, destructor, or type conversion before '(' token
   13 |         sort(c.begin(), c.end(), [&](pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
      |             ^
a.cc:15:10: error: expected unqualified-id before ')' token
   15 |         });
      |          ^
a.cc:16:19: error: 'cands' was not declared in this scope
   16 |         auto it = cands.begin();
      |                   ^~~~~
a.cc:18:15: error: expected constructor, destructor, or type conversion before '(' token
   18 |         rotate(c.begin(), c.begin() + rot, c.end());
      |               ^
a.cc:19:9: error: expected unqualified-id before 'for'
   19 |         for (auto y : c) {
      |         ^~~
a.cc:40:9: error: 'vector' does not name a type
   40 |         vector<int> BX(N);
      |         ^~~~~~
a.cc:41:9: error: expected unqualified-id before 'for'
   41 |         for (auto i : matchings) {
      |         ^~~
a.cc:45:9: error: 'cout' does not name a type
   45 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:46:9: error: expected unqualified-id before 'for'
   46 |         for (auto i : BX) {
      |         ^~~
a.cc:49:9: error: 'cout' does not name a type
   49 |         cout << endl;
      |         ^~~~
Language: C++

#include<stdio.h>
#include<bits/stdc++.h>
#include<atcoder/twosat>
using namespace std;
const int nax = 4e5 + 10;
using two_sat = atcoder::two_sat;
int a[nax];
int b[nax];
int first[nax];
int last[nax];

pair <int, int> ban[nax];
int top_ban = 0;
int n;

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

    for (int i = 1 ; i <= n ; ++ i) {
        scanf("%d", a + i);
        if (!first[a[i]]) first[a[i]] = i;
        last[a[i]] = i;
    }

    for (int i = 1 ; i <= n ; ++ i) {
        scanf("%d", b + i);
    }


    for (int i = 1 ; i <= n ; ++ i) {
        int x = first[b[i]], y = last[b[i]];
        if (x == 0) continue;
        int ban_l, ban_r;
        if (i <= x) {
            ban_l = x - i;
            ban_r = ban_l + y - x;
        } else {
            x += n; y += n;
            ban_l = x - i;
            ban_r = ban_l + y - x;
        }

        if (ban_r >= n) {
            ban[++ top_ban] = make_pair(0, ban_r - n);
            ban[++ top_ban] = make_pair(ban_l, n - 1);
        } else ban[++ top_ban] = make_pair(ban_l, ban_r);
    }

    /**
        if matching exist, it's one of cyclic shift
        not we can express it as some boolean clause?
        ban range has logical expression as
        not(x >= a && x <= b)
        = not(x >= a) || (x >= b - 1)
        not just and all of these clause
        and add some additional clause
        if (x >= a)-> (x >= a - 1)
        equivalent to not(x >= a) or x >= a - 1;
    */

    two_sat sat(n);
    for (int i = 1 ; i < n ; ++ i) {
        sat.add_clause(i, false, i - 1, true);
    }

    for (int i = 1 ; i <= top_ban ; ++ i) {
        auto [l, r] = ban[i];
   //     cout << l << ' ' << r << '\n';
        if (r == n - 1)
        sat.add_clause(l, false, l, false);
        else sat.add_clause(l, false, r + 1, true);
    }
    sat.add_clause(0, true, 0, true);

    if (!sat.satisfiable()) return !printf("No");

    vector <bool> answer = sat.answer();

    int last_true = 0;


    for (int i = 0 ; i < n ; ++ i) {
        if (answer[i]) {
            last_true = i;
        } else break;
    }

    //cerr << "LAST TRUE " << last_true << '\n';
    printf("Yes\n");

    for (int i = 1 ; i <= n ; ++ i) {
        int pos = i + last_true;
        if (pos > n) pos -= n;
        printf("%d ", b[pos]);
    }
}


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

#include<stdio.h>
#include<bits/stdc++.h>
#include<atcoder/twosat>
using namespace std;
const int nax = 4e5 + 10;
using two_sat = atcoder::two_sat;
int a[nax];
int b[nax];
int first[nax];
int last[nax];

pair <int, int> ban[nax];
int top_ban = 0;
int n;

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

    for (int i = 1 ; i <= n ; ++ i) {
        scanf("%d", a + i);
        if (!first[a[i]]) first[a[i]] = i;
        last[a[i]] = i;
    }

    for (int i = 1 ; i <= n ; ++ i) {
        scanf("%d", b + i);
    }


    for (int i = 1 ; i <= n ; ++ i) {
        int x = first[b[i]], y = last[b[i]];
        if (x == 0) continue;
        int ban_l, ban_r;
        if (i <= x) {
            ban_l = x - i;
            ban_r = ban_l + y - x;
        } else {
            x += n; y += n;
            ban_l = x - i;
            ban_r = ban_l + y - x;
        }

        if (ban_r >= n) {
            ban[++ top_ban] = make_pair(0, ban_r - n);
            ban[++ top_ban] = make_pair(ban_l, n - 1);
        } else ban[++ top_ban] = make_pair(ban_l, ban_r);
    }

    /**
        if matching exist, it's one of cyclic shift
        not we can express it as some boolean clause?
        ban range has logical expression as
        not(x >= a && x <= b)
        = not(x >= a) || (x >= b - 1)
        not just and all of these clause
        and add some additional clause
        if (x >= a)-> (x >= a - 1)
        equivalent to not(x >= a) or x >= a - 1;
    */

    two_sat sat(n);
    for (int i = 1 ; i < n ; ++ i) {
        sat.add_clause(i, false, i - 1, true);
    }

    for (int i = 1 ; i <= top_ban ; ++ i) {
        auto [l, r] = ban[i];
   //     cout << l << ' ' << r << '\n';
        if (r == n - 1)
        sat.add_clause(l, false, l, false);
        else sat.add_clause(l, false, r + 1, true);
    }
    sat.add_clause(0, true, 0, true);

    if (!sat.satisfiable()) return !printf("No");

    vector <bool> answer = sat.answer();

    int last_true = 0;

    for (const auto &it : answer) {
  //      cout << it << ' ';
    }
  //  cout << '\n';

    for (int i = 0 ; i < n ; ++ i) {
        if (answer[i]) {
            last_true = i;
        } else break;
    }

    //cerr << "LAST TRUE " << last_true << '\n';
    printf("Yes\n");

    for (int i = 1 ; i <= n ; ++ i) {
        int pos = i + last_true;
        if (pos > n) pos -= n;
        printf("%d ", b[pos]);
    }
}


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

#include <bits/stdc++.h>

using namespace std;

const int N = 2000000 + 10;

// struct Node {
//     int pos, v;
//     bool operator < (const Node &tmp) const { return v < tmp.v; }
// }a[N], b[N];

int a[N], b[N], n;

bool check() {
    unordered_map <int, int> ump1, ump2;
    for (int i = 1; i <= n; i++)    ump1[a[i]]++;
    for (int i = 1; i <= n; i++)    ump2[b[i]]++;

    for (auto x : ump1) {
        if (ump2.count(x.first)) {
            if (min(x.second, ump2[x.first]) > n / 2) {
                return false;
            }
        }
    }
    return true;
}

int main() {
    cin >> n;    
    for (int i = 1; i <= n; i++)    scanf("%d", a + i);
    for (int i = 1; i <= n; i++)    scanf("%d", b + i);
    if (check()) {
        cout << "Yes\n";
        int cnt = 0;
        for (int i = n / 2 + 1; i <= n; i++)    c[++cnt] = b[i];
        for (int i = 1; i <= n / 2; i++)    c[++cnt] = b[i];
        for (int i = 1; i <= n; i++) {
            if (c[i] == a[i]) {
                cout << a[-1];
            }
        }
        for (int i = 1; i <= n; i++)    cout << c[i] << ' ';
    }
    else {
        cout << "No\n";
    }
    
#ifndef ONLINE_JUDGE
    system("pause");
#endif
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:49: error: 'c' was not declared in this scope
   36 |         for (int i = n / 2 + 1; i <= n; i++)    c[++cnt] = b[i];
      |                                                 ^
a.cc:37:45: error: 'c' was not declared in this scope
   37 |         for (int i = 1; i <= n / 2; i++)    c[++cnt] = b[i];
      |                                             ^
a.cc:39:17: error: 'c' was not declared in this scope
   39 |             if (c[i] == a[i]) {
      |                 ^
a.cc:43:49: error: 'c' was not declared in this scope
   43 |         for (int i = 1; i <= n; i++)    cout << c[i] << ' ';
      |                                                 ^
Language: Java

import java.util.*;
public class Main2 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

      	int length = sc.nextInt();
      	int nums[] = new int[length];
      	int nums2[] = new int[length];
      	for( int i = 0; i < length; i++ ) {
			nums[i] = sc.nextInt();
        }
      	for( int i = 0; i < length; i++ ) {
			nums2[i] = sc.nextInt();
		}
		
		int res[] = new int[length];

		int numscount[][] = new int[2][length + 1];
		int numscount2[][] = new int[2][length + 1];
      	
		for( int i = 0; i < length - 1; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount[0][j] == nums[i]) {
					numscount[i][j]++;
					break;
				}
				if(numscount[0][j + 1] == 0 && numscount[0][j] == 0 && numscount[0][j] == 0) {
					numscount[0][j] = nums[i];
					numscount[1][j]++;
				}
			}
		}
		for( int i = 0; i < length - 1; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount2[0][j] == nums2[i]) {
					numscount2[1][j]++;
					break;
				}
				if(numscount2[0][j + 1] == 0 && numscount2[0][j] == 0 && numscount2[0][j] == 0) {
					numscount2[0][j] = nums2[i];
					numscount2[1][j]++;
				}
			}
		}
	
		for( int i = 0; i < length; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount[0][j] == 0) {
					break;
				}
			}
		}

		//sc.close();
      	System.out.println("1");
	}
}

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

import java.util.*;
public class Main2 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

      	int length = sc.nextInt();
      	int nums[] = new int[length];
      	int nums2[] = new int[length];
      	for( int i = 0; i < length; i++ ) {
			nums[i] = sc.nextInt();
        }
      	for( int i = 0; i < length; i++ ) {
			nums2[i] = sc.nextInt();
		}
		
		int res[] = new int[length];

		int numscount[][] = new int[2][length + 1];
		int numscount2[][] = new int[2][length + 1];
      	
		for( int i = 0; i < length - 1; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount[0][j] == nums[i]) {
					numscount[i][j]++;
					break;
				}
				if(numscount[0][j + 1] == 0 && numscount[0][j] == 0 && numscount[0][j] == 0) {
					numscount[0][j] = nums[i];
					numscount[1][j]++;
				}
			}
		}
		for( int i = 0; i < length - 1; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount2[0][j] == nums2[i]) {
					numscount2[1][j]++;
					break;
				}
				if(numscount2[0][j + 1] == 0 && numscount2[0][j] == 0 && numscount2[0][j] == 0) {
					numscount2[0][j] = nums2[i];
					numscount2[1][j]++;
				}
			}
		}
	
		for( int i = 0; i < length; i++ ) {
			for( int j = 0; j < length; j++ ) {
				if(numscount[0][j] == 0) {
					break;
				}
			}
		}

		sc.close();
      	System.out.println("1");
	}
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <chrono>
#include <tuple>
#include <random>
#include <cmath>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SIZE = 1e6 * 2 + 10, INF = 1e9 * 1e9 + 10, MOD = 1e9 + 7;

ll dp[SIZE][2][2];

int main()
{
    fastInp;

    
    ll n;
    cin >> n;
    vector<ll> vec1(n), vec2(n);

    map<ll, ll> mp1, mp2;
    for (auto &cur : vec1) cin >> cur;
    for (auto &cur : vec2) cin >> cur;

    for (auto cur : vec1) {
        mp1[cur]++;
    }

    for (auto cur : vec2) {
        mp2[cur]++;
    }

    ll sh = 0;

    for (auto cur : mp1) {
        ll am = cur.second, vl = cur.first;

        if (am > n - mp2[vl]) {
            cout << "No";
            return 0;
        }
    }

    for (auto cur : mp2) {
        ll am = cur.second, vl = cur.first;

        if (am > n - mp1[vl]) {
            cout << "No";
            return 0;
        }
    }

    cout << "Yes\n";
    bool fl = true;
    for (int i = 0; i < vec2.size(); i++) {
        if (vec2[(i + n / 2) % n] == vec1[i]) fl = false;
    }

    if (fl) {
        for (int i = 0; i < vec2.size(); i++) {
            cout << vec2[(i + n / 2) % n] << " ";
        }
        return 0;
    } else {
        while (true) {
        bool fl = true;
        shuffle(vec2.begin(), vec2.end(), rand());
            for (int i = 0; i < vec2.size(); i++) {
                if (vec2[(i + n / 2) % n] == vec1[i]) fl = false;
            }

            if (fl) {
                for (int i = 0; i < vec2.size(); i++) {
                    cout << vec2[(i + n / 2) % n] << " ";
                }
                return 0;
            }
        }
    }

    return 0;
}

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

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
const int mod = 1000000007;
int main()
{
    int n;
    cin >> n;
    int ind = 0 ;
    int maxnum = 0 ;
    for(int i=0;i<n;i++)
        cin >> a[i];

    for(int i=0;i<n;i++){
        cin >> b[i];
        maxnum = max(maxnum,upper_bound(a,a+n,b[i])-a-i);
        //cout << (upper_bound(a,a+n,b[i])-a)-i << endl;
    }
    if(maxnum>n/2){
        cout << "No\n";
    }
    else{
        cout << "Yes\n";
        for(int i=0;i<n;i++){
            cout << b[(i+maxnum)%n] <<" \n"[i==n-1];
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: no matching function for call to 'max(int&, long int)'
   18 |         maxnum = max(maxnum,upper_bound(a,a+n,b[i])-a-i);
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   18 |         maxnum = max(maxnum,upper_bound(a,a+n,b[i])-a-i);
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |         maxnum = max(maxnum,upper_bound(a,a+n,b[i])-a-i);
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;
//using namespace atcoder;

int main() {
	int N;
	cin >> N;
	vector<int> A(N), B(N);
	map<int, int> ANum, BNum;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		ANum[A[i]]++;
	}
	for (int i = 0; i < N; i++) {
		cin >> B[i];
		BNum[B[i]]++;
	}
	for (int i = 0; i < N; i++) {
		if (ANum.find(i) == ANum.end() || BNum.find(i) == BNum.end()) continue;
		if (ANum[i] + BNum[i] > N) {
			cout << "No" << endl;
			return 0;
		}
	}
	reverse(B.begin(), B.end());
	int j = N - 1;
	for (int i = 0; i < N; i++) {
		if (A[i] == B[i]) {
			while (A[i] == B[j]) j--;
			swap(B[i], B[j]);
		}
	}
	cout << "Yes" << endl;
	for (int b : B) cout << b << " ";
	cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'reverse' was not declared in this scope
   27 |         reverse(B.begin(), B.end());
      |         ^~~~~~~
Language: Java


import java.io.*;
import java.util.*;

import learnjava.test6.Pair;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
		//Scanner sc=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=Integer.parseInt(sc.readLine());
		int[] a=new int[n];
		int[] b=new int[n];
		String[] ia=sc.readLine().split(" ");
		String[] ib=sc.readLine().split(" ");
		for(int i=0;i<n;i++) {
			a[i]=Integer.parseInt(ia[i]);
			b[i]=Integer.parseInt(ib[n-i-1]);
		}
		boolean poss=true;
		for(int i=0;i<n;i++) {
			if(a[i]==b[i]) {
				out.print("No");
				poss=false;
				break;
			}
		}
		if(poss) {
		out.println("Yes");
		for(int e:b) out.print(e+" ");
		}
		
		out.flush();
		out.close();
		
	}	

}



Compiler output:
Main.java:5: error: package learnjava.test6 does not exist
import learnjava.test6.Pair;
                      ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <unordered_set>
#define int long long
#define all(x) (x).begin(), (x).end()
#define all(x) (x).rbegin(), (x).rend()

using namespace std;

const int MOD = 1e9 + 7;
const int INF = 1000000000000000020;

void fast()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

const int sz = 2e6 + 20;
int dp[sz][2][2];

int main()
{
	fast();

	int n;
	cin >> n;
	vector <int> smtha(n), smthb(n);

	map <int, int> mapa, mapb;
	for (auto &cur : smtha) 
		cin >> cur;
	for (auto &cur : smthb) 
		cin >> cur;

	for (auto cur : smtha) 
	{
		++mapa[cur];
	}

	for (auto cur : smthb) 
	{
		++mapb[cur];
	}

	for (auto cur : mapa) 
	{
		int am = cur.second, vl = cur.first;

		if (am > n - mapb[vl]) 
		{
			cout << "No";
			return 0;
		}
	}

	for (auto cur : mapb) 
	{
		int am = cur.second, vl = cur.first;
		if (am > n - mapa[vl]) 
		{
			cout << "No";
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc:13:9: warning: "all" redefined
   13 | #define all(x) (x).rbegin(), (x).rend()
      |         ^~~
a.cc:12:9: note: this is the location of the previous definition
   12 | #define all(x) (x).begin(), (x).end()
      |         ^~~
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.*;
public class sample {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
			solve();
	}
	public static void solve() { 
		
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];

		HashMap<Integer, Integer> mapa = new HashMap<>();
		HashMap<Integer, Integer> mapb = new HashMap<>();
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			mapa.put(a[i], mapa.getOrDefault(a[i], 0) + 1);
		}
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
			mapb.put(b[i], mapb.getOrDefault(b[i], 0) + 1);
		}
		boolean ans = true;
		for (int num : mapa.keySet()) {
			if (mapa.get(num) >= (n + 1) / 2) {
				ans = false;
				break;
			}
		}
		if (!ans) {
			System.out.println("No");
			return;
		}

		for (int num : mapb.keySet()) {
			if (mapb.get(num) >= (n + 1) / 2) {
				ans = false;
				break;
			}
		}
		if (!ans) {
			System.out.println("No");
			return;
		}

		System.out.println("Yes");
		for (int i : a)
			System.out.print(i + " ");
		System.out.println();
	
	}
}

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

return;
                    }
                    else{
                        ans.pb(xtra.back());
                        xtra.pop_back();
                        continue;
                    }
                }
                ans.pb(xtra[k]);
                i++;k++;
            }
            else{
                print("No")
                return;
            }
        }
    }
    fo(z,n)cout<<ans[z]<<" ";cout<<endl;

}

int main()
{
    //fastio;
   // test
    solve();
}


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'return'
    1 | return;
      | ^~~~~~
a.cc:2:21: error: expected declaration before '}' token
    2 |                     }
      |                     ^
a.cc:3:21: error: expected unqualified-id before 'else'
    3 |                     else{
      |                     ^~~~
a.cc:8:17: error: expected declaration before '}' token
    8 |                 }
      |                 ^
a.cc:9:17: error: 'ans' does not name a type
    9 |                 ans.pb(xtra[k]);
      |                 ^~~
a.cc:10:17: error: 'i' does not name a type
   10 |                 i++;k++;
      |                 ^
a.cc:10:21: error: 'k' does not name a type
   10 |                 i++;k++;
      |                     ^
a.cc:11:13: error: expected declaration before '}' token
   11 |             }
      |             ^
a.cc:12:13: error: expected unqualified-id before 'else'
   12 |             else{
      |             ^~~~
a.cc:16:9: error: expected declaration before '}' token
   16 |         }
      |         ^
a.cc:17:5: error: expected declaration before '}' token
   17 |     }
      |     ^
a.cc:18:7: error: expected constructor, destructor, or type conversion before '(' token
   18 |     fo(z,n)cout<<ans[z]<<" ";cout<<endl;
      |       ^
a.cc:18:30: error: 'cout' does not name a type
   18 |     fo(z,n)cout<<ans[z]<<" ";cout<<endl;
      |                              ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:26:5: error: 'solve' was not declared in this scope
   26 |     solve();
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
typedef pair<int,int> pii;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second

template<class T, class... Args>
auto create(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector<T>(n, args...);
	else
		return vector(n, create<T>(args...));
}

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifdef OJ
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define all(x) (x).begin(), (x).end()
#define rsort(x) sort((x).rbegin(), (x).rend())
#define sz(x) ((int)x.size())
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define ford(i, n, e) for (int i = (int)(n); i >= (int)(e); --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
#define RETURN(x) do{cout << (x) << '\n'; return 0;}while(0)

const char en = '\n';
const int MOD = 0;
const int MAXN = 0;
const int INF = 1e9+1;

#include <atcoder/all>
using namespace atcoder;

int solve() {
    int n,q; cin >> n >> q;
    dsu d(n);
    fori(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) << en;
        }
    }
    return 0;
} 

int main(int argc, char **argv) {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    int ntest = 1;
    //cin >> ntest;
    fori(test, ntest) {
        //cout << "Case #" << test+1 << ": ";
        solve();
    }

    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
typedef pair<int,int> pii;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second

template<class T, class... Args>
auto create(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector<T>(n, args...);
	else
		return vector(n, create<T>(args...));
}

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifdef OJ
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define all(x) (x).begin(), (x).end()
#define rsort(x) sort((x).rbegin(), (x).rend())
#define sz(x) ((int)x.size())
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define ford(i, n, e) for (int i = (int)(n); i >= (int)(e); --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
#define RETURN(x) do{cout << (x) << '\n'; return 0;}while(0)

const char en = '\n';
const int MOD = 0;
const int MAXN = 0;
const int INF = 1e9+1;

#include <atcoder/dsu>
using namespace atcoder;

int solve() {
    int n,q; cin >> n >> q;
    dsu d(n);
    fori(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) << en;
        }
    }
    return 0;
} 

int main(int argc, char **argv) {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    int ntest = 1;
    //cin >> ntest;
    fori(test, ntest) {
        //cout << "Case #" << test+1 << ": ";
        solve();
    }

    return 0;
}


Compiler output:
a.cc:63:10: fatal error: atcoder/dsu: No such file or directory
   63 | #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 uf(n);
    while (q--) {
        int t; cin >> t;
        int u, v; cin >> u >> v;
        if (t == 0) {
            uf.merge(u, v);
        } else {
            cout << uf.same(u, v) << endl;
        }
    }
}

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

#include "bits/stdc++.h"
#include <atcoder/dsu>
using namespace std;
// clang-format off
using i64 = int64_t;
using i32 = int32_t;
#define all(x) x.begin(), x.end()
#define int i64
template <class T, typename U> constexpr inline bool exist(const T &s, const U &e) { return s.find(e) != s.end(); }
template <class T> constexpr inline i32 SZ(const T &x) { return x.size(); }
template <class T> constexpr inline bool rmn(T &a, T b) { return a > b ? (a = b, true) : false; }
template <class T> constexpr inline bool rmx(T &a, T b) { return a < b ? (a = b, true) : false; }
const char el = '\n'; const i32 MOD = 1e9 + 7, INF = 0x3f3f3f3f; const i64 INFLL = ((i64)INF << 32) | INF;

#ifdef LOCAL // debugging swiss knife
template <typename Ostream, typename Cont> enable_if_t<is_same<Ostream, ostream>::value, Ostream &> operator<<(Ostream &os, const Cont &v) { os << "{"; for (const auto &x : v) os << x << ", "; return os << "}"; }
template <typename Ostream, typename... Ts> Ostream &operator<<(Ostream &os, const pair<Ts...> &p) { return os << "(" << p.first << ", " << p.second << ")"; }
template <class... Args> void dbg_out(Args... args) { ((std::cerr << "\033[32m" << args << "\033[37m, "), ...); }
#define dbg(...) cerr << "\033[1;31m" << __LINE__ << ": [" << #__VA_ARGS__ << "]\033[37m  = ", dbg_out(__VA_ARGS__), cerr << "\033[0m" << endl;
#else
#define dbg(...) ;
#endif
// clang-format on
////////////////////////////////// TEMPLATE ENDS /////////////////////////////////
vector<vector<i32>> adj;
vector<i32> vis, color;

int32_t main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    cout << fixed << setprecision(13), cerr << fixed << setprecision(3);

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

    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 mp make_pair
#define fi first
#define se second
#define INF 10000000000000000LL
#define ll  long long 
const long long  inf =1e18+44;
const int MAX=3e5+9;
const ll MOD=1e9+7;
const int TOT_PRIMES=1e6+9;
const int MAX_A=71;
const int LN=20;
const double eps=1e-1;
using namespace std;
using namespace atcoder;
int dp[2000][2000];
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int q , n;
    cin>>q>>n;
    auto t = dsu(n);
    while(n--){
        int type , a, b;
        cin>>type>>a>>b;
        if ( type==0)
            t.merge(a, b);
        else
        {
            if(t.same(a,b))
                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 <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=998244353;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

#include<atcoder/dsu>
using namespace atcoder;

int n,q;

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

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

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

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

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    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;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
  int n, q; cin >> n >> q;
  dsu d(n);
  while(q--){
    int t, u, v; cin >> t >> u >> v;
    u--; v--;
    if(t == 0){
      d.merge(u, v); 
    }else{
      cout << (if(d.same(u, v)) ? 1 : 0) << endl;
    }
    
  }
  return;
}

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

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

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


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

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
int main() {
  int n, m;
  cin >> n >> m;
  dsu uf(n);
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    int a, b;
    cin >> a >> b;
    if (t) {
      uf.same(a,b);
    } else {
      uf.merge(a,b);
    }
  }
}


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

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  dsu uf(n);
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    int a, b;
    cin >> a >> b;
    if (t) {
      uf.same(a,b);
    } else {
      uf.merge(a,b);
    }
  }
}

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