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

#include <bits/stdc++.h>
#define ll long long
#define BUF 1e5
#define INF 1 << 30
constexpr ll mod = 1e9 + 7;
using namespace std;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

int main() {
    cin >> N >> M;
    if (M % 2 != 0) {
        cout << -1 << endl;
        return 0;
    }
    vector<vector<int>> g(N);
    vector<int> deg(N, 0);
    vector<int> flag(N, 0);
    map<pair<int, int>, int> edge;
    for (int i = 0; i < M; i++) {
        int u, v;
        u--, v--;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
        deg[u]++;
        deg[v]++;
    }
    queue<int> q;
    for (int i = 0; i < N; i++) {
        if (deg[i] == 1) {
            q.push(i);
        }
    }
    vector<int> out(N, 0);
    while (!q.empty) {
        int now = q.front();
        q.pop();
        if (deg[now] == 0) {
            flag[now] = 1;
            continue;
        }
        int adj = g[now][0];
        cout << adj + 1 << now + 1 << endl;
        out[adj] = (out[adj] + 1) % 2;
        deg[adj]--;
        if (deg[adj] == 1)
            q.push(adj);
    }

    for (int i = 0; i < N; i++) {
        if (deg[i] == 0)
            continue;
        int n;
        if (out[i] == 0) {
            n = deg[i] / 2 * 2;
        } else {
            if (deg[i] % 2 == 0) {
                n = deg[i] - 1;
            } else {
                n = deg[i];
            }
        }
        int count = 0;
        for (int j = 0; j < g[i].size(); j++) {
            int adj = g[i][j];
            if (deg[adj] == 0)
                continue;
            count++;
            if (count <= n) {
                cout << i + 1 << adj + 1 << endl;
            } else {
                cout << adj + 1 << i + 1 << endl;
            }
            deg[adj]--;
        }
        deg[i] = 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool'
   37 |     while (!q.empty) {
      |               ^~~~~
a.cc:37:15: error: in argument to unary !
   37 |     while (!q.empty) {
      |             ~~^~~~~
Language: C++

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

vector<int> graph[100010];


set<pair<int, int> > p;
queue<pair<int, int> > ans;

int edge[100010] = {};
int edge2[100010] = {};
int used[100010] = {};
int out[100010] = {};

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

    int a, b;
    for(int i = 0;i < m;i++){
        cin >> a >> b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    if(m % 2 == 1){
        cout << -1 << endl;
        return 0;
    }


    priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > que;

    for(int i = 1;i <= n;i++){
        edge2[i] = edge[i] = graph[i].size();
        que.push(make_pair(edge[i], i));
    }

    while(!que.empty()){
        int t = que.top().first;
        int idx = que.top().second;

        que.pop();

        if(used[idx]){
            continue;
        }

        used[idx] = 1;

        if((edge2[idx]+out[idx]) % 2 == 1){

            for(int i = 0;i < graph[idx].size();i++){
                if(p.find(make_pair(idx, graph[idx][i])) == p.end()){

                    if(out[idx] % 2 == 0){
                        out[graph[idx][i]]++;

                        edge2[graph[idx][i]]--;

                        que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                        ans.push(make_pair(graph[idx][i], idx));

                        p.insert(make_pair(graph[idx][i], idx));
                        p.insert(make_pair(idx, graph[idx][i]));
                    }else{
                        ans.push(make_pair(idx, graph[idx][i]));

                        edge2[graph[idx][i]]--;

                        que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                        p.insert(make_pair(graph[idx][i], idx));
                        p.insert(make_pair(idx, graph[idx][i]));
                        edge2[idx]--;
                        if(edge2[idx] == 1){
                            out[idx]++;
                        }
                    }
                }
            }

        }else{

            for(int i = 0;i < graph[idx].size();i++){
                if(p.find(make_pair(idx, graph[idx][i])) == p.end()){

                    ans.push(make_pair(idx, graph[idx][i]));

                    edge2[graph[idx][i]]--;

                    que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                    p.insert(make_pair(graph[idx][i], idx));
                    p.insert(make_pair(idx, graph[idx][i]));
                }
            }

        }
    }

    if(ans.size() != m){
        about();
    }



    while(!ans.empty()){
        cout << ans.front().first << " " << ans.front().second << endl;
        ans.pop();
    }



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:104:9: error: 'about' was not declared in this scope; did you mean 'abort'?
  104 |         about();
      |         ^~~~~
      |         abort
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else 
#define dbg(...)   /****nothing****/
#endif
const int mn=(1e5)+4;


int cnt[mn];
int rev[mn];
void fail() {printf("-1\n"); exit(0);}
vi va,vb;
vi g[mn];
map<pii,pii> h;
bitset<mn> seen;
bool globok=true;
int dfs(int x, int p, int b) {
	if (seen[x]) return b;
	seen[x]=true;
	b^=cnt[x];
	for (auto &y:g[x]) {
		b=dfs(y,x,b);
	}
	if (b&1) {
		auto it=h.find(MP(p,x));
		if (it==h.end()) globok=false;
		int e=it->second->first;
		rev[e]^=1;
	}
	return b;
}


int main(){
	int m;
	int n;
	scanf("%d",&n);
	scanf("%d",&m);
	va.resize(m-1+1);
	vb.resize(m-1+1);
	srand(clock());
	for(int i = 0 ; i <= m-1 ; i++){
		scanf("%d",&va[i]);
		scanf("%d",&vb[i]);
		int a=va[i],b=vb[i];
		cnt[va[i]]^=1;
		h[MP(a,b)]=MP(i,0);
		h[MP(b,a)]=MP(i,1);
		g[a].PB(b); g[b].PB(a);
	}
	if (m&1) fail();
	dfs(1,-1,0);
	for (int i=0;i<m;i++) {
		int a=va[i],b=vb[i];
		if (rev[i]) swap(a,b);
		printf("%d %d\n",a,b);
	}
	return 0;
}



Compiler output:
a.cc: In function 'int dfs(int, int, int)':
a.cc:49:33: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   49 |                 int e=it->second->first;
      |                                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100001,INF=1<<30;

int main(){
    int N,M;cin>>N>>M;
    vector<int> S[N],cnt(N);
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;
        if(a>b) swap(a,b);
        a--;b--;
        S[a].push_back(b);
    }

    for(int i=0;i<N;i++){
        sort(all(S[i]));
    }

    vector<pair<int,int>> T(M);
    int now=0;

    bool flag=true;

    for(int i=0;i<N;i++){
        if((S[i].size()+cnt[i])%2==0)
        for(int j=0;j<S[i].size();j++){
            T[now].first=i;
            T[now].second=S[i][j];
            now++;
        }else{
            if(S[i].size()!=0){
                for(int j=0;j<S[i].size()-1;j++){
                    T[now].first=i;
                    T[now].second=S[i][j];
                    now++;
                }
                T[now].first=-i;
                T[now].second=-S[i][S[i].size()-1];
                now++;
                cnt[j]++;
            }else flag=false;
        }
    }

    if(!flag) cout<<-1<<endl;
    else{
        for(int i=0;i<M;i++){
            if(T[i].first>=0&&T[i].second>=0){
                cout<<T[i].first+1<<" "<<T[i].second+1<<endl;
            }else cout<<-T[i].second+1<<" "<<-T[i].first+1<<endl;
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:21: error: 'j' was not declared in this scope
   42 |                 cnt[j]++;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100001,INF=1<<30;

int main(){
    int N,M;cin>>N>>M;
    vector<int> S[N],cnt(N);
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;
        if(a>b) swap(a,b);
        a--;b--;
        S[a].push_back(b);
    }

    for(int i=0;i<N;i++){
        sort(all(S[i]));
    }

    vector<pair<int,int>> T(M);
    int now=0;

    bool flag=true;

    for(int i=0;i<N;i++){
        if((S[i].size()+cnt[i])%2==0)
        for(int j=0;j<S[i].size();j++){
            T[now].first=i;
            T[now].second=j;
            now++;
        }else{
            if(S[i].size()!=0){
                for(int j=0;j<S[i].size()-1;j++){
                    T[now].first=i;
                    T[now].second=j;
                    now++;
                }
                T[now].first=-i;
                T[now].second=-j;
                now++;
                cnt[j]++;
            }else flag=false;
        }
    }

    if(!flag) cout<<-1<<endl;
    else{
        for(int i=0;i<M;i++){
            if(T[i].first>=0&&T[i].second>=0){
                cout<<T[i].first+1<<" "<<T[i].second+1<<endl;
            }else cout<<-T[i].second+1<<" "<<-T[i].first+1<<endl;
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:32: error: 'j' was not declared in this scope
   40 |                 T[now].second=-j;
      |                                ^
Language: C++

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

vector<int> graph[100010];


set<pair<int, int> > p;
queue<pair<int, int> > ans;

int edge[100010] = {};
int edge2[100010] = {};
int used[100010] = {};
int out[100010] = {};

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

    int a, b;
    for(int i = 0;i < m;i++){
        cin >> a >> b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    if(m % 2 == 1){
        cout << -1 << endl;
        return 0;
    }


    priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > que;

    for(int i = 1;i <= n;i++){
        edge2[i] = edge[i] = graph[i].size();
        que.push(make_pair(edge[i], i));
    }

    while(!que.empty()){
        int t = que.top().first;
        int idx = que.top().second;

        que.pop();

        if(used[idx]){
            continue;
        }

        used[idx] = 1;

        if((edge2[idx]+out[idx]) % 2 == 1){

            for(int i = 0;i < graph[idx].size();i++){
                if(p.find(make_pair(idx, graph[idx][i])) == p.end()){

                    if(out[idx] % 2 == 0){
                        out[graph[idx][i]]++;

                        edge2[graph[idx][i]]--;

                        que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                        ans.push(make_pair(graph[idx][i], idx));

                        p.insert(make_pair(graph[idx][i], idx));
                        p.insert(make_pair(idx, graph[idx][i]));
                    }else{
                        ans.push(make_pair(idx, graph[idx][i]));

                        edge2[graph[idx][i]]--;

                        que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                        p.insert(make_pair(graph[idx][i], idx));
                        p.insert(make_pair(idx, graph[idx][i]));
                        out[idx]++;
                    }
                }
            }

        }else{

            for(int i = 0;i < graph[idx].size();i++){
                if(p.find(make_pair(idx, graph[idx][i])) == p.end()){

                    ans.push(make_pair(idx, graph[idx][i]));

                    edge2[graph[idx][i]]--;

                    que.push(make_pair(edge2[graph[idx][i]], graph[idx][i]));

                    p.insert(make_pair(graph[idx][i], idx));
                    p.insert(make_pair(idx, graph[idx][i]));
                }
            }

        }
    }

    if(ans.size() != m){
        about();
    }



    while(!ans.empty()){
        cout << ans.front().first << " " << ans.front().second << endl;
        ans.pop();
    }



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:9: error: 'about' was not declared in this scope; did you mean 'abort'?
  101 |         about();
      |         ^~~~~
      |         abort
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100001,INF=1<<30;

int main(){
    int N,M;cin>>N>>M;
    vector<int> S[N],cnt(N);
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;
        if(a>b) swap(a,b);
        a--;b--;
        S[a].push_back(b);
    }

    for(int i=;i<N;i++){
        sort(all(S[i]));
    }

    vector<pair<int,int>> T(M);
    int now=0;

    bool flag=true;

    for(int i=0;i<N;i++){
        if((S[i].size()+cnt[i])%2==0)
        for(int j=0;j<S[i].size();j++){
            T[now].first=i;
            T[now].second=j;
            now++;
        }else{
            if(S[i].size()!=0){
                for(int j=0;j<S[i].size()-1;j++){
                    T[now].first=i;
                    T[now].second=j;
                    now++;
                }
                T[now].first=-i;
                T[now].second=-j;
                now++;
                cnt[j]++;
            }else flag=false;
        }
    }

    if(!flag) cout<<-1<<endl;
    else{
        for(int i=0;i<M;i++){
            if(T[i].first>=0&&T[i].second>=0){
                cout<<i+1<<" "<<j+1<<endl;
            }else cout<<-j+1<<" "<<-i+1<<endl;
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected primary-expression before ';' token
   17 |     for(int i=;i<N;i++){
      |               ^
a.cc:40:32: error: 'j' was not declared in this scope
   40 |                 T[now].second=-j;
      |                                ^
a.cc:51:33: error: 'j' was not declared in this scope
   51 |                 cout<<i+1<<" "<<j+1<<endl;
      |                                 ^
a.cc:52:26: error: 'j' was not declared in this scope
   52 |             }else cout<<-j+1<<" "<<-i+1<<endl;
      |                          ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
int N, M;
vector<pair<int, int> > edges, result;
int total_deg[101010], out_deg[101010];
int assert_out_deg[101010];
int main(){
	cin >> N >> M;
	for(int i = 0; i < M; i++){
		int A, B;
		cin >> A >> B;
		edges.push_back(make_pair(min(A, B), max(A, B)));
		total_deg[A]++, total_deg[B]++;
	}
	if(M % 2 == 1)return cout << -1 << '\n', 0;

	sort(edges.begin(), edges.end());
	for(int i = 0; i < M; i++){
		int A = edges[i].first;
		int B = edges[i].second;

		if((total_deg[B] == 1 && out_deg[B] == 1) || (total_deg[A] == 1 && out_deg[A] == 0)){
			result.push_back(make_pair(B, A));
			total_deg[A] --;
			total_deg[B] --;
			out_deg[B] = (out_deg[B] + 1) % 2;
		}
		else{
			result.push_back(make_pair(A, B));
			total_deg[A] --;
			total_deg[B] --;
			out_deg[A] = (out_deg[A] + 1) % 2;
		}
	}
	for(int i = 0; i < M; i++){
		assert_out_deg[result[i].first] ^= 1;
	}
	for(int i = 1; i <= N; i++){
		assert(assert_out_deg[i] == 0);
	}

	for(int i = 0; i < M; i++){
		cout << result[i].first << " " << result[i].second << "\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: 'assert' was not declared in this scope
   42 |                 assert(assert_out_deg[i] == 0);
      |                 ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include <vector>
  +++ |+#include <cassert>
    4 |
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <vector>
#include <bitset>
#include <stack>
#include <queue>
#include <set>
#include <map>
 
using namespace std;

const int MAXN = 100005;

int n,m;
int u[MAXN];
int v[MAXN];
int cnt[MAXN];
int base[MAXN];

set<int> e[MAXN];
set<pair<int,int> > ans;

int main()
{
	scanf("%d%d",&n,&m);
	for (int i = 1;i <= m;i++)
	{
		scanf("%d%d",&u[i],&v[i]);
		if (u[i] > v[i])
			swap(u[i],v[i]);
		cnt[u[i]] ^= 1;
		e[u[i]].insert(v[i]);
	}
	for (int i = 1;i <= n;i++)
	{
		if (!e[i].size())
			continue;
		if ((*e[i].begin() == i)
			e[i].erase(e[i].begin());
		if (!e[i].size())
			continue;
		int to = (*e[i].begin());
		e[i].erase(e[i].begin());
		base[i] = to;
		if (e[i].size() > e[to].size())
			swap(e[i],e[to]);
		for (set<int>::iterator j = e[i].begin();j != e[i].end();j++)
			e[to].insert(*j);
	}
	for (int i = 1;i <= n;i++)
		if (cnt[i])
		{
			if (!base[i])
			{
				puts("-1");
				return 0;
			}
			ans.insert(make_pair(i,base[i]));
			cnt[i] ^= 1;
			cnt[base[i]] ^= 1;
		}
	for (int i = 1;i <= m;i++)
	{
		if (ans.find(make_pair(u[i],v[i])) != ans.end())
			printf("%d %d\n",v[i],u[i]);
		else
			printf("%d %d\n",u[i],v[i]);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:41: error: expected ';' before 'e'
   45 |                 if ((*e[i].begin() == i)
      |                                         ^
      |                                         ;
   46 |                         e[i].erase(e[i].begin());
      |                         ~                
a.cc:47:17: error: expected primary-expression before 'if'
   47 |                 if (!e[i].size())
      |                 ^~
a.cc:46:50: error: expected ')' before 'if'
   46 |                         e[i].erase(e[i].begin());
      |                                                  ^
      |                                                  )
   47 |                 if (!e[i].size())
      |                 ~~                                
a.cc:45:20: note: to match this '('
   45 |                 if ((*e[i].begin() == i)
      |                    ^
Language: Java

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;
public class directed {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		graph1 g = new graph1(n);
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			d.add(i);
		}
		for(int i=0;i<m;i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			g.addEdge(x, y);
		}
		if(m%2==1) {
			System.out.println("-1");
		}
		else {
			g.edges(d);
		}
	}
}
class graph1 {
	int V;
	static LinkedList<Integer> adjList[];
	graph1(int V){
		this.V = V;
		adjList = new LinkedList[V];
		for(int i=0;i<V;i++) {
			adjList[i]= new LinkedList<Integer>();
		}
		
	}
	public  void addEdge(int a, int b) {
		adjList[a-1].add(b-1);
		adjList[b-1].add(a-1);
	}
	public void edges(ArrayList<Integer> d) {
		for(int i=0;i<d.size();i++) {
			if(d.get(i)!=-1) {
			if(adjList[d.get(i)].size()%2==1) {
			for(int j=0;j<adjList[d.get(i)].size()-1;j++) {
				System.out.println((d.get(i)+1)+" "+(adjList[d.get(i)].get(j)+1));
				//int k = d.indexOf(adjList[d.get(i)].get(j));
				//d.set(k, -1);
				if(d.indexOf(adjList[d.get(i)].get(j))!=-1) {
					d.set(d.indexOf(adjList[d.get(i)].get(j)), -1);
				}
			}
			
			}
			else {
				for(int j=0;j<adjList[d.get(i)].size();j++) {
					System.out.println((d.get(i)+1)+" "+(adjList[d.get(i)].get(j)+1));
					if(d.indexOf(adjList[d.get(i)].get(j))!=-1) {
						d.set(d.indexOf(adjList[d.get(i)].get(j)), -1);
					}
					
				}
			}
	}
		}
}
}

Compiler output:
Main.java:4: error: class directed is public, should be declared in a file named directed.java
public class directed {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <bits/stdc++.h>
 
#define fto(i, x, y) for(auto i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(auto i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(auto i = (x); i <= (y); i += a)
#define ftoit(it, var) for (auto it = var.begin(); it != var.end(); ++it)
 
#define ii pair<int, int>
#define mp make_pair
#define ff first
#define ss second
 
#define vi vector<int>
#define vii vector<ii>
#define ll long long
#define vll vector<ll>
 
#define eb emplace_back
#define ef emplace_front
#define lb lower_bound
#define ub upper_bound
 
#define oo 1000000007
#define OO 1000000000000000007LL
 
using namespace std;
 
#define Pro "tmp"
#define maxN 1000007

int cnt[maxN];
vi adj[maxN];

bool visited[maxN];
vii ans;

map <int, bool> check[maxN];

void DFS(int u) {
    visited[u] = 1;
    fto(i, 0, (int)adj[u].size()-1) {
        int v = adj[u][i];
        if (!visited[v]) DFS(v);
        if (check[u][v] || check[v][u]) continue;
        check[u][v] = check[v][u] = 1;
        if (cnt[v]%2) {
            ++cnt[v];
            ans.eb(v, u);
        }
        else {
            ++cnt[u];
            ans.eb(u, v);
        }  
    }
    return;
}
int main() {
 
    // int n, m;
    // scanf("%d%d", &n, &m);

    // fto(i, 1, m) {
    //     int u, v;
    //     scanf("%d%d", &u, &v);
    //     adj[u].eb(v);
    //     adj[v].eb(u);
    // }

    // DFS(1);
    // fto(i, 1, n) if (cnt[i]%2) {
    //     puts("-1");
    //     return 0;
    // } 

    // fto(i, 0, (int)ans.size()-1) printf("%d %d\n", ans[i].ff, ans[i].ss);

    if (m%2) puts("-1");
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:77:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   77 |     if (m%2) puts("-1");
      |         ^
      |         tm
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

typedef long long ll;
#define REP(i,n) for (int i = 0; i < n ; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int N,M;
int A[100010];
int B[100010];

set < pair < int,int > > unused;
reversed_priority_queue < tuple < int, int > > que; // degree, idx

vector < int > G[100010];
int degacc[100010];

int main ()
{
    cin >> N >> M;
    REP(i,M) {
        cin >> A[i] >> B[i];
        if (A[i] > B[i]) swap(A[i], B[i]);
        unused.insert(make_pair(A[i], B[i]));
        G[A[i]].push_back(B[i]);
        G[B[i]].push_back(A[i]);
    }

    for (int i = 1; i <= N; i++) {
        que.push(tuple < int,int > ((int)G[i].size(), i));
    }

    vector < pair < int,int > > ans;
    while (!que.empty()) {
        int deg, idx;
        tie(deg, idx) = que.top();
        que.pop();
        if (deg == 0) continue;
        int cnt = 0;
        REP(i,G[idx].size()) {
            int v1 = idx;
            int v2 = G[idx][i];
            if (v1 > v2) swap(v1, v2);
            if (unused.find(make_pair(v1, v2)) != unused.end()) {
                cnt++;
            }
        }
        if (cnt != deg) {
            que.push(tuple < int,int > (cnt, idx));
            continue;
        }
        REP(i,G[idx].size()) {
            int v1 = idx;
            int v2 = G[idx][i];
            if (v1 > v2) swap(v1, v2);
            if (unused.find(make_pair(v1, v2)) != unused.end()) {
                unused.erase(unused.find(make_pair(v1, v2)));
                if (degacc[idx] % 2 == 1) {
                    degacc[idx]++;
                    ans.push_back(make_pair(idx, G[idx][i]));
                } else {
                    degacc[G[idx][i]]++;
                    ans.push_back(make_pair(G[idx][i], idx));
                }
                que.push(tuple < int,int > (deg, idx));
                continue;
            }
        }
    }

    for (int i = 1; i <= N; i++) {
        if (degacc[i] % 2 == 1) {
            cout << -1 << endl;
            assert(false);
            return 0;
        }
    }

    REP(i,ans.size()) {
        cout << ans[i].first << " " << ans[i].second << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:93:13: error: 'assert' was not declared in this scope
   93 |             assert(false);
      |             ^~~~~~
a.cc:21:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   20 | #include <cstdlib>
  +++ |+#include <cassert>
   21 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define int long long

using namespace std;

const int N = 1e5;

int readInt ()
{
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true)
    {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus = true;
    else result = ch-'0';
    while (true)
    {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}
char readChar()
{
    char result = getchar();
    while (isspace(result)) {
        result = getchar();
    }
    return result;
}
vector<int>g[N+2];
int deg[N+1];
main() {
   int n=readInt();
   int m=readInt();
   for(int i=1;i<=m;i++){
      int u=readInt(),v=readInt();
      g[u].push_back(v);
      g[v].push_back(u);
      deg[u]++;
      deg[v]++;
   }
   if(m&1){
    puts("-1");
    return 0;
   }
   vector<pair<int,int>>ans;
   map<pair<int,int>,bool>mp;
   for(int u=1;u<=n;u++){
    if(deg[u]%2==0){
        for(int to:g[i]){
            if(!mp.count({u,to})){
                mp[{u,to}]=true;
                mp[{to,u}]=true;
                ans.push_back({u,to});
            }
        }
    }
   }
    for(int u=1;u<=n;u++){
//    if(deg[u]%2==1){
        bool ok=false;
        for(int to:g[u]){
            if(mp.count({u,to}))continue;
            if(!ok){
                ans.push_back({to,u});
                ok=true;
            }else{
                ans.push_back({u,to});
            }
                mp[{u,to}]=true;
                mp[{to,u}]=true;
        }
//    }
   }
   assert(ans.size()==m);
    for(auto it:ans){
        cout<<it.first<<" "<<it.second<<"\n";
    }
}
/**
**/




Compiler output:
a.cc:43:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   43 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:61:22: error: 'i' was not declared in this scope
   61 |         for(int to:g[i]){
      |                      ^
Language: C++


//im not cheating https://www.codechef.com/viewsolution/21896322
#include "bits\stdc++.h"
using namespace std;
#include<cstdio>
#define fo(i, x, y) for(int i = x; i <= y; i ++)
using namespace std;

const int N = 5e5 + 5;

int T,n,m,x,y;
int fi[N],to[N * 2],nt[N * 2],tot,bz[N];
int fa[N],ans[N],siz[N];

void link(int x,int y){
	nt[++tot] = fi[x],to[tot] = y,fi[x] = tot;
}

void cl(){
	fo(i,1,n)	bz[i] = fi[i] = ans[i] = siz[i] = 0;
	tot = 1;
}

void dg(int x,int la){
	bz[x] = 1;
	for(int i = fi[x]; i; i = nt[i]) if(!bz[to[i]]){
		ans[i / 2] = (i & 1);
		siz[to[i]] ^= 1;
		dg(to[i],i);
		siz[x] ^= siz[to[i]];
	} else if(i != (la ^ 1)){
		ans[i / 2] = !(i & 1);
		siz[to[i]] ^= 1;
	}
	if(siz[x]) ans[la / 2] ^= 1;
}

int main(){
	//for(scanf("%d",&T); T; T--){
	cl();
	cin>>n>>m;
	vector<pair<int,int>>edge;
	fo(i,1,m){
		cin>>x>>y;
		edge.push_back({x,y});
		link(x,y); link(y,x);
	}
	if(m & 1){
		printf("-1\n"); return 0;
	}
	dg(1,0);
	fo(i,1,m){
		//printf("%d ",ans[i]);
		if(ans[i])cout<<edge[i-1].first<<" "<<edge[i-1].second<<endl;
		else cout<<edge[i-1].second<<" "<<edge[i-1].first<<endl;
	}
	//}
}

Compiler output:
a.cc:3:10: fatal error: bits\stdc++.h: No such file or directory
    3 | #include "bits\stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;

public class B {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] tmpArray = br.readLine().split(" ");

		int n = Integer.parseInt(tmpArray[0]);
		int m = Integer.parseInt(tmpArray[1]);

		if(m % 2 == 1){
			System.out.println(-1);
			return;
		}

		Vertex verts[] = new Vertex[n];
		for(int i = 0; i < n; i++){
			verts[i] = new Vertex();
		}
		Edge edges[] = new Edge[m];

		for(int i = 0; i < m; i++){
			tmpArray = br.readLine().split(" ");

			int from = Integer.parseInt(tmpArray[0]) - 1;
			int to = Integer.parseInt(tmpArray[1]) - 1;
			edges[i] = new Edge(from, to);
//			verts[from].edges++;
//			verts[to].edges++;
			verts[from].edges.addElement(edges[i]);
			verts[to].edges.addElement(edges[i]);
		}

		for(int i = 0; i < n; i++){
//			System.out.println("current V "+(i + 1));
			boolean reverseFlag = false;
			if((verts[i].unusedEdges() + verts[i].from) % 2 == 1){
				reverseFlag = true;
			}

			for(int j = 0; j < verts[i].edges.size() ; j++){
				Edge tmpEdge = verts[i].edges.get(j);
				if(!tmpEdge.used){
					if(reverseFlag){
						tmpEdge.printEdge(tmpEdge.to);
						verts[tmpEdge.to].from++;
						reverseFlag = false;
					}
					else {
						tmpEdge.printEdge(i);
					}
				}

				tmpEdge.used = true;
			}
		}
	}

}

class Edge {
	int from;
	int to;
	boolean used = false;
//	boolean reverse = false;

	Edge(int from, int to){
		this.from = Math.min(from, to);
		this.to= Math.max(from, to);
	}

	void printEdge(int from){
		if(from != this.from){
			System.out.println((this.to+1)+" "+(this.from+1));
		}
		else {
			System.out.println((this.from+1)+" "+(this.to+1));
		}
	}
}
class Vertex{
//	int edges;
	int from;

	Vector<Edge> edges = new Vector<Edge>();

	int unusedEdges(){
		int count = 0;

		for(int i = 0; i < edges.size(); i++){
			if(!edges.get(i).used){
				count++;
			}
		}

		return count;
	}
}

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

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
typedef pair<int,int> pii;
int main(){
    int n,m;
    cin >> n >> m;
    int a[m],b[m];
    map<int,int> mp;
    vector<set<int>> edge;
    rep(i,n+1){
        edge.push_back({});
    }
    rep(i,n){
        cin >> a[i] >> b[i];
        mp[a[i]]++;
        mp[b[i]]++;
        edge[a[i]].insert(b[i]);
        edge[b[i]].insert(a[i]);
    }
    if(m%2==1){
        cout << -1 << endl;
        return 0;
    }
    vector<pii> ans;
    queue<int> q;
    rep(i,n){
       q.push(i+1);
    }
    long count = 0;
    while(!q.empty()){
        int t = q.front();
        if(mp[t]%2==0){
            for(auto itr = edge[t].begin();itr!=edge[t].end();itr++){
                ans.push_back(make_pair(t,*itr));
                edge[*itr].erase(t);
                mp[*itr]--;
            }
            q.pop();
            count = 0;
        }
        else{
            q.pop();
            q.push(t);
            coutn++;
            if(count>n){
                cout << -1 << endl;
                return 0;
            }
        }
    }
    rep(i,ans.size()){
        cout << ans[i].first << " " << ans[i].second << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:13: error: 'coutn' was not declared in this scope; did you mean 'count'?
   54 |             coutn++;
      |             ^~~~~
      |             count
Language: C++

#include<stdio.h>
int main(void)
{
  int n,m;
  int a[100000];
  int b[100000];
  int p[100000]=0;
  int i,j;
  int s=0;
  
  scanf("%d %d",&n,&m);
  
  for(i=0;i<m;i++)
    scanf("%d %d",&a[i],&b[i]);
  
  for(i=0;i<m;i++)
  {
    p[a[i]]++;
    p[b[i]]++;
  }
  for[i=0;i<n;i++]
  {
    if(p[i]%2==1)
      s++;
  }
  if(s>0)
    printf("-1");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: array must be initialized with a brace-enclosed initializer
    7 |   int p[100000]=0;
      |                 ^
a.cc:21:6: error: expected '(' before '[' token
   21 |   for[i=0;i<n;i++]
      |      ^
      |      (
a.cc:21:10: error: expected ',' before ';' token
   21 |   for[i=0;i<n;i++]
      |          ^
      |          ,
a.cc:21:10: error: expected identifier before ';' token
a.cc:21:10: error: expected ']' before ';' token
   21 |   for[i=0;i<n;i++]
      |          ^
      |          ]
a.cc: In lambda function:
a.cc:21:10: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:21:18: error: expected ')' before ']' token
   21 |   for[i=0;i<n;i++]
      |      ~           ^
      |                  )
a.cc:21:18: error: expected primary-expression before ']' token
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
struct data{
	int x,y;
};
int a[100010];
vector<int> v[100010];
map<long long , int> mp;
int n,m;
fi(int k , int now)
{
	for(int i=0;i<v[k].size();i++)
	{
		int m1=k , m2=v[k][i];
		if(m1>m2)
			swap(m1 , m2);
		if(mp[m1+(100010*m2)]==0)
		{
			if(now)
				cout<<k<<" "<<v[k][i]<<endl;
			else
				cout<<v[k][i]<<" "<<k<<endl;
			mp[m1+(100010*m2)]=1;
			if(now==1)
				now=0;
			else
				now=1;
			fi(v[k][i] , now);
		}
	}
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		int x,y;	cin>>x>>y;
		a[x]++ , a[y]++;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	int c=0;
	for(int i=1;i<=n;i++)
		if(a[i]%2)
			c++;
	if(m%2==1||(c!=2&&c!=0)){
		cout<<"-1"<<endl;
		return 0;
	}
	fi(1 , 1);
}

Compiler output:
a.cc:12:1: error: ISO C++ forbids declaration of 'fi' with no type [-fpermissive]
   12 | fi(int k , int now)
      | ^~
a.cc: In function 'int fi(int, int)':
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
struct data{
	int x,y;
};
int a[100010];
vector<int> v[100010];
map<long long , int> mp;
int n,m;
f(int k , int now)
{
	for(int i=0;i<v[k].size();i++)
	{
		int m1=k , m2=v[k][i];
		if(m1>m2)
			swap(m1 , m2);
		if(mp[m1+(100010*m2)]==0)
		{
			if(now)
				cout<<k<<" "<<v[k][i]<<endl;
			else
				cout<<v[k][i]<<" "<<k<<endl;
			mp[m1+(100010*m2)]=1;
			if(now==1)
				now=0;
			else
				now=1;
			f(v[k][i] , now);
		}
	}
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		int x,y;	cin>>x>>y;
		a[x]++ , a[y]++;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	int c=0;
	for(int i=1;i<=n;i++)
		if(a[i]%2)
			c++;
	if(m%2==1||(c!=2&&c!=0)){
		cout<<"-1"<<endl;
		return 0;
	}
	f(1 , 1);
}

Compiler output:
a.cc:12:1: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
   12 | f(int k , int now)
      | ^
a.cc: In function 'int f(int, int)':
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const ll MOD = 1000000007;

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

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n, m; cin >> n >> m;

    vector<int> edge[n+1];

    int out[n+1]; // -1: unvisited, 0: in, 1: out

    for(int i=1;i<=n;i++) out[i] = -1;

    for(int i=0;i<m;i++){
        int a, b; cin >> a >> b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    int d = 0;
    queue<pair<int, bool> > Q;
    Q.push(make_pair(1, true));
    while(!Q.empty()){
        auto p = Q.front();
        Q.pop();
        int v = p.first;
        bool isout = p.second;

        out[v] = isout; // 0 or 1
        
        for(int e: edge[v]){
            if(out[e] == -1){
                Q.push(make_pair(e, !isout));
            }
        }
    }

    /*
    for(int i=1;i<=n;i++){
        cout << out[i] << endl;
    }
    */

    bool pos = true;

    for(int i=1;i<=n;i++){
        if(out[i] && edge[i].size() %2){
            pos = false;
            break;
        }
    }

    if(pos){
        for(int i=1;i<=n;i++){
            if(i %2 == 0){
                for(int e: edge[i]){
                    cout << i << " " << e << endl;
                }
            }
        }
        return 0;
    }

    bool pos = true;

    // inverse
    for(int i=1;i<=n;i++){
        if(!out[i] && edge[i].size() %2){
            pos = false;
            break;
        }
    }

    if(pos){
        for(int i=1;i<=n;i++){
            if(i %2 == 1){
                for(int e: edge[i]){
                    cout << i << " " << e << endl;
                }
            }
        }
        return 0;
    }

    cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:10: error: redeclaration of 'bool pos'
   73 |     bool pos = true;
      |          ^~~
a.cc:53:10: note: 'bool pos' previously declared here
   53 |     bool pos = true;
      |          ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int aaaaaaaaaa;
  int aaaaaaaaa;
  int aaaaaaaa;
  int aaaaaaa;
  int aaaaaa;
  int aaaaa;
  int aaaa;
  int aaa;
  int aa;
  int a;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: redeclaration of 'int a'
   16 |   int a;
      |       ^
a.cc:5:7: note: 'int a' previously declared here
    5 |   int a,b,c,d,e;
      |       ^
Language: C++

#include <cmath>
#include <queue>
#include <cstdio>
#include <algorithm>
#define rg register
#define llint long long
using namespace std;
const int N=1008611;

struct ios
{
	template <typename _tp>
	inline ios operator >> (_tp &x)
	{
		x = 0;int f = 1;char c = getchar();
		for(;c<'0'||c>'9';c=getchar()) if(c=='-') f = -1;
		for(;c<='9'&&c>='0';c=getchar()) x = (x<<1)+(x<<3)+(c^48);
		x *= f;
		return *this;
	}
	template <typename _tp>
	inline ios operator << (_tp x)
	{
		char s[66];int dgt = 0;
		if(x==0) putchar('0');
		if(x<0) putchar('-'),x = -x;
		while(x) ++dgt,s[dgt] = x%10+'0',x/=10;
		while(dgt) putchar(s[dgt]),--dgt;
		return *this;
	}
	inline ios operator << (char x)
	{
		putchar(x);
		return *this;
	}
}io;

struct edge
{
	int tow,nxt;
}e[N<<1];
int e_tot,e_head[N];
inline e_add(int x,int y)
{
	++e_tot,e[e_tot].tow = y,e[e_tot].nxt = e_head[x],e_head[x] = e_tot;
}

struct frto
{
	int frm,tow;
}fto[N];
int n,m;
int noe[N],evs[N];
int cnt,ans[2][N];
queue<int> q;

int main()
{
	io >> n >> m;
	for(rg int i=1;i<=m;++i)
		io >> fto[i].frm >> fto[i].tow,++noe[fto[i].frm],++noe[fto[i].tow],e_add(fto[i].frm,i),e_add(fto[i].tow,i);
	for(rg int i=1;i<=n;++i)
		if(noe[i]%2==0)
			q.push(i);
	while(q.empty()==0)
	{
		int nw = q.front();q.pop();
		if(noe[nw]%2) continue;
		for(rg int i=e_head[nw];i;i=e[i].nxt)
			if(evs[e[i].tow]==0)
			{
				int ops = fto[e[i].tow].frm==nw?fto[e[i].tow].tow:fto[e[i].tow].frm;
				++cnt,ans[0][cnt] = nw,ans[1][cnt] = ops,evs[e[i].tow] = 1,--noe[ops];
				if(noe[ops]%2==0)
					q.push(ops);
			}
	}
	if(cnt!=m)
		io << -1 << '\n';
	else
		for(rg int i=1;i<=cnt;++i)
			io << ans[0][i] << ' ' << ans[1][i] << '\n';
	return 0;
}

Compiler output:
a.cc:43:8: error: ISO C++ forbids declaration of 'e_add' with no type [-fpermissive]
   43 | inline e_add(int x,int y)
      |        ^~~~~
a.cc: In function 'int e_add(int, int)':
a.cc:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
   46 | }
      | ^
a.cc: In function 'int main()':
a.cc:60:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   60 |         for(rg int i=1;i<=m;++i)
      |                    ^
a.cc:62:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   62 |         for(rg int i=1;i<=n;++i)
      |                    ^
a.cc:69:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   69 |                 for(rg int i=e_head[nw];i;i=e[i].nxt)
      |                            ^
a.cc:81:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   81 |                 for(rg int i=1;i<=cnt;++i)
      |                            ^
Language: C++

#include<cstdio>
#include<algorithm>
#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
template<typename T>inline void rd(T&x){int fl=0,ch;while(ch=getchar(),ch<48||57<ch)fl^=!(ch^45);x=(ch&15);while(ch=getchar(),47<ch&&ch<58)x=x*10+(ch&15);if(fl)x=-x;}
template<typename T>inline void pt(T x){if(x<0)putchar('-'),x=-x;if(x>9)pt(x/10);putchar(x%10+48);}
template<typename T>inline void pt(T x,int ch){pt(x),putchar(ch);}
template<typename T>inline T max(const T&x,const T&y){return x<y?y:x;}
template<typename T>inline T min(const T&x,const T&y){return x<y?x:y;}
const int N=100005;
int n,m,len,ans[N][2],uu[N],vv[N],vis[N];std::vector<int>g[N];
signed main(){
	rd(n),rd(m);
	rep(i,1,n){
		rd(uu[i]),rd(vv[i]);
		g[uu[i]].push_back(i),g[vv[i]].push_back(i);
	}
	rep(u,1,n){
		int j=-1;
		for(int i=0;i<g[u].size();++i){
			if(!vis[g[u][i]]){
				if(j==-1){j=i;continue;}
				int v1=uu[g[u][i]]==u?vv[g[u][i]]:uu[g[u][i]];
				int v2=uu[g[u][j]]==u?vv[g[u][j]]:uu[g[u][j]];
				ans[++len][0]=u,ans[len][1]=v1;
				ans[++len][0]=u,ans[len][1]=v2;
				vis[g[u][i]]=vis[g[u][j]]=1;
				j=-1;
			}
		}
	}
	rep(i,1,m)if(!vis[i]){puts("-1");return 0;}
	rep(i,1,len)pt(ans[i][0],' '),pt(ans[i][1],'\n');
	return 0;
}

Compiler output:
a.cc:11:47: error: 'vector' in namespace 'std' does not name a template type
   11 | int n,m,len,ans[N][2],uu[N],vv[N],vis[N];std::vector<int>g[N];
      |                                               ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | #define int long long
a.cc: In function 'int main()':
a.cc:16:17: error: 'g' was not declared in this scope
   16 |                 g[uu[i]].push_back(i),g[vv[i]].push_back(i);
      |                 ^
a.cc:20:31: error: 'g' was not declared in this scope
   20 |                 for(int i=0;i<g[u].size();++i){
      |                               ^
Language: C++

// Template
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <cmath>
#include <complex>
#include <cassert>
#define rep(i, x) for (int i = 0; i < (x); ++i)
#define rng(i, x, y) for (int i = (x); i < (y); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using namespace std;
using ll = long long;
constexpr int inf = 1001001001;
constexpr ll INF = 3003003003003003003;
template <typename T> inline bool chmin(T &x, const T &y) {if (x > y) {x = y; return 1;} return 0;}
template <typename T> inline bool chmax(T &x, const T &y) {if (x < y) {x = y; return 1;} return 0;}

// Main Code
int main() {
    int n;
    cin >> n;
    bitset<32> bs(n);
    assert(bs.count() == 1);
    cout << "No\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'bitset' was not declared in this scope
   33 |     bitset<32> bs(n);
      |     ^~~~~~
a.cc:17:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   16 | #include <cassert>
  +++ |+#include <bitset>
   17 | #define rep(i, x) for (int i = 0; i < (x); ++i)
a.cc:33:16: error: 'bs' was not declared in this scope; did you mean 'abs'?
   33 |     bitset<32> bs(n);
      |                ^~
      |                abs
Language: C++

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
inline int read()
{
	int x = 0 , f = 1; char ch = getchar();
	while(ch < '0' || ch > '9')	{if(ch == '-')	f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = (x << 3) + (x << 1) + (ch ^ 48); ch = getchar();}
	return x * f;
}
int main()
{
	int n = read() , m = log2(n);
	if((1 << m) == n) puts("No");
	else
	{
		puts("Yes");
		printf("%d %d\n",1,2);
		printf("%d %d\n",2,3);
		printf("%d %d\n",3,n + 1);
		printf("%d %d\n",n + 1,n + 2);
		printf("%d %d\n",n + 2,n + 3);
		for(int i = 4;i < n;i += 2)
		{
			int j = i + 1;
			printf("%d %d\n",n + 1,i);
			printf("%d %d\n",n + 1,j);
			printf("%d %d\n",i,n + j);
			printf("%d %d\n",j,n + i);
		}
		if(!(n & 1))
		{
			for(int x = 2;x < n;x ++)
			{
				int y = n ^ 1 ^ x;
				if(y > 1 && y < n)
				{
					printf("%d %d\n",n + n,x);
					printf("%d %d\n",n,y);
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: 'log2' was not declared in this scope
   16 |         int n = read() , m = log2(n);
      |                              ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for (int i = (a); i <= (b); ++i)
#define drep(i,a,b) for (int i = (a); i >= (b); --i)
#define grep(i,u) for (int i = head[u],v = e[i].v; i; v = e[i = e[i].nxt].v)
#define il inline
#define LL long long
using namespace std;
il int read() {
	int res = 0,f = 1; char ch = getchar(); while (!isdigit(ch)) {if (ch == '-') f = -f; ch = getchar();}
	while (isdigit(ch)) {res = (res<<3)+(res<<1)+ch-'0'; ch = getchar();} return res*f;
}
namespace qiqi {
	int n; void main() {
		n = read(); if (n == (n&(-n))) {puts("0"); return;} printf("1 2\n2 3\n3 %d\n%d %d\n%d %d\n",1+n,1+n,2+n,2+n,3+n);
		rep(i,2,(n^1)>>1) printf("1 %d\n1 %d\n%d %d\n%d %d\n",i<<1,i<<1|1,i<<1|1,(i<<1)+n,i<<1,(i<<1|1)+n);
		if (!(n&1)) {rep(i,2,n) if (i != 3) {int x = n^i^1; if (x != 3 && y < n) {printf("%d %d\n%d %d\n",n,i,n<<1,x);}}}
	}
}
int main() {qiqi::main(); return 0;}

Compiler output:
a.cc: In function 'void qiqi::main()':
a.cc:16:83: error: 'y' was not declared in this scope
   16 |                 if (!(n&1)) {rep(i,2,n) if (i != 3) {int x = n^i^1; if (x != 3 && y < n) {printf("%d %d\n%d %d\n",n,i,n<<1,x);}}}
      |                                                                                   ^
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

void out(int u, int v){
	printf("%d %d\n", u, v);
}

int main(){
	int n, tmp = 1; cin >> n;
	while(tmp <= n) tmp <<= 1;
	tmp >>= 1;
	if(tmp == n) return puts("No"), 0;
	puts("Yes");
	for(int i = 2; i < n; i += 2){
		int u = i, v = i + 1;
		out(u, 1); out(v, 1); out(u, v + n), out(v, u + n);
	} out(n + 1, 2 + n);
	if(n % 2 == 0){
		int p = n ^ 1 ^ tmp;
		out(tmp, n);
		if(!p) out(1, n);
		else out(p, n);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'cin' was not declared in this scope
   11 |         int n, tmp = 1; cin >> n;
      |                         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 |