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

for (ll i=2;i<=N/3;i++){
      if (A[i]!=A[i-1]){
        cout << "No" << endl;
        return 0;
      }
    }
    for (ll i=N/3+2;i<=2*N/3;i++){
      if (A[i]!=A[i-1]){
        cout << "No" << endl;
        return 0;
      }
    }for (ll i=2*N/3+2;i<=N;i++){
      if (A[i]!=A[i-1]){
        cout << "No" << endl;
        return 0;
      }
    }
    if ((A[N/3]^A[N*2/3])==A[N]){
      cout << "Yes" << endl;
      return 0;
    }else{
      cout << "No" << endl;
      return 0;
    }
  }
  else
  {
    for (ll i=1;i<=N;i++){
      if (A[i]!=0){
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for (ll i=2;i<=N/3;i++){
      | ^~~
a.cc:1:13: error: 'i' does not name a type
    1 | for (ll i=2;i<=N/3;i++){
      |             ^
a.cc:1:20: error: 'i' does not name a type
    1 | for (ll i=2;i<=N/3;i++){
      |                    ^
a.cc:7:5: error: expected unqualified-id before 'for'
    7 |     for (ll i=N/3+2;i<=2*N/3;i++){
      |     ^~~
a.cc:7:21: error: 'i' does not name a type
    7 |     for (ll i=N/3+2;i<=2*N/3;i++){
      |                     ^
a.cc:7:30: error: 'i' does not name a type
    7 |     for (ll i=N/3+2;i<=2*N/3;i++){
      |                              ^
a.cc:12:6: error: expected unqualified-id before 'for'
   12 |     }for (ll i=2*N/3+2;i<=N;i++){
      |      ^~~
a.cc:12:24: error: 'i' does not name a type
   12 |     }for (ll i=2*N/3+2;i<=N;i++){
      |                        ^
a.cc:12:29: error: 'i' does not name a type
   12 |     }for (ll i=2*N/3+2;i<=N;i++){
      |                             ^
a.cc:18:5: error: expected unqualified-id before 'if'
   18 |     if ((A[N/3]^A[N*2/3])==A[N]){
      |     ^~
a.cc:21:6: error: expected unqualified-id before 'else'
   21 |     }else{
      |      ^~~~
a.cc:25:3: error: expected declaration before '}' token
   25 |   }
      |   ^
a.cc:26:3: error: expected unqualified-id before 'else'
   26 |   else
      |   ^~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

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

int main(){
	else cout << "yes" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'else' without a previous 'if'
    5 |         else cout << "yes" << endl;
      |         ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <set>
#include <map>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INF64 = 3e18;
const unsigned long long HASHBASE=1222827239ull;
const long long MODNUM=1000000007ll;
/////////////////////////
int a[100010];
/////////////////////////
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    for(int i=1;i<=n;++i)
    {
        cin>>a[i];
    }
    sum=a[1];
    for(int i=2;i<=n;++i)
    {
        sum=sum^a[i];
    }
    if(sum==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'sum' was not declared in this scope
   30 |     sum=a[1];
      |     ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+10;
int n,ans;
int ans[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++) {
		scanf("%d",&a[i]); ans^=a[i];
	}
	if (ans==0) puts("Yes"); else puts("No");
}

Compiler output:
a.cc:6:5: error: conflicting declaration 'int ans [100010]'
    6 | int ans[N];
      |     ^~~
a.cc:5:7: note: previous declaration as 'int ans'
    5 | int n,ans;
      |       ^~~
a.cc: In function 'int main()':
a.cc:10:29: error: 'a' was not declared in this scope
   10 |                 scanf("%d",&a[i]); ans^=a[i];
      |                             ^
Language: C++

N=int(input())
A=list(map(int,input().split()))
SA=set(A)
if N%3==0:
    if len(SA)==3:
        x=[0,0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
        if x[0]==x[1] and x[1]==x[2]:
            print('Yes')
        else:
            print('No')
    elif len(SA)==2:
        x=[0,0]
        for i,a in enumerate(SA):
            x[i]=A.count(a)
        if x[0]*2==x[1] or x[1]*2==x[0]:
            print('Yes')
        else:
            print('No')
    elif  A[0]==0:
        print('Yes')
    else:
        print('No')
            
        
        
else:
    if len(SA)==1 and A[0]==0:
        print('Yes')
    else:
        print('No')

Compiler output:
a.cc:10:19: warning: multi-character character constant [-Wmultichar]
   10 |             print('Yes')
      |                   ^~~~~
a.cc:12:19: warning: multi-character character constant [-Wmultichar]
   12 |             print('No')
      |                   ^~~~
a.cc:18:19: warning: multi-character character constant [-Wmultichar]
   18 |             print('Yes')
      |                   ^~~~~
a.cc:20:19: warning: multi-character character constant [-Wmultichar]
   20 |             print('No')
      |                   ^~~~
a.cc:22:15: warning: multi-character character constant [-Wmultichar]
   22 |         print('Yes')
      |               ^~~~~
a.cc:24:15: warning: multi-character character constant [-Wmultichar]
   24 |         print('No')
      |               ^~~~
a.cc:30:15: warning: multi-character character constant [-Wmultichar]
   30 |         print('Yes')
      |               ^~~~~
a.cc:32:15: warning: multi-character character constant [-Wmultichar]
   32 |         print('No')
      |               ^~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

/* Bismillahirrahmanirrahim */
/* Author : Jehian Norman Saviero (@Reiva5) */
#include <bits/stdc++.h>
#include <HDTManager.hpp>

// MACROS SAMPAH
#define Jehian using
#define Norman namespace
#define Saviero std
 
Jehian Norman Saviero;
using namespace hdt;

// MACROS TYPE
typedef long l;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<l,l> pl;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<l> vl;
typedef vector<ll> vll;
 
// MACROS FOR PRINT
#define nl printf("\n")
#define sp printf(" ")
 
// MACROS FOR ATTRIBUTE
#define fi first
#define se second
 
// MACROS FOR FUNCTION AND METHOD
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ALL(x) (x).begin(), (x).end()
#define ALLN(x,n) (x), (x)+(n)
#define CUBE(x) (SQR(x)*(x))
#define SET(x,y) for (int _qwe = sizeof(x)/sizeof(x[0]); _qwe; ) x[--_qwe] = (y)
#define SQR(x) ((x)*(x))
#define SSORT(x,sz) sort(ALLN(x,sz))
#define RESET(x) memset((x), 0, sizeof(x))
#define VSORT(x) sort(ALL(x))
 
// MACROS READ INPUT
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%ld", &x)
#define scll(x) scanf("%lld", &x)
#define scul(x) scl(x)
#define scull(x) scll(x)

int main() {
	int N;
	sci(N);
	int val = 0;
	for (int i = 0; i < N; ++i) {
		int tmp;
		sci(tmp);
		val ^= tmp;
	}
	puts(val ? "No" : "Yes");
	return 0;
}

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


#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int n,m;
vector<pii> ans;
vector<set<int> > to;
void dfs(int v,int stock=0){
  if(to[v].empty()){
    swap(ans[ans.size()-1].first,ans[ans.size()-1].second);
    return;
  }
  int x=*rbegin(to[v]);
  if((stcok+to[v].size())%2==1){
    ans.emplace_back(x+1,v+1);
    to[x].erase(v);
    to[v].erase(x);
    stock=1;
  }
  else stock=0;
  queue<int> q;
  for(auto nv:to[v]) q.push(nv);
  int qs=q.size();
  rep(i,qs){
    int nv=q.front();
    q.pop();
    ans.emplace_back(v+1,nv+1);
    to[v].erase(nv);
    to[nv].erase(v);
  }
  dfs(x,stock);
}

int main(){
  cin >> n >> m;
  if(m%2==1){
    cout << -1 << endl;
    return 0;
  }
  to.resize(n);
  stock.resize(n);
  rep(i,m){
    int a,b; cin >> a >> b;
    a--; b--;
    to[a].insert(b);
    to[b].insert(a);
  }
  dfs(0);
  for(auto c:ans){
    cout << c.first << " " << c.second << endl;
  }
  
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:28:7: error: 'stcok' was not declared in this scope; did you mean 'stock'?
   28 |   if((stcok+to[v].size())%2==1){
      |       ^~~~~
      |       stock
a.cc: In function 'int main()':
a.cc:55:3: error: 'stock' was not declared in this scope
   55 |   stock.resize(n);
      |   ^~~~~
Language: C++


#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int n,m;
vector<pii> ans;
vector<set<int> > to;
void dfs(int v,int stock=0){
  if(to[v].empty()){
    swap(ans[ans.size()-1].first,ans[ans.size()-1].second);
    return;
  }
  int x=*rbegin(to[v]);
  if(to[v].size()%2==1){
    ans.emplace_back(x+1,v+1);
    to[x].erase(v);
    to[v].erase(x);
    stock=1;
  }
  else stock=0;
  queue<int> q;
  for(auto nv:to[v]) q.push(nv);
  int qs=q.size();
  rep(i,qs){
    int nv=q.front();
    q.pop();
    ans.emplace_back(v+1,nv+1);
    to[v].erase(nv);
    to[nv].erase(v);
  }
  dfs(x,stock);
}

int main(){
  cin >> n >> m;
  if(m%2==1){
    cout << -1 << endl;
    return 0;
  }
  to.resize(n);
  stock.resize(n);
  rep(i,m){
    int a,b; cin >> a >> b;
    a--; b--;
    to[a].insert(b);
    to[b].insert(a);
  }
  dfs(0);
  for(auto c:ans){
    cout << c.first << " " << c.second << endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:3: error: 'stock' was not declared in this scope
   55 |   stock.resize(n);
      |   ^~~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int N,M;
multiset<int> E[101010];
vector<pair<int,int>> V;

int dfs(int cur,int pre){
  int lef=-1;
  while(E[cur].size()){
    int x=*E[cur].begin();
    E[cur].erase(x);
	E[x].erase(cur);
	int y=dfs(x,cur);
	if(y!=-1){
      if(lef==-1) lef=y;
      else{
        V.push_back({cur,lef});
        V.push_back({cur,y});
        lef=-1;
      }
    }
  }
  if(lef!=-1){
    if(pre!=-1){
      V.push_back({cur,pre});
      V.push_back({cur,lef});
      return -1;
    }
  }
  return cur;
}

int main(){
	cin>>N>>M;
	REP(i,M){
      cin>>x>>y;
      E[x].insert(y);
      E[y].insert(x);
	}
	if(M%2){
      co(-1);
      return 0;
    }
	dfs(1,-1);
	FORE(v,V) cout<<v.first<<" "<<v.second<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:12: error: 'x' was not declared in this scope
  101 |       cin>>x>>y;
      |            ^
a.cc:101:15: error: 'y' was not declared in this scope
  101 |       cin>>x>>y;
      |               ^
Language: C++

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

typedef long long               ll;
typedef unsigned long long      ull;

const int N = 100 * 1000 + 20;

vector <ll> adj[N];
bool vis[N];
ll d[N], outD[N];

void dfs(ll v) {
    vis[v] = true;
    for (auto u: v) {
        if (!vis[u]) {
            d[u] = d[v] + 1;
            dfs(u);
        }
        if (d[x] > d[i]) {
            if (!(outD[u] & 1)) {
                outDegree[v]++;
                cout << v << " " << u << endl;
            }
            else {
                outDegree[u]++;
                cout << u << ' '  << v << endl;
            }
        }
    }
    
}

int main() {
    ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
    ll n, m;
    cin >> n >> m;
    if (m & 1)  
        return cout << -1 << endl, 0;
    for (int i = 0, u, v; i < m; i++) {
        cin >> v >> u;
        adj[v].push_back(u);
        adj[u].push_back(v);
    }
    dfs(1);
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(ll)':
a.cc:15:18: error: 'begin' was not declared in this scope
   15 |     for (auto u: v) {
      |                  ^
a.cc:15:18: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:15:18: error: 'end' was not declared in this scope
   15 |     for (auto u: v) {
      |                  ^
a.cc:15:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:20:15: error: 'x' was not declared in this scope
   20 |         if (d[x] > d[i]) {
      |               ^
a.cc:20:22: error: 'i' was not declared in this scope
   20 |         if (d[x] > d[i]) {
      |                      ^
a.cc:22:17: error: 'outDegree' was not declared in this scope
   22 |                 outDegree[v]++;
      |                 ^~~~~~~~~
a.cc:26:17: error: 'outDegree' was not declared in this scope
   26 |                 outDegree[u]++;
      |                 ^~~~~~~~~
Language: C++

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
#define N 100005
#define M 100005
struct node{
    int u,v;
}edge[M],ans[M];
int n,m,cnt;
vector<int>G[N],T[N];
bool vis[M];
//bool vis[N];
int d[N],ft[N];
int rt=-1;
/*void dfs(int u,int f)
{
    vis[u]=1;
    for(int i=0;i<G[u].size();i++)
    {
        int v=G[u][i];
        if(vis[v]||v==f) continue;
        T[u].push_back(v);
        T[v].push_back(u);
        dfs(v,u);
    }
}*/
int Find(int x)
{
    if(ft[x]==x)
        return x;
    return ft[x]=Find(ft[x]);
}
bool Union(int x,int y)
{
    int u=Find(x),v=Find(y);
    if(u==v) return 0;
    if(u>v) ft[u]=v;
    else ft[v]=u;
    return 1;    
}
void dfs2(int u,int f)
{
    //printf("%d\n",u);
    for(int i=0;i<T[u].size();i++)
    {
        int v=T[u][i];
        if(v==f) continue;
        dfs2(v,u);
    }
    if(u==rt) return ;
    if(d[u]&1) ans[++cnt].u=u,ans[cnt].v=f,d[u]++;
    else ans[++cnt].u=f,ans[cnt].v=u,d[f]++;
    //printf("%d %d %d %d\n",u,d[u],ans[cnt].u,ans[cnt].v);
}
void Init()
{
    for(int i=1;i<=n;i++)
        ft[i]=i;
    int tot=0;
    for(int i=1;i<=m;i++)
    {
        if(Union(edge[i].u,edge[i].v))
        {
            T[edge[i].u].push_back(edge[i].v);
            T[edge[i].v].push_back(edge[i].u);
            if(rt==-1) rt=edge[i].u;
            vis[i]=1;
            tot++;
        }
        if(tot==n-1) break;
    }
    cnt=0;
    for(int i=1;i<=m;i++)
        if(!vis[i])
        {
            ans[++cnt].u=edge[i].u,ans[cnt].v=edge[i].v;
            d[edge[i].u]++;
            //printf("**%d %d\n",edge[i].u,edge[i].v);
        }
    dfs2(rt,-1);
}
int main()
{
    //freopen("degree.in","r",stdin);
    //freopen("degree.out","w",stdout);
    scanf("%d %d",&n,&m);
    if(m&1)
    {
        puts("-1");
        return 0;
    }
    for(int i=1;i<=m;i++)
    {
        int u,v;scanf("%d %d",&u,&v);
        G[u].push_back(v);
        G[v].push_back(v);
        edge[++cnt].u=u,edge[cnt].v=v;
    }
    //dfs(1);//Find ST
    Init();//Find ST
    for(int i=1;i<=cnt;i++)
        printf("%d %d\n",ans[i].u,ans[i].v);
    return 0;
}

Code

Compiler output:
a.cc:108:1: error: 'Code' does not name a type; did you mean 'node'?
  108 | Code
      | ^~~~
      | node
Language: C++

# include <bits/stdc++.h>

using namespace std;
#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m;
int a[N];
int b[N];
int d[N];
int c[N];
map < int, int > e[N];
bool u[N];

vector < int > g[N];

void dfs (int v, int pr = 0) {
    u[v] = 1;

	for (auto i : g[v]) {
		if (to == pr) continue;
		int to = v ^ a[i] ^ b[i];
		if (u[to]) {
			if (e[v][to] == 0 && e[to][v] == 0) {
				e[v][to] = 1;
				d[v] ^= 1;
			}
		} else {
			dfs(to, v);

			if (d[to]&1) {
				e[to][v] = 1;
				d[to] ^= 1;
			} else {
				e[v][to] = 1;
			}


		}
	} 
}

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

	for (int i = 1; i <= m; i ++) {
		cin >> a[i] >> b[i];
		g[a[i]].pb(i);
		g[b[i]].pb(i);
	}

	for (int i = 1; i <= n; ++i) {
		if (sz(g[i]) % 2 || m % 2) {
			puts("-1");
			exit(0);
		}
		if (!u[i] && g[i].size() % 2 == 0) {
			dfs(i);
		}
	}

	for (int i = 1; i <= m; i ++) {
		if (e[b[i]][a[i]]) cout << b[i] << ' ' << a[i];
		else cout << a[i] << ' ' << b[i];
		cout << '\n';
	}

   	return Accepted;
}

// B...a

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:56:21: error: 'to' was not declared in this scope; did you mean 'tm'?
   56 |                 if (to == pr) continue;
      |                     ^~
      |                     tm
Language: C++

#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

struct graph {
	struct edge {
		int a, b;
		bool isDirected = true; // 向きが決定されたか
		bool dir = true; // trueならa -> b
	};

	int n, m;
	vector<edge> e;
	vector<vector<edge*>> g;
	vector<int> cnt;

	graph(int n, int m) {
		this->n = n; this->m = m;
		g.resize(n); e.resize(m);
		cnt.resize(n, 0);
		for (int i = 0; i < m; ++i) {
			int ai, bi; scanf("%d %d", &ai, %bi);
			--ai, --bi;
			e[i].a = ai; e[i].b = bi;
			e[i].isDirected = true; e[i].dir = true;
			g[ai].push_back(&e[i]);
			g[bi].push_back(&e[i]);
		}
	}

	// 0を根とする根付き木の辺の向きを不定にする
	void dfs(int s = 0) {
		static vector<bool> visited(n, false);
		visited[s] = true;
		for (edge* ed : g[s]) {
			int nx = (*ed).a == s ? (*ed).b : (*ed).a;
			if (!visited[nx]) {
				(*ed).isDirected = false;
				dfs(nx);
			}
		}
	}

	// 各頂点について、何本辺が(今のところ)出ているか調べる
	void count() {
		for (edge ei : e) {
			if (ei.isDirected) {
				if (ei.dir) ++cnt[ei.a];
				else ++cnt[ei.b];
			}
		}
	}

	// 根付き木の辺の向きを決定していく
	void solve(int s = 0) {
		static vector<bool> visited(n, false);
		visited[s] = true;
		for (edge* ed : g[s]) {
			int nx = (*ed).a == s ? (*ed).b : (*ed).a;
			if ((!(*ed).isDirected) && (!visited[nx])) solve(nx);
		}
		for (edge* ed : g[s]) {
			if ((*ed).isDirected) continue;
			if (cnt[s] & 1) { // 自分から生やす
				if ((*ed).a != s) (*ed).dir = false;
				++cnt[s];
			}
			else { // 自分に向ける
				if ((*ed).a == s) (*ed).dir = false;
				++cnt[(*ed).b != s ? (*ed).b : (*ed).a];
			}
			(*ed).isDirected = true;
		}
	}

	// 出力する
	void show() {
		for (auto ed : e) {
			if (ed.dir)
				cout << (ed.a + 1) << " " << (ed.b + 1) << endl;
			else
				cout << (ed.b + 1) << " " << (ed.a + 1) << endl;
		}
	}
};

int main() {
	int n, m; scanf("%d %d", &n, &m);
	if (m & 1) { // mが奇数の時は不可
		cout << -1 << endl;
	}
	else { // mが偶数の時は構築可
		graph g(n, m);
		g.dfs();
		g.count();
		g.solve();
		g.show();
	}
	return 0;
}


Compiler output:
a.cc: In constructor 'graph::graph(int, int)':
a.cc:24:57: error: expected primary-expression before '%' token
   24 |                         int ai, bi; scanf("%d %d", &ai, %bi);
      |                                                         ^
Language: C++



#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
#define MPlus(x,y) {x=(x+y)%M;}
#define MSub(x,y) {x=(x-y+M)%M;}
#define MMul(x,y) {x=(x*y)%M;}



template< typename Monoid >
struct segTree {
  using F = function< Monoid(Monoid, Monoid) >;

  int sz;
  vector< Monoid > seg;

  const F f;
  const Monoid M1;

  segTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }

  void set(int k, const Monoid &x) {
    seg[k + sz] = x;
  }

  void build() {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  Monoid get(int a, int b) {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }

  Monoid operator[](const int &k) const {
    return seg[k + sz];
  }
};


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n,m;
  cin>>n>>m;
  vector<vi> es(n);
  rep(i,m){
    int a,b;
    cin>>a>>b;
    a--;b--;
    es[a].PB(b);
    es[b].PB(a);
  }
  
  segTree<P> seg(n,[](P a,P b){return min(a,b);},P(inf,inf));
  rep(i,n){
    seg.update(i,P(es[i].size(),i));
  }

  
  vector<vi> node(n);
  map<P,bool> mp;
  while(true){
    P p=seg.get(0,n);
    if(P.F==inf) break;
    //cout<<p.F<<' '<<p.S<<endl;
    for(int x:es[p.S]){
      if(mp.find(P(p.S,x))==mp.end()){
        if(node[p.S].size()%2){
          node[p.S].PB(x);
          mp[P(x,p.S)]=true;
          mp[P(p.S,x)]=true;
        }else{
          node[x].PB(p.S);
          mp[P(x,p.S)]=true;
          mp[P(p.S,x)]=true;
        }
        seg.update(x,P(seg.get(x,x+1).F-1,x));
      }
    }
    seg.update(p.S,P(inf,p.S));
  }

  rep(i,n){
    //cout<<node[i].size()<<endl;
    if(node[i].size()%2){
      cout<<-1<<endl;
      return 0;
    }
  }

  rep(i,n){
    for(int j:node[i]){
      cout<<i+1<<' '<<j+1<<endl;
    }
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:110:9: error: expected unqualified-id before '.' token
  110 |     if(P.F==inf) break;
      |         ^
Language: C++

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

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> e(n);
  vector<pair<int, int>> t;
  vector<int> o(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    if (a > b) swap(a, b);
    edges[a].push_back(b);
    t.emplace_back(a, b);
    o[a] = 1 - o[a];
  }
  vector<int> v(n);
  function<void(int, vector<int>)> dfs = [&](auto i, auto &p) {
    p.push_back(j);
    if (o[j]) return;
    v[i] = true;
    for (auto j : e[i]) {
      if (!v[j]) {
        dfs(j);
      }
    }
    p.pop_back();
  };
  int no = accumulate(o.begin(), o.end(), 0);
  if (no % 2) {
    cout << -1 << endl;
    return 0;
  }
  set<pair<int, int>> s;
  while (no) {
    for (int i = 0; i < n; ++i) {
      if (o[i]) {
        vector<int> p;
        dfs(i, p);
        for (int j = 0; j < p.size() - 1; ++j) {
          s.emplace(p[0], p[1]);
        }
        o[p.front()] = o[p.back()] = 0;
        break;
      }
    }
    no -= 2;
  }
  for (auto p : t) {
    if (s.find(p) == s.end()) {
      cout << p.first << ' ' << p.second << '\n';
    } else {
      cout << p.second << ' ' << p.first << '\n';
    }
  } 
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'edges' was not declared in this scope
   19 |     edges[a].push_back(b);
      |     ^~~~~
a.cc: In lambda function:
a.cc:25:17: error: 'j' was not declared in this scope
   25 |     p.push_back(j);
      |                 ^
a.cc: In function 'int main()':
a.cc:24:42: error: conversion from 'main()::<lambda(auto:28, auto:29&)>' to non-scalar type 'std::function<void(int, std::vector<int>)>' requested
   24 |   function<void(int, vector<int>)> dfs = [&](auto i, auto &p) {
      |                                          ^~~~~~~~~~~~~~~~~~~~~~
   25 |     p.push_back(j);
      |     ~~~~~~~~~~~~~~~                       
   26 |     if (o[j]) return;
      |     ~~~~~~~~~~~~~~~~~                     
   27 |     v[i] = true;
      |     ~~~~~~~~~~~~                          
   28 |     for (auto j : e[i]) {
      |     ~~~~~~~~~~~~~~~~~~~~~                 
   29 |       if (!v[j]) {
      |       ~~~~~~~~~~~~                        
   30 |         dfs(j);
      |         ~~~~~~~                           
   31 |       }
      |       ~                                   
   32 |     }
      |     ~                                     
   33 |     p.pop_back();
      |     ~~~~~~~~~~~~~                         
   34 |   };
      |   ~
Language: C++

/*input
2
4 4
1 2
1 3
2 4
3 4
3 3
1 2
2 3
1 3
*/
#include<bits/stdc++.h>
using namespace std;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define WL(t) while(t --)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;
const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int fast_ex(int a,int n,int m){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= fast_ex(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

const int N = 1e5+1;

int t,n,m;
vector<int> adj[N];
int in[N];
vector<pii> edges;
int ans[N];
bool vis[N];
int pref[N];
vi qs;
set< pair<int,int> > one;

void dfs(int u,int p){
     vis[u] = 1;
     for(int v:adj[u]){
     	if(vis[v]){
     		continue;
     	}
     	dfs(v,u);
     	pref[u]+=pref[v];
     }
     if(pref[u]%2){
     	one.insert(mp(min(u,p),max(u,p)));
     }
}

void ini(){
	one.clear();
	qs.clear();
	edges.clear();
	REP(i,N){
		pref[i] = 0;
		in[i] = 0;
		vis[i] = 0;
		adj[i].clear();
		ans[i] = 0;
	}
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  t = 1;
  while(t--){
  	ini();
  	string here = "here";
  	cin >> n >> m;
  	REP(i,m){
  		int a,b;cin >> a >> b;
  		in[b]++;
        adj[a].pb(b);
        adj[b].pb(a);
        edges.pb(mp(min(a,b),max(a,b)));
  	}
  	REP(i,n){
  		if(in[i+1]%2)qs.pb(i+1);
  	}
  	if(qs.size()%2){
  		cout << -1 << endl;
  		continue;
  	}
  	for(int i = 0;i < qs.size();i+=2){
  		pref[qs[i+1]]++;
  		pref[qs[i]]++;
  	}
    dfs(1,1);
    REP(i,m){
       if(one.find(edges[i]) != one.end())swap(edges[i].f,edges[i].s)
       cout << edges[i].f << " " << edges[i].s << endl;
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:123:70: error: expected ';' before 'cout'
  123 |        if(one.find(edges[i]) != one.end())swap(edges[i].f,edges[i].s)
      |                                                                      ^
      |                                                                      ;
  124 |        cout << edges[i].f << " " << edges[i].s << endl;
      |        ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
struct edge{
	int u,v,flag,nxt;
}g[N<<1];
int tot=-1,head[N];
inline void add(int u,int v){
	g[++tot]=edge{u,v,0,head[u]}; head[u]=tot;
	g[++tot]=edge{v,u,0,head[v]}; head[v]=tot;
}
int n,m;
bool vis[N]
int dep[N];
inline void dfs(int u,int fa,int pre){
	int tmp=0; vis[u]=1;
	for(int i=head[u];~i;i=g[i].nxt){
		int v=g[i].v; if(v==fa)continue;
		if(vis[v]&&dep[u]>dep[v]){g[i].flag=1; ++tmp; continue;}else if(vis[v])continue;
		dep[v]=dep[u]+1;dfs(v,u,i); if(g[i].flag)++tmp;
	}
	if((~tmp&1)&&u!=1)g[pre].flag=1;else if(u!=1)g[pre^1].flag=1;
}
int main(){
	memset(head,-1,sizeof(head));
	scanf("%d%d",&n,&m);
	for(int i=1; i<=m; ++i){
		int u,v; scanf("%d%d",&u,&v);
		add(u,v);
	}
	if(m&1)return puts("-1"),0;
	dfs(1,-1,-1);
	for(int i=0; i<=tot; ++i)if(g[i].flag)printf("%d %d\n",g[i].u,g[i].v);
	return 0;
}

Compiler output:
a.cc:14:1: error: expected initializer before 'int'
   14 | int dep[N];
      | ^~~
a.cc: In function 'void dfs(int, int, int)':
a.cc:16:20: error: 'vis' was not declared in this scope
   16 |         int tmp=0; vis[u]=1;
      |                    ^~~
a.cc:19:28: error: 'dep' was not declared in this scope; did you mean 'dup'?
   19 |                 if(vis[v]&&dep[u]>dep[v]){g[i].flag=1; ++tmp; continue;}else if(vis[v])continue;
      |                            ^~~
      |                            dup
a.cc:20:17: error: 'dep' was not declared in this scope; did you mean 'dup'?
   20 |                 dep[v]=dep[u]+1;dfs(v,u,i); if(g[i].flag)++tmp;
      |                 ^~~
      |                 dup
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
struct edge{
	int u,v,flag,nxt;
}g[N<<1];
int tot=-1,head[N];
inline void add(int u,int v){
	g[++tot]=edge{u,v,0,head[u]}; head[u]=tot;
	g[++tot]=edge{v,u,0,head[v]}; head[v]=tot;
}
int n,m;
bool vis[N],dep[N];
inline void dfs(int u,int pre){
	int tmp=0; vis[u]=1;
	for(int i=head[u];~i;i=g[i].nxt){
		int v=g[i].v; if(v==fa)continue;
		if(vis[v]&&dep[u]>dep[v]){g[i].flag=1; ++tmp; continue;}else if(vis[v])continue;
		dep[v]=dep[u]+1;dfs(v,i); if(g[i].flag)++tmp;
	}
	if((~tmp&1)&&u!=1)g[pre].flag=1;else if(u!=1)g[pre^1].flag=1;
}
int main(){
	memset(head,-1,sizeof(head));
	scanf("%d%d",&n,&m);
	for(int i=1; i<=m; ++i){
		int u,v; scanf("%d%d",&u,&v);
		add(u,v);
	}
	if(m&1)return puts("-1"),0;
	dfs(1,-1);
	for(int i=0; i<=tot; ++i)if(g[i].flag)printf("%d %d\n",g[i].u,g[i].v);
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:37: error: 'fa' was not declared in this scope; did you mean 'fma'?
   17 |                 int v=g[i].v; if(v==fa)continue;
      |                                     ^~
      |                                     fma
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define rn return
#define fi first
#define se second
typedef std::pair<int,int> P;
using namespace std;
using ll = long long;


int mainB(){
    int N,M; cin >> N >> M;
    if (M%2 == 1){cout << "-1"; rn 0;}
    vector<vector<int>> g(N);
    rep(i,M){
        int x,y;
        cin >> x >> y; x--;y--;
        g[y].push_back(x);
        g[x].push_back(y);
    }
    
    vector<pair<int,int>> ans;
    vector<int> degree(N,0);
    vector<int> depth(N,-1);
    
    function<void(int,int)> DFS=[&](int v, int pr){
        for(int u:g[v]){
            if (depth[u] == -1){
                depth[u] = depth[v] + 1;
                DFS(u,v);
            }
            else if(depth[u]>depth[v]) {
                degree[v]++;
                ans.emplace_back(v,u);
            }
        }
        if (degree[v]%2 == 1){
            ans.emplace_back(v,pr);
            degree[v]++;
        }
        else{
            if(pr!=-1){
                ans.emplace_back(pr,v);
                degree[pr]++;
            }
        }
    };
    

    
    depth[0] = 0;
    DFS(0,-1);
    
    for (auto& p:ans){
        cout << p.first + 1 << " " << p.second + 1 << endl;
    }
    rn 0;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define rn return
#define fi first
#define se second
typedef std::pair<int,int> P;
using namespace std;
using ll = long long;


int main(){
    int N,M; cin >> N >> M;
    if (M%2 == 1){cout << "-1"; rn 0;}
    vector<vector<int>> g(N);
    rep(i,M){
        int x,y;
        cin >> x >> y; x--;y--;
        g[y].emplace_back(x);
        g[x].emplace_back(y);
    }
    
    
    vector<pair<int,int>> ans;
    vector<int> degree(N,0);
    vector<int> depth(N,-1);
    function<void(int,int)> DFS= [&](int v, int pr){
        for(int u:g[v]){
            if (depth[u] == -1){
                depth[u] = depth[v] + 1;
                DFS(u,v);
            }
            else if(depth[u]>depth[v]) {
                degree[v]++;
                ans.emplace_back(v,u);
            }
        }
        if (degree[v]%2 == 1){
            assert(degree[pr]!=-1);
            ans.emplace_back(v,pr);
            degree[v]++;
        }
        else{
            assert(degree[pr] != -1);
            ans.emplace_back(pr,v);
            degree[pr]++;
        }
    };
    

    
    depth[0] = 0;
    DFS(0,-1);
    
    for (auto& p:ans){
        cout << p.first + 1 << " " << p.second + 1 << endl;
    }
    rn 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'function' was not declared in this scope
   37 |     function<void(int,int)> DFS= [&](int v, int pr){
      |     ^~~~~~~~
a.cc:8:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
    7 | #include <cmath>
  +++ |+#include <functional>
    8 | #define maxs(x,y) x = max(x,y)
a.cc:37:26: error: expression list treated as compound expression in functional cast [-fpermissive]
   37 |     function<void(int,int)> DFS= [&](int v, int pr){
      |                          ^
a.cc:37:14: error: expected primary-expression before 'void'
   37 |     function<void(int,int)> DFS= [&](int v, int pr){
      |              ^~~~
a.cc:63:5: error: 'DFS' was not declared in this scope
   63 |     DFS(0,-1);
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <set>

using namespace std;

using ll = long long;

int par[100010], child[100010] = {0};
set<int> G[100010];
queue<int> q, bottoms;

int main() {
    int n, m;
    cin >> n >> m;
    if (m % 2) {
        cout << -1 << '\n';
        return 0;
    }
    for (int i=0, a, b; i<m; i++) {
        cin >> a >> b;
        a--; b--;
        G[a].insert(b);
        G[b].insert(a);
    }
    fill(par, par+n, -1);
    par[0] = 0;
    q.push(0);
    bool visited[100010] = {0};
    while (!q.empty()) {
        int f = q.front(); q.pop();
        for (auto g:G[f]) {
            if (visited[g]) continue;
            visited[g] = true;
            child[f]++;
            par[g] = f;
            q.push(g);
        }
    }
    vector<int> ans[n];
    for (int i=0; i<n; i++) {
        if (child[i] == 0)
            bottoms.push(i);
        deg[i] = G[i].size();
    }
    while (!bottoms.empty()) {
        int b = bottoms.front(); bottoms.pop();
        for (auto g:G[b]) {
            if (g == par[b] && G[g].size() % 2) {
                ans[g].push_back(b);
            } else {
                ans[b].push_back(g);
                G[g].erase(b);
            }
        }
        child[par[b]]--;
        if (b > 0 && child[par[b]] == 0) bottoms.push(par[b]);
    }
    for (int i=0; i<n; i++)
        for (auto g:ans[i])
            cout << i+1 << ' ' << g+1 << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'deg' was not declared in this scope
   47 |         deg[i] = G[i].size();
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#define ls(x) (x)<<1
#define rs(x) (x)<<1|1
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ll rt<<1
#define rr rt<<1|1
#define PI acos(-1)
#define MM int m=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define Case(i,ans) cout<<"Case "<<i<<": "<<ans<<endl;
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) (x)%mo_num
#define vc vector
#define vct vector<int>
#define fa(i,V) for(auto i:V)
#define out(i) cout<<(i)<<endl;
#define fi first
#define sc second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
//#define P pair<int,int>
using namespace std;
const int INF=LLONG_MAX;
const int maxn=1e6+5;
const int mo_num=1e9+7;
int n,m,a[maxn],b[maxn],ans;
struct node{
    int to,next;
}e[maxn];
int cnt,head[maxn];
void add(int x,int y){
    e[cnt]={y,head[x]};//这一行实现了简洁！
    head[x]=cnt++;
}
int du[maxn],vis[maxn],f[maxn];
void dfs(int to,int from)
{
    vis[v]=1;
    for(int i=head[to];~i;i=e[i].next)
    {
        int v=e[i].to;
        if(v==from)continue;
        if(!vis[v]) {
            dfs(v, to);
        }
        else if(!f[i]){
            f[i]=f[i^1]=1;
            cout<<to<<" "<<v<<endl;
            du[to]^=1;
        }
    }
    if(!from)return;
    if(du[to]%2)cout<<to<<" "<<from<<endl;
    else {
        cout << from << " " << to << endl;
        du[from]^=1;
    }

}
int32_t main()
{
    IOS
    cin>>n>>m;
    memset(head,-1,sizeof head);
    if(m%2)return cout<<-1,0;
    fum(i)
    {
        int u,v;
        cin>>u>>v;
        add(u,v),add(v,u);
    }
    dfs(1,0);
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(long long int, long long int)':
a.cc:55:9: error: 'v' was not declared in this scope
   55 |     vis[v]=1;
      |         ^
Language: C++

#include<bits/stdc++.h>
#define ls(x) (x)<<1
#define rs(x) (x)<<1|1
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ll rt<<1
#define rr rt<<1|1
#define PI acos(-1)
#define MM int m=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define Case(i,ans) cout<<"Case "<<i<<": "<<ans<<endl;
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) (x)%mo_num
#define vc vector
#define vct vector<int>
#define fa(i,V) for(auto i:V)
#define out(i) cout<<(i)<<endl;
#define fi first
#define sc second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
//#define P pair<int,int>
using namespace std;
const int INF=LLONG_MAX;
const int maxn=1e6+5;
const int mo_num=1e9+7;
int n,m,a[maxn],b[maxn],ans;
struct node{
    int to,next;
}e[maxn];
int cnt,head[maxn];
void add(int x,int y){
    e[cnt]={y,head[x]};//这一行实现了简洁！
    head[x]=cnt++;
}
int du[maxn],vis[maxn],f[maxn];
void dfs(int to,int from)
{
    vis[v]=1;
    for(int i=head[to];~i;i=e[i].next)
    {
        int v=e[i].to;
        if(v==from)continue;
        if(!vis[v]) {
            dfs(v, to);
        }
        else if(!f[i]){
            f[i]=f[i^1]=1;
            cout<<to<<" "<<v<<endl;
            du[to]^=1;
        }
    }
    if(!from)return;
    if(du[to]%2)cout<<to<<" "<<from<<endl;
    else cout<<from<<" "<<to<<endl;

}
int32_t main()
{
    IOS
    cin>>n>>m;
    memset(head,-1,sizeof head);
    if(m%2)return cout<<-1,0;
    fum(i)
    {
        int u,v;
        cin>>u>>v;
        add(u,v),add(v,u);
    }
    vis[1]=1;
    dfs(1,0);
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(long long int, long long int)':
a.cc:55:9: error: 'v' was not declared in this scope
   55 |     vis[v]=1;
      |         ^
Language: C++

#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <random>
#include <chrono>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
using lint = long long;

int main() {

	int N, M;
	scanf_s("%d%d", &N, &M);

	if (M % 2 == 1) {
		printf("-1\n");
		return 0;
	}

	int u, v;
	map<pair<int, int>, int> dir;
	vector<vector<int>> edge(N);
	vector<int> out(N);
	for (int i = 0; i < M; i++) {
		scanf_s("%d%d", &u, &v);
		u--, v--;
		edge[u].emplace_back(v);
		edge[v].emplace_back(u);
		if (v < u) swap(u, v);
		dir[{u, v}] = 1; // intial direction is u->v when u < v
		out[u] ^= 1;
	}

	stack<int> que;
	vector<int> used(N);
	int idx = 1;
	que.emplace(0);
	while (!que.empty()) {
		
		int now = que.top();
		que.pop();

		int fliping = out[now];
		DMP(now);
		DMP(fliping);
		
		if (!used[now]) used[now] = idx++;

		bool all_used = true;
		for (const auto &e : edge[now]) {
			if (!used[e]) {
				dir[minmax(now, e)] ^= fliping;
				out[now] ^= fliping;
				out[e] ^= fliping;
				que.emplace(e);
				all_used = false;
				break;
			}
		}

		if (all_used) {
			for (const auto &e : edge[now]) {
				if (used[e] < used[now]) {
					dir[minmax(now, e)] ^= fliping;
					out[now] ^= fliping;
					out[e] ^= fliping;
					que.emplace(e);
					all_used = false;
				}
			}
		}

		if (all_used) break;

	}


	for (int i = 0; i < N; i++) {
		DMP(out[i]);
	}
	for (int i = 0; i < N; i++){
		DMP(used[i]);
	}

	for (auto &e : dir) {
		if (e.second == 1) printf("%d %d\n", e.first.first + 1, e.first.second + 1);
		else printf("%d %d\n", e.first.second + 1, e.first.first + 1);
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   27 |         scanf_s("%d%d", &N, &M);
      |         ^~~~~~~
      |         scanf