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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <climits>
#include <utility>
typedef long long ll;
using namespace std;

int main(void){
  int n, i;
  cin >> n;

  if(n==3){
    printf("2\n");
    printf("1 3\n");
    printf("2 3\n");
  }
  else if(n==4){
    printf("4\n");
    printf("1 2\n");
    printf("1 3\n");
    printf("4 2\n");
    printf("4 3\n");
  }
  else if(n%2){
    printf("%d\n",(n/2)*4);

    printf("%d %d\n",n,1);
    printf("%d %d\n",n,n-1);
    for(i=1;i<n/2;i++){
      printf("%d %d\n",i,i+1);
      printf("%d %d\n",i,n-i-1);
      printf("%d %d\n",n-i,i+1);
      printf("%d %d\n",n-i,n-i-1);
    }
    printf("%d %d\n",n/2,n);
    printf("%d %d\n",n/2+1,n);
  }
  else{
    printf("%d\n",(n/2)*4);

    for(i=1;i<n/2;i++){
      printf("%d %d\n",i,i+1);
      printf("%d %d\n",i,n-i);
      printf("%d %d\n",n-i+1,i+1);
      printf("%d %d\n",n-i+1,n-i);
    }
    printf("%d %d\n",n/2,1);
    printf("%d %d\n",n/2,n);
    printf("%d %d\n",n/2+1,1);
    printf("%d %d\n",n/2+1,n);
  }

  return 0;
}
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <climits>
#include <utility>
typedef long long ll;
using namespace std;

int main(void){
  int n, i;
  cin >> n;

  if(n==3){
    printf("2\n");
    printf("1 3\n");
    printf("2 3\n");
  }
  else if(n==4){
    printf("4\n");
    printf("1 2\n");
    printf("1 3\n");
    printf("4 2\n");
    printf("4 3\n");
  }
  else if(n%2){
    printf("%d\n",(n/2)*4);

    printf("%d %d\n",n,1);
    printf("%d %d\n",n,n-1);
    for(i=1;i<n/2;i++){
      printf("%d %d\n",i,i+1);
      printf("%d %d\n",i,n-i-1);
      printf("%d %d\n",n-i,i+1);
      printf("%d %d\n",n-i,n-i-1);
    }
    printf("%d %d\n",n/2,n);
    printf("%d %d\n",n/2+1,n);
  }
  else{
    printf("%d\n",(n/2)*4);

    for(i=1;i<n/2;i++){
      printf("%d %d\n",i,i+1);
      printf("%d %d\n",i,n-i);
      printf("%d %d\n",n-i+1,i+1);
      printf("%d %d\n",n-i+1,n-i);
    }
    printf("%d %d\n",n/2,1);
    printf("%d %d\n",n/2,n);
    printf("%d %d\n",n/2+1,1);
    printf("%d %d\n",n/2+1,n);
  }

  return 0;
}


Compiler output:
a.cc:74:5: error: redefinition of 'int main()'
   74 | int main(void){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(void){
      |     ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <numeric>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)


using namespace std;



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

	vector<vector<int> > vs;
	for (int i = 1; i <= n / 2; i++) {
		vector<int> v;
		v.push_back(i);
		v.push_back(n - i + 1);
		vs.push_back(v);
	}

	if (n % 2 == 1) {
		vector<int> v;

		v.push_back(n / 2 + 1);
		vs.push_back(v);
	}
	/*
	rep(i, vs.size()) {
		rep(j ,vs[i].size()) {
			cout << vs[i][j] << " ";
		}
		cout << endl;
	}
	cout << "----" << endl;
	*/
	int size = vs.size();
	vector<pair<int, int > > ps;
	if (n % 2 == 0) {
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < vs[i].size(); j++) {

				int prev = (i - 1 + size) % size;

				for (int k = 0; k < vs[prev].size(); k++) {
					ps.push_back(mkp(vs[i][j],vs[prev][k]));
				}
			}	
		}
	} else {
		a[-100000] = 1;



	}
	cout << ps.size() << endl;
	for (auto p : ps) {
		cout << p.first << " " << p.second << endl;
	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:17: error: 'a' was not declared in this scope
   68 |                 a[-100000] = 1;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
void func1(int X,int Y){
  if(X>0){
    rep(i,X-Y,X) cout<<X-Y-1<<" "<<i<<endl;
    rep(i,X-Y,X) cout<<X<<" "<<i<<endl;
    func(X-1,Y-2);
  }
}
signed main(){
  int N; cin>>N;
  if(N%2==0){
    cout<<(N-2)*(N-2)/2+N-2<<endl;
    func1(N,N-2);
  }
  else{
    cout<<N-1+(N-3)/2*(N-3)+N-3<<endl;
    rep(i,0,N) cout<<i<<" "<<N<<endl;
    func1(N-1,N-3);
  }
  }


Compiler output:
a.cc: In function 'void func1(long long int, long long int)':
a.cc:23:5: error: 'func' was not declared in this scope; did you mean 'func1'?
   23 |     func(X-1,Y-2);
      |     ^~~~
      |     func1
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

typedef long long ll;

ll n;
vector<ll> ans1, ans2;

int main()
{
    cin>>n;
    for(ll i = 1; i <= n; i++)
    {
        for(ll j = i + 1; j <= n; j++)
        {
            if(i + j == n / 2 * 2 + 1) continue;
            ans1.push_back(i), ans2.push_back(j);
        }
    }
    cout<<ans1.size()<<endl;
    for(ll i = 0; i < ans1.size(): i++)
    {
        cout<<ans1[i]<<' '<<ans2[i]<<'\n';
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   24 |     for(ll i = 0; i < ans1.size(): i++)
      |                   ^
a.cc:24:34: error: expected ';' before ':' token
   24 |     for(ll i = 0; i < ans1.size(): i++)
      |                                  ^
      |                                  ;
a.cc:28:5: error: expected primary-expression before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:27:6: error: expected ';' before 'return'
   27 |     }
      |      ^
      |      ;
   28 |     return 0;
      |     ~~~~~~
a.cc:28:5: error: expected primary-expression before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:27:6: error: expected ')' before 'return'
   27 |     }
      |      ^
      |      )
   28 |     return 0;
      |     ~~~~~~
a.cc:24:8: note: to match this '('
   24 |     for(ll i = 0; i < ans1.size(): i++)
      |        ^
Language: C++

When you print a rational number, first write it as a fraction 
y
x
, where 
x
,
y
 are integers and 
x
 is not divisible by 
10
9
+
7
 (under the constraints of the problem, such representation is always possible). Then, you need to print the only integer 
z
 between 
0
 and 
10
9
+
6
, inclusive, that satisfies 
x
z
≡
y
(
mod
10
9
+
7
)
.

Compiler output:
a.cc:27:1: error: extended character ≡ is not valid in an identifier
   27 | ≡
      | ^
a.cc:1:1: error: 'When' does not name a type
    1 | When you print a rational number, first write it as a fraction
      | ^~~~
Language: Java

n = int(input())

if n % 2 == 0:
    # 1 <-> n, 2 <-> n-1... is Pair
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            if i + j != n + 1:
                print(str(i) + " " + str(j))
else:
    # Each edge has (sum - N)
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            if i + j != n:
                print(str(i) + " " + str(j))


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n = int(input())
^
Main.java:4: error: illegal character: '#'
    # 1 <-> n, 2 <-> n-1... is Pair
    ^
Main.java:4: error: illegal '.'
    # 1 <-> n, 2 <-> n-1... is Pair
                          ^
Main.java:10: error: illegal character: '#'
    # Each edge has (sum - N)
    ^
4 errors
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}
// http://drken1215.hatenablog.com/entry/2019/03/24/110200
using pint = pair<int, int>;
int main() {
    int N;
    cin >> N;
    vector<pint> res;
    int dame = N;
    if(N % 2 == 1) {
        //奇数なら
        dame--;
    }
    for(int i = 1; i < = N; i++) {
        for(int j = 1; j < = N; j++) {
            if(j <= i | j == dame) {
                continue;
            }
            res.push_back(pint(i, j));
        }
        dame--;
    }
    cout << res.size() << endl;
    for(auto p : res) {
        cout << p.first << " " << p.second << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:24: error: expected primary-expression before '=' token
   46 |     for(int i = 1; i < = N; i++) {
      |                        ^
a.cc:47:28: error: expected primary-expression before '=' token
   47 |         for(int j = 1; j < = N; j++) {
      |                            ^
Language: C++

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

const int MOD = (int)1e9+7;

int main(){
	int N;
	cin >> N;
	
	vector<pair<int,int>> ans;
	if(N%2==0){
		for(int i=1;i<=N;i++){
			for(int j=i+1;j<=N;j++){
				if(i+j==N+1)	continue;
				ans.push_back(make_pair(i,j));
			}
		}
	}
	else{
		for(int i=1;i<=N;i++){
			for(int j=i+1;j<=N;j++){
				if(i+j==N)	continue;
				ans.push_back(make_pair(i,j));
			}
		}
	}
	
	cout << ans.size() << endl;
	for(int i=0;i<count;i++){
		cout << ans.at(i).first << " " << ans.at(i).second << endl;
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   29 |         for(int i=0;i<count;i++){
      |                     ~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int  n;
  cin>>n;
  int d=n/2*2;
  vector<pair<int ,int>> vp;
  for(int  i=1;i<=n;i++)
  {for(int j=i+1;j<=n;j++)
    {
    if(i+j==d+1)continue;
    vp.push_back(i,j);
    
    }}
  cout<<(int) vp.size()<<'\n';
  for(auto e:vp)
    cout<<e.first<<" "<<e.second<<'\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int&, int&)'
   13 |     vp.push_back(i,j);
      |     ~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define w cout 
#define e '\n'

using namespace std;

const int N = 1e6 + 5;

set<pair<int ,int > > ans;
int main(){
	ios::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0);
	int n; cin >> n;
	if(n % 2 == 0) {
		for(int i = 1; i <= n ; i ++) {
			for(int j = i + 1 ; j <= n ; j ++) {
				ans.insert({i , j});
			}
		}
	}
	else {
	for(int i = 1 ; i <= n - 1 ; i ++) {
		for(int j = i + 1 ; j <= n - 1; j ++) {
			if(i != j && j != (n - i)) {
				ans.insert({i , j});
			}
		}
	}
	for(int i = 1 ; i <= n - 1; i ++)
		ans.push_back({i , n});
}
	w << ans.size() << e;
	for(auto i : ans)
		w << i.first << " " << i.second << e;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: 'class std::set<std::pair<int, int> >' has no member named 'push_back'
   30 |                 ans.push_back({i , n});
      |                     ^~~~~~~~~
Language: C++

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

#define rep1(i,N) for(int i=1;i<int(N);++i)

typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

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

vector<int> Iv;
vector<int> Jv;
int N;
int main() {
	cin>>N;
	int X = N;
	if(N%2 == 0)X = N+1;

	int cnt =0;
	rep1(i,N+1)rep1(j,N+1){
		if(i<j)if(i+j!=X){
			cnt++;
			Iv.push_back(i);
			Jv.push_back(j);
		}
	}

	cout<<cnt<<endl;

	rep(i,cnt){
		cout<<Iv[i]<<' '<<Jv[i]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'i' was not declared in this scope
   33 |         rep(i,cnt){
      |             ^
a.cc:33:9: error: 'rep' was not declared in this scope; did you mean 'rep1'?
   33 |         rep(i,cnt){
      |         ^~~
      |         rep1
Language: C++


        
def f3(N,S,M):
    sm=S//M
    l=[]
    for i in range(M):
        l.append([])
    li=[i for i in range(1,N+1)]
    for x in range(M):
        tmp=0
        for i in reversed(range(N)):
            if li[i]==-1:
                continue
            tmp+=li[i]
            if tmp>sm:
                tmp-=li[i]
                if li[sm-tmp-1]==-1:
                    #print(N,sm,"!!!")
                    return
                l[x].append(sm-tmp)
                li[sm-tmp-1]=-1
                break
            l[x].append(li[i])
            li[i]=-1
            if tmp==sm:
                break
    y=0
    for x in range(M):
        y+=len(l[x])*(N-len(l[x]))
    y//=2
    print(y)
    for x in range(M):
        for xi in l[x]:
            for y in range(x+1,M):
                for yi in l[y]:
                    print(xi,yi)
    
    
def min_factor(S):
    for i in range(2,101):
        if S%i==0:
            return i

#24,39

N=int(input())
S=N*(N+1)//2
M=min_factor(S)
f3(N,S,M)

Compiler output:
a.cc:18:22: error: invalid preprocessing directive #print
   18 |                     #print(N,sm,"!!!")
      |                      ^~~~~
a.cc:44:4: error: "," is not a valid filename
   44 | #24,39
      |    ^
a.cc:3:1: error: 'def' does not name a type
    3 | def f3(N,S,M):
      | ^~~
Language: C++

n = int(input())

s = 0
if (n & 1) == 1:
    s = n
    print((n-1) * (n-1) // 2)
else:
    s = n+1
    print((n-2) * n // 2)
for i in range(1, n+1):
    for j in range(i+1, n+1):
        if i + j != s:
            print(i, j)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include "pch.h" 
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <stdio.h>
#include <vector>
#include <time.h>
#include <iomanip>
#include <thread>
#include <atomic>
#include <mutex>
#include <future>
#define double long double
#define int long long
#define low lower_bound
#define upp upper_bound
#define mod 1000000007 //10^9+7
#define inf 10000000000000000 //10^16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
using namespace std;
int n;
signed main() {
	cin >> n;
	vector<pair<int, int>>ans, cnt;
	int sum = n * (n + 1) / 2;
	int k=n;
	if (n % 2) k--;
	rep(i, k) {
		rep(j, k) {
			if (i != j) {
				if (i + j +2*(n%2)!= sum / (k / 2) - n / 2) {
					pair<int, int>a;
					a.first = i + 1;
					a.second = j + 1;
					ans.push_back(a);
					
				}
			}
		}
	}
	if (n % 2 == 1) {
		rep(i, ans.size()) {
			ans[i].first++;
			ans[i].second++;
		}
		rep(i, n - 1) {
			pair<int, int>a;
			a.first = 1;
			a.second = i + 2;
			ans.push_back(a);
		}
	}
	cnt = ans;
	rep(i, cnt.size()) {
		rep(j, cnt.size()) {
			if (i != j) {
				if (ans[i].first == ans[j].second&&ans[i].second == ans[j].first) {
					ans[i].first = 0;
					ans[i].second = 0;
				}
			}
		}
	}
	int cn = 0;
	rep(i, ans.size()) {
		if (ans[i].first) cn++;
	}
	cout << cn << endl;
	rep(i, ans.size()) {
		if (ans[i].first) {
			cout << ans[i].first << " " << ans[i].second << endl;
		}
	}
}

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define FOR(i,n) for(int i = 0;i<n;i++)
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const ll MOD=998244353,INF=1ll<<60;
 
int N;
int used[100010];
 
signed main() {
    IOS();
    cin>>N;
    int s=(N+1)*N/2;
    
    int tmp=s/2;
    vint a,b;
    int flag=0;
    if(s%2)flag=1;
    rrep(i,1,N+1){
        if(tmp>=i){
            a.pb(i);
            tmp-=i;
            used[i]=true;
        }else{
            if(tmp==0)continue;
            a.pb(tmp);
            used[tmp]=true;
            break;
        }
    }
    rep(i,2,N+1){
        if(!used[i])b.pb(i);
    }
    
    cout<<(int)b.size()+(int)b.size()*(int)a.size()<<endl;
    rep(i,0,(int)b.size()){
        cout<<1<<" "<<b[i]<<endl;
    }
    rep(i,0,(int)b.size()){
        rep(j,0,(int)a.size()){
            cout<<b[i]<<" "<<a[j]<<endl;
        }
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:94:14: error: expected '}' at end of input
   94 |     return 0;
      |              ^
a.cc:24:15: note: to match this '{'
   24 | signed main() {
      |               ^
Language: Java

#include<iostream>
using namespace std; // 575

int main() {
	int N;
	cin >> N;
	int M = N * (N - 1) / 2 - N / 2;
	cout << M << endl;
	for (int i = 1;i <= N;++ i) {
		for (int j = i + 1;j <= N;++ j) {
			if (i + j != N / 2 * 2 + 1) cout << i << " " << j << endl;
		}
	}
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

やるだけ
*/

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:6: error: not a statement
	cin >> N;
	    ^
Main.java:8: error: not a statement
	cout << M << endl;
	          ^
Main.java:11: error: not a statement
			if (i + j != N / 2 * 2 + 1) cout << i << " " << j << endl;
			                                                  ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
6 errors
Language: Java

import javafx.util.Pair;

import java.util.*;

//https://atcoder.jp/contests/agc032/tasks/agc032_b
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Set<Integer>> groups = new ArrayList<>();
        if (n % 2 == 0) {
            for (int i = 1; i <= n / 2; i++) {
                Set<Integer> group = new HashSet<Integer>();
                group.add(i);
                group.add(n + 1 - i);
                groups.add(group);
            }
        } else {
            for (int i = 0; i <= n / 2; i++) {
                Set<Integer> group = new HashSet<Integer>();
                if (i > 0) {
                    group.add(i);
                }
                group.add(n - i);
                groups.add(group);
            }
        }
        Set<Pair<Integer, Integer>> edges = new HashSet<>();
        for (int i = 0; i < groups.size(); i++) {
            for (int j : groups.get(i)) {
                for (int k = 0; k < groups.size(); k++) {
                    if (k != i) {
                        for (int l : groups.get(k)) {
                            int min = Math.min(j, l);
                            int max = Math.max(j, l);
                            edges.add(new Pair<Integer, Integer>(min, max));
                        }
                    }
                }
            }
        }
        System.out.println(edges.size());
        for (Pair<Integer, Integer> e : edges) {
            System.out.println(e.getKey() + " " + e.getValue());
        }
    }
}


Compiler output:
Main.java:1: error: package javafx.util does not exist
import javafx.util.Pair;
                  ^
Main.java:28: error: cannot find symbol
        Set<Pair<Integer, Integer>> edges = new HashSet<>();
            ^
  symbol:   class Pair
  location: class Main
Main.java:36: error: cannot find symbol
                            edges.add(new Pair<Integer, Integer>(min, max));
                                          ^
  symbol:   class Pair
  location: class Main
Main.java:43: error: cannot find symbol
        for (Pair<Integer, Integer> e : edges) {
             ^
  symbol:   class Pair
  location: class Main
4 errors
Language: C++

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

using ll = long long;
using vll = vector<ll>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll (x);cin >>(x);
#define stin(x) str (x);cin >>(x);
#define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
#define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>b[i];}
#define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
#define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
#define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
#define SORT(x) sort(x.be, x.en)
#define rSORT(x) sort(x.rbegin(), x.rend())
#define say(x) cout<<(x);
#define sal(x) cout<<(x)<<endl;
#define says(x) cout<<(x)<<(' ');
#define sas cout<<(' ');
#define sayR(x) cout<<fixed<<setprecision(10)<<(x);
#define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
#define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define pow(a,b) ll(pow(a,b))

ll MOD=1000000007;

signed main(){
	llin(n);
	ll a=0;
	FOR(i,1,n){
		a+=i;
	}
	ll g=0;
	FOR(i,2,n){
		if(a%i==0){
			g=i;
			break;
		}
	}
	vector<vll> d(g,vll(0,0));
	ll h=0;
	ll y=0;
	vll dd(g,a/g);
	rFOR(i,1,n){
		if(dd[h]>=i){
			d[h].pb(i);
			dd-=i;
		}else{
			i--;
		}
		if(y==0){
			if(h<g-1){
				h++;
			}else{
				y=1;
			}
		}else{
			if(h>0){
				h--;
			}else{
				y=0;
			}
		}
	}
	ll w=d[0].sz*d[g-1].sz;
	if(g==2) w=0;
	FOR(i,0,g-2){
		w+=d[i].sz*d[i+1].sz;
	}
	sal(w);
	FOR(i,0,g-2){
		FOR(j,0,d[i].sz-1){
			FOR(k,0,d[i+1].sz-1){
				says(d[i][j]);
				sal(d[i+1][k]);
			}
		}
	}
	if(g!=2){
		FOR(j,0,d[g-1].sz-1){
			FOR(k,0,d[0].sz-1){
				says(d[g-1][j]);
				sal(d[0][k]);
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:27: error: no match for 'operator-=' (operand types are 'vll' {aka 'std::vector<long long int>'} and 'll' {aka 'long long int'})
   63 |                         dd-=i;
      |                         ~~^~~
Language: C++

//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
vector<int> g[100005];
fun(int x,int y,int n){
	cout<<x<<" "<<y<<endl;
	cout<<x<<" "<<n-y+1<<endl;
	cout<<n-x+1<<" "<<y<<endl;
	cout<<n-x+1<<" "<<n-y+1<<endl;
}
int main(){
	int n;cin>>n;
	int y=n/2;
	int x=2*y*(y-1);
	if(n%2)
	cout<<x+n-1<<endl;
	else cout<<x<<endl;
	if(n%2){
		for(int i=1;i<=n-1;i++)cout<<i<<" "<<n<<endl;
		n=n-1;
	}
		for(int i=1;i<=n/2;i++){
			for(int j=i+1;j<=n/2;j++){
				fun(i,j,n);
			}
		}
}

Compiler output:
a.cc:20:1: error: ISO C++ forbids declaration of 'fun' with no type [-fpermissive]
   20 | fun(int x,int y,int n){
      | ^~~
a.cc: In function 'int fun(int, int, int)':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cstdlib>
using namespace std;
const int N=2e5+5,YL=1e9+7;
inline int MO(const int &x){return x>=YL?x-YL:x;}
inline int in(){int k;cin>>k;return k;}
int a[N],p[N],b[N],mp[N];
inline int low(int x){return x&(-x);}
int n,tot;
typedef std::pair<int,int> P;
#define mk make_pair
std::vector<P>ans;
inline void work(int n)
{
	for(int i=1;i<=n;++i)
		for(int j=i+1;j<=n;++j)
			if(i+j!=n+1)ans.push_back(mk(i,j));
}
int main()
{
	ios::sync_with_stdio(0);
	cin>>n;if(n&1)work(n-1);else work(n);
	if(n&1)for(int i=1;i<n;++i)ans.push_back(mk(i,n));
	printf("%d\n",ans.size());
	for(P x:ans)printf("%d %d\n",x.first,x.second);
	return 0;
}


Compiler output:
a.cc:15:6: error: 'vector' in namespace 'std' does not name a template type
   15 | std::vector<P>ans;
      |      ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include<cstdlib>
  +++ |+#include <vector>
    6 | using namespace std;
a.cc: In function 'void work(int)':
a.cc:20:37: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                         if(i+j!=n+1)ans.push_back(mk(i,j));
      |                                     ^~~
      |                                     abs
a.cc: In function 'int main()':
a.cc:26:36: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         if(n&1)for(int i=1;i<n;++i)ans.push_back(mk(i,n));
      |                                    ^~~
      |                                    abs
a.cc:27:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |         printf("%d\n",ans.size());
      |                       ^~~
      |                       abs
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#define SF scanf
#define PF printf
#define MAXN 100010
using namespace std;
int n;
vector<pair<int,int> >ans;
int main(){
	SF("%d",&n);
	if(n%2==1){
		for(int i=1;i<n;i++)
			ans.push_back(make_pair(i,n));	
		n--;
	}
	if(n>2){
		for(int i=1;i<=n;i++)
			for(int j=i+1;j<=n;j++)
				if(i+j!=n+1)
					ans.push_back(make_pair(i,j));
	}
	PF("%d\n",ans.size());
	for(int i=0;i<int(ans.size());i++)
		PF("%d %d\n",ans[i].first,ans[i].second);
}

Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<pair<int,int> >ans;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:14:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |                         ans.push_back(make_pair(i,n));
      |                         ^~~
      |                         abs
a.cc:21:41: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |                                         ans.push_back(make_pair(i,j));
      |                                         ^~~
      |                                         abs
a.cc:23:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         PF("%d\n",ans.size());
      |                   ^~~
      |                   abs
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=105;

int n;
vector<pair<int,int>> ans;

int main()
{
    scanf("%d",&n);
    if(n%2==0)
    {
        printf("%d\n",n);
        int u=1,v=2;
        printf("%d %d\n",u,v);
        for(int i=2;i<=n;i++)
        {
            int w=n+1-u;
            printf("%d %d\n",v,w);
            u=v;
            v=w;
        }
    }
    else
    {
        for(int i=1;i<n;i++)
            for(int j=i+1;j<=n;j++)
                if(i+j!=n)
                    ans.push_back(make_pair(i,j));
        printf("%u\n",ans.size());
        for(auto u:ans)
            printf("%d %d\n",u.first,u.second);
    }
    return 0;
}


Compiler output:
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<pair<int,int>> ans;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:31:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |                     ans.push_back(make_pair(i,j));
      |                     ^~~
      |                     abs
a.cc:32:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         printf("%u\n",ans.size());
      |                       ^~~
      |                       abs
Language: C++

#include <bits/stdc++.h>

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver2 {
 public:
  int n, m;
  vector<map<int, int>> t;
  Solver2(LL n, LL m) : n(n), m(m), t(n){};

  void solve() {
    for (int i = 0; i < m; ++i) {
      int a, b;
      cin >> a >> b;
      t[--a][--b] = 0;
      t[b][a] = 0;
    }
    bool ans = true;
    int ans2 = 0;
    int cnt6 = 0;
    vector<int> v4;
    for (int i = 0; i < n; ++i) {
      if (t[i].size() % 2) ans = false;
      ans2 += max(0, (int)t[i].size() - 2);
      if (t[i].size() >= 6) cnt6++;
      if (t[i].size() == 4) v4.push_back(i);
    }
    if (ans && ans2 >= 4) {
      if (ans2 >= 6 || cnt6) {
        cout << "Yes" << endl;
      } else {
        cout << (check(v4[0], v4[1]) ? "Yes" : "No") << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
  bool check(int s, int v) {
    int now = s;
    vector<int> res;
    while (1) {
      if (now == s || now == v) {
        res.push_back(now);
      }
      bool found = false;
      for (auto e : t[now]) {
        if (e.second == 0) {
          t[now][e.first] = 1;
          t[e.first][now] = 1;
          now = e.first;
          found = true;
          break;
        }
      }
      if (!found) break;
    }
    res.pop_back();
    for (int i = 0; i < res.size(); ++i) {
      rotate(res.begin(), res.begin() + 1, res.end());
      if (res[0]==res[1]]) return true;
    }
    return false;
  }
};
}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0, m;
  std::cin >> n >> m;

  Problem::Solver2 sol(n, m);
  sol.solve();
  return 0;
}


Compiler output:
a.cc: In member function 'bool Problem::Solver2::check(int, int)':
a.cc:77:25: error: expected ')' before ']' token
   77 |       if (res[0]==res[1]]) return true;
      |                         ^
a.cc:77:10: note: to match this '('
   77 |       if (res[0]==res[1]]) return true;
      |          ^
a.cc:77:25: error: expected primary-expression before ']' token
   77 |       if (res[0]==res[1]]) return true;
      |                         ^
Language: C++

#include <bits/stdc++.h>
#define N 100005

using namespace std;

int n, m;
int deg[N], cnt[8];
int head[N], nex[N << 1], to[N << 1], cntE;
bool vis[N];

inline void addE(int u, int v) {
	to[++cntE] = v;
	nex[cntE] = head[u], head[u] = cntE;
}

int A, B;
void dfs(int u, int fa) {
	if(u == A && fa) {
		puts("Yes");
		exit(0);
	}
	if(u == B) return;
	vis[u] = true;
	for(int i = head[u]; i; i = nex[i]) {
		int v = to[i];
		if(v == fa || (deg[v] == 4 && v != str)) continue;
		if(!vis[v] || v == str)
			dfs(v, u);
	}
}

int main() {
	scanf("%d %d", &n, &m);
	for(int i = 1, u, v; i <= m; ++i) {
		scanf("%d %d", &u, &v);
		addE(u, v), addE(v, u);
		++deg[u], ++deg[v];
	}
	
	for(int i = 1; i <= n; ++i)
		if(deg[i] & 1) {
			puts("No");
			return 0;
		} else {
			if(deg[i] > 4) ++cnt[6];
			else if(deg[i] < 4) ++cnt[deg[i]];
			else ++cnt[4];
		}
	
	if(cnt[6] || (cnt[4] > 2)) {
		puts("Yes");
		return 0;
	} else if(cnt[4] == 2) {
		for(int i = 1; i <= n; ++i)
			if(cnt[i] == 4) {
				if(!A) A = i;
				else {
					B = i;
					break;
				}
			}
		dfs(A, 0);
	}
	puts("No");
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:26:52: error: 'str' was not declared in this scope; did you mean 'std'?
   26 |                 if(v == fa || (deg[v] == 4 && v != str)) continue;
      |                                                    ^~~
      |                                                    std
a.cc:27:36: error: 'str' was not declared in this scope; did you mean 'std'?
   27 |                 if(!vis[v] || v == str)
      |                                    ^~~
      |                                    std
Language: C++

#include <bits/stdc++.h>
#define N 100005

using namespace std;

int n, m;
int cnt[10], cntloop;
int head[N], nex[N << 1], to[N << 1], cntE;
bool vis[N], inStack[N];

inline void addE(int u, int v) {
	to[++cntE] = v;
	nex[cntE] = head[u], head[u] = cntE;
}

void dfs(int u, int fa) {
	vis[u] = inStack[u] = true;
	for(int i = head[u]; i; i = nex[i]) {
		int v = to[i];
		if(v == fa) continue;
		if(!vis[v]) {
			dfs(v, u);
		} else if(inStack[v]) {
			++cntloop;
		}
	}
	inStack[u] = false;
}

int main() {
	scanf("%d %d", &n, &m);
	for(int i = 1, u, v; i <= m; ++i) {
		scanf("%d %d", &u, &v);
		addE(u, v), addE(v, u);
		++deg[u], ++deg[v];
	}
	
	for(int i = 1; i <= n; ++i)
		if(deg[i] & 1) {
			puts("No");
			return 0;
		} else {
			if(deg[i] > 4) ++cnt[6];
			else if(deg[i] < 4) ++cnt[deg[i]];
			else ++cnt[4];
		}
		
	dfs(1, 0);
	
	if(cntloop < 3) {
		puts("No");
		return 0;
	}
	puts("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: 'deg' was not declared in this scope
   35 |                 ++deg[u], ++deg[v];
      |                   ^~~
a.cc:39:20: error: 'deg' was not declared in this scope
   39 |                 if(deg[i] & 1) {
      |                    ^~~
Language: C++

using namespace std;
const int maxn = 100000 + 10;
const int maxm = 100000 + 10;

int n, m, h[maxn], ecnt, deg[maxn], S1, S2;
struct enode{
	int v, n;
	enode() {}
	enode(int _v, int _n):v(_v), n(_n) {}
}e[maxm << 1];

inline void addedge(int u, int v) { ecnt ++; e[ecnt] = enode(v,h[u]); h[u] = ecnt; }

int vis[maxn];
void dfs(int u, int fa) {
	vis[u] = 1;
	for(int i = h[u];~ i;i = e[i].n) {
		int v = e[i].v;
		if(v == fa) continue;
		if(v == S1) A;
		if(vis[v] || v == S2) continue;
		dfs(v,u);
	}
}

int main() {
	scanf("%d%d", &n, &m); ecnt = 0;
	memset(h,-1,sizeof(h));
	for(int i = 1;i <= m;i ++) {
    int u, v;
		scanf("%d%d", &u, &v);
		addedge(u,v);
		addedge(v,u);
		deg[u] ++; deg[v] ++;
	}
	int cnt4 = 0, flag = 0; S1 = -1, S2 = -1;
	for(int i = 1;i <= n;i ++) {
		if(deg[i] < 4) continue;
		if(deg[i] >= 6) flag = 1;
		if(deg[i] == 4) {
			cnt4 ++;
			if(~ S1) S2 = i;
			else S1 = i;
		}
	}
	if(flag || cnt4 > 2) A;
	if(cnt4 < 2) B;
	dfs(S1,0);
	B;
	return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:20:29: error: 'A' was not declared in this scope
   20 |                 if(v == S1) A;
      |                             ^
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf' was not declared in this scope
   27 |         scanf("%d%d", &n, &m); ecnt = 0;
      |         ^~~~~
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(h,-1,sizeof(h));
      |         ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | using namespace std;
a.cc:46:30: error: 'A' was not declared in this scope
   46 |         if(flag || cnt4 > 2) A;
      |                              ^
a.cc:47:22: error: 'B' was not declared in this scope
   47 |         if(cnt4 < 2) B;
      |                      ^
a.cc:49:9: error: 'B' was not declared in this scope
   49 |         B;
      |         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef vector<int> vi;
struct node{
int depth = -1;
int low;
int parent;
bool vis = false;
bool isArti = false;
vi adj;
};

vector<set<int> > biconnected;
stack<int> s;

static node g[100005];
void dfs(int u){
    if(g[u].depth == -1) g[u].depth = g[g[u].parent].depth + 1;
    g[u].low = g[u].depth;
    g[u].vis = true;
    for(int i = 0;i < g[u].adj.size();i++){
        int v = g[u].adj[i];
        if(!g[v].vis){
            g[v].parent = u;
            s.push(u);
            dfs(v);
            g[u].low = min(g[u].low,g[v].low);

            if(g[v].low >= g[u].depth){
                g[u].isArti = true;
                g[u].low = min(g[u].low,g[v].low);
                set<int> newSet;
                int nn;
                biconnected.push_back(newSet);
                do{
                    nn = s.top();
                    s.pop();
                    biconnected.back().insert(nn);
                }while(nn != u);
            }
        }
        else if(v != g[u].parent){
            g[u].low = min(g[u].low,g[v].depth);
        }
        s.push(u);
    }
}
int main()
{
    //freopen("i.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    for(int i = 0;i < m;i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].adj.push_back(b);
        g[b].adj.push_back(a);
    }

    for(int i = 0;i < n;i++){
        if(g[i].adj.size() % 2 == 1){
            cout << "No\n";
            return 0;
        }
    }

    //if(m - n < 2) cout << "No\n";
    else cout << "Yes\n";
    return 0;
}


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

#include <bits/stdc++.h>
#define ll long long
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
using namespace std;
const int N = 1e5 + 7;

#define inc(i, x, y) for (int i = x; i <= y; ++i)
#define dec(i, x, y) for (int i = x; i >= y; --i)
#define gc getchar

bool chkmin(int &x, int y) { return x > y ? x = y, 1 : 0; }
bool chkmax(int &x, int y) { return x < y ? x = y, 1 : 0; }

int rd() {
	int ret = 0; bool fl = 0; char ch = 0;
	while (!isdigit(ch)) fl |= (ch == '-'), ch = gc();
	while (isdigit(ch)) ret = (ret << 1) + (ret << 3) + (ch ^ 48), ch = gc();
	return fl ? -ret : ret;
}

vector <int> G[N], F;
int deg[N];

void adde(int u, int v) {
	++deg[u], ++deg[v];
	G[u].push_back(v), G[v].push_back(u);
}

int fs, se;
bool vis[N], cnt_1, cnt_2, cnt_3;

bool dfs(int u, int fa) {
	vis[u] = 1;
	inc(i, 0, (signed)G[u].size() - 1) {
		if (G[u][i] == fa) continue;
		if (G[u][i] == fs) return true;
		if (!vis[G[u][i]]) if dfs(G[u][i], u) return true;
	}
	return false;
}

int main() {
	int n = rd(), m = rd();
	inc(i, 1, m) adde(rd(), rd());
	inc(i, 1, n) {
		if (deg[i] & 1) return puts("No"), 0;
		else if (deg[i] > 4) cnt_3++;
		else if (deg[i] == 4) cnt_2++;
		else cnt_1++;
	}
	if (cnt_3) return puts("Yes"), 0;
	if (cnt_2 > 2) return puts("Yes"), 0;
	if (cnt_2 < 2) return puts("No"), 0;
	inc(i, 1, n) if (deg[i] == 4) se = fs, fs = i;
	vis[se] = 1;
	puts(dfs(fs, -1) ? "Yes" : "No");
}

Compiler output:
a.cc: In function 'bool dfs(int, int)':
a.cc:37:39: error: expected '(' before 'dfs'
   37 |                 if (!vis[G[u][i]]) if dfs(G[u][i], u) return true;
      |                                       ^~~
      |                                       (
a.cc: In function 'int main()':
a.cc:47:38: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   47 |                 else if (deg[i] > 4) cnt_3++;
      |                                      ^~~~~
a.cc:48:39: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   48 |                 else if (deg[i] == 4) cnt_2++;
      |                                       ^~~~~
a.cc:49:22: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   49 |                 else cnt_1++;
      |                      ^~~~~
Language: C++

/*
Rathin Bhargava
IIIT Bangalore

*/
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"INF " : cout<<v[i]<<" "; } cout<<endl;}
#define t1(x)                cerr<<#x<<" : "<<x<<endl
#define t2(x, y)             cerr<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define t3(x, y, z)          cerr<<#x<<" : " <<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl
#define t4(a,b,c,d)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<endl
#define t5(a,b,c,d,e)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<endl
#define t6(a,b,c,d,e,f)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<" "<<#f<<" : "<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define t(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define _ cerr<<"here"<<endl;
#define __ {ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

using namespace std;
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){ return out<<"("<<a.first<<", "<<a.second<<")";}
template <int> ostream& operator<<(ostream& os, const vector<int>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { if(v[i]!=INF) os << v[i]; else os << "INF";if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; ;if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 

const int N = 1e5+100;
vector<int> adj[N] = {};
vector<int> vis(N);
map< pair<int,int> , int> edges;

int dfs(int u,int root, int root2,int parent)
{
  while(u!= root && u != root2)
  {
    u = adj[u][0] + adj[u][1] - parent;
    parent = u;
  }
  if(u==root2) return 1;
  return 0;
}

int main()
{
  __;
  int n,m;
  cin >> n >> m;
  for(int i=0;i<m;i++)
  {
    int a,b;
    cin >> a >> b;
    a--; b--;

    adj[a].pu(b);
    adj[b].pu(a);
    edges[{a,b}] = edges[{b,a}] = 0;
  }

  bool boo = false;
  int idx = -1;
  int cnt = 0;
  vector<int> id;
  for(int i=0;i<n;i++) if(adj[i].size()%2==1) {cout << "No" << endl; return 0;}

  for(int i=0;i<n;i++)
  {
    if(adj[i].size() >= 6) {cout << "Yes" << endl; return 0;}
    else if(adj[i].size() == 4) {cnt++;id.pu(i);boo = true;}
  }

  if(cnt>2) {cout << "Yes" << endl; return 0;}
  else if (cnt <=1) {cout << "No" << endl; return 0;}


  int root = id[0], root2 = id[1];

  int cnt = 0;
  for(auto v : adj[root])
  {
    cnt += dfs(v,root,root2,root);
  }
  
  if(cnt == 4) cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}



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

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

multiset<int> edge[100005];
int memo[100005],f=0;

void dfs(int now)
{
	for (auto i = edge[now].begin(); i != edge[now].end(); ++i)
	{
		if (memo[*i]==1)
		{
			f=1;
		}
		else if (memo[*i]==-1)
		{
			memo[*i]=0;
			edge[*i].erase(now);
			dfs(*i);
		}
	}
}

int main(int argc, char const *argv[])
{
	int n,m;
	cin>>n>>m;
	int a,b;
	for (int i = 0; i < m; ++i)
	{
		cin>>a>>b;--a;--b;
		edge[a].insert(b);
		edge[b].insert(a);
	}
	int s=-1,cnt=0;
	for (int i = 0; i < n; ++i)
	{
		if (edge[i].size()%2==1)
		{
			cout<<"No\n";
			return 0;
		}
		else if (edge[i].size()>=6)
		{
			cnt=100;
		}
		else if (edge[i].size()==4)
		{
			++cnt;
			else if (cnt==1)
			{
				s=i;
			}
			else
			{
				edge[i]={};
			}
		}
	}
	if (cnt>=3)
	{
		cout<<"Yes\n";
		return 0;
	}
	else if (cnt<=1)
	{
		cout<<"No\n";
		return 0;
	}
	for (int i = 0; i < n; ++i)
	{
		memo[i]=-1;
	}
	memo[s]=1;
	dfs(s);
	if (f==1)
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:50:25: error: expected '}' before 'else'
   50 |                         else if (cnt==1)
      |                         ^~~~
a.cc:48:17: note: to match this '{'
   48 |                 {
      |                 ^
a.cc: At global scope:
a.cc:60:9: error: expected unqualified-id before 'if'
   60 |         if (cnt>=3)
      |         ^~
a.cc:65:9: error: expected unqualified-id before 'else'
   65 |         else if (cnt<=1)
      |         ^~~~
a.cc:70:9: error: expected unqualified-id before 'for'
   70 |         for (int i = 0; i < n; ++i)
      |         ^~~
a.cc:70:25: error: 'i' does not name a type
   70 |         for (int i = 0; i < n; ++i)
      |                         ^
a.cc:70:32: error: expected unqualified-id before '++' token
   70 |         for (int i = 0; i < n; ++i)
      |                                ^~
a.cc:74:9: error: 'memo' does not name a type
   74 |         memo[s]=1;
      |         ^~~~
a.cc:75:12: error: expected constructor, destructor, or type conversion before '(' token
   75 |         dfs(s);
      |            ^
a.cc:76:9: error: expected unqualified-id before 'if'
   76 |         if (f==1)
      |         ^~
a.cc:80:9: error: expected unqualified-id before 'else'
   80 |         else
      |         ^~~~
a.cc:84:9: error: expected unqualified-id before 'return'
   84 |         return 0;
      |         ^~~~~~
a.cc:85:1: error: expected declaration before '}' token
   85 | }
      | ^