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

#include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
	cin>>a;
	for(int s=a.size()-1;s>=0;s--)
	b=b+a[s];
	for(int s=0;s<b.size();s++)
	{
		switch(b)
		{
			case 'p':b[s]='q';break;
			case 'q':b[s]='p';break;
			case 'b':b[s]='d';break;
			case 'd':b[s]='b';break;
		}
	}
	if(b==a)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: switch quantity not an integer
   11 |                 switch(b)
      |                        ^
Language: C++

#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
char a[2000000],b[2000000],a1=0;
int main()
{
	while(cin>>a[i]&&a[i]!=EOF) a1++;
     int len=a1;
     for(int i=0;i<len;i++)
     {
         if(a[i]=='b')b[i]='d';
         if(a[i]=='d')b[i]='b';
         if(a[i]=='p')b[i]='q';
         if(a[i]=='q')b[i]='p';
     }
     bool flag=true;
     for(int i=0;i<len;i++)
     {
         if(a[i]!=b[len-i-1]){flag=false;break;}
     }
      if(flag==1) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'i' was not declared in this scope
   10 |         while(cin>>a[i]&&a[i]!=EOF) a1++;
      |                      ^
Language: C++

#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
string a,b;
int main()
{
     cin>>a;
	 int len=a.size();
	 for(int i=0;i<len;i++)
	 {
		 if(a[i]=='b')b[i]='d';
		 if(a[i]=='d')b[i]='b';
		 if(a[i]=='p')b[i]='q';
		 if(a[i]=='q')b[i]='p';
	 }
	 bool flag=true;
	 for(int i=0,j=b.size-1;i<len,j>=0;i++,j--)
	 {
		 if(a[i]!=b[j]){flag=false;break;}
	 }
      if(flag==1) cout<<"Yes"<<endl;
	  else cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   20 |          for(int i=0,j=b.size-1;i<len,j>=0;i++,j--)
      |                        ~~^~~~
      |                              ()
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define PQ2(T) priority_queue<T>
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) ((x)=min((x),(y)))
#define chmax(x,y) ((x)=max((x),(y)))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
#define DEBUG(x) cerr<<"line ("<<__LINE__<<")  "<<#x<<": "<<x<<endl;
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string s, t;
	cin>>s;
	t = s;
	reverse(all(t));
	rep(i, t.size()){
		if(t[i]=='b') t[i] = 'd';
		if(t[i]=='d') t[i] = 'b';
		if(t[i]=='p') t[i] = 'q';
		if(t[i]=='q') t[i] = 'p';
	}
	cout<<(s==t:"Yes":"No")<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:20: error: expected ')' before ':' token
   66 |         cout<<(s==t:"Yes":"No")<<endl;
      |               ~    ^
      |                    )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'}, 
int main() {
	string S;
	cin >> S;
	int L = S.length();
	bool result = true;
	for(int i = 0; i < L; i++) {
		switch(S[i]) {
			case 'd':
				if(S[L - i - 1] != 'b') result = false;
				break;
			case 'b':
				if(S[L - i - 1] != 'd') result = false;
				break;
			case 'p':
				if(S[L - i - 1] != 'q') result = false;
				break;
			case 'q':
				if(S[L - i - 1] != 'p') result = false;
				break;
		}
	}
	cout << (result ? "Yes" : "No") << endl;
	return 0;
}

Compiler output:
a.cc:4:1: error: expected primary-expression before 'int'
    4 | int main() {
      | ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:13: note: to match this '{'
    3 | int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'},
      |             ^
a.cc:3:5: error: scalar object 'array' requires one element in initializer
    3 | int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'},
      |     ^~~~~
a.cc:4:1: error: expected ',' or ';' before 'int'
    4 | int main() {
      | ^~~
Language: C++

#include<iostream>
#include<iomanip>
#include<string>


#define rep(i,n) for(int i = 0; i < n; ++i)
#define all(x) x.begin(),x.end()
using namespace std;

int main(void){
  string s;
  cin >> s;
  string t(s);
  reverse(all(t));

  for(int i = 0; i < t.size(); ++i){
    switch(t[i]){
      case 'p':
        t[i] = 'q';
        break;
      case 'q':
        t[i] = 'p';
        break;
      case 'd':
        t[i] = 'b';
        break;
      case 'b':
        t[i] = 'd';
        break;
    }
  }

  if( s == t){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'reverse' was not declared in this scope
   14 |   reverse(all(t));
      |   ^~~~~~~
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main(){
	string s;
	cin>>s;
	string t=s;
	reverse(s.begin(),s.end());
	for(auto &i:s){
		if(i=='b')
			i=d;
		else if(i=='d')
			i=b;
		else if(i=='p')
			i=q;
		else if(i=='q')
			i=p;
	}
	if(s==t)
		cout<<"Yes";
	else
		cout<<"No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: 'd' was not declared in this scope
   10 |                         i=d;
      |                           ^
a.cc:12:27: error: 'b' was not declared in this scope
   12 |                         i=b;
      |                           ^
a.cc:14:27: error: 'q' was not declared in this scope
   14 |                         i=q;
      |                           ^
a.cc:16:27: error: 'p' was not declared in this scope
   16 |                         i=p;
      |                           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    string S1,S2;
    cin>>S1;
    S2=S1;
    reverse(S1.begin(),S2.end());
    bool ans=true;
    for(int i=0;i<S1.size();i++){
        if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p')){
            ans=false;
            break;
        }
    }
    cout<<(ans?"Yes":"No")<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
    8 |     reverse(S1.begin(),S2.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    string S1,S2;
    cin>>S1;
    S2=S1;
    reverse(S1.begin(),S2.end());
    bool ans=true;
    for(int i=0;i<S1.size();i++){
        if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p'){
            ans=false;
            break;
        }
    }
    cout<<(ans?"Yes":"No")<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
    8 |     reverse(S1.begin(),S2.end());
      |     ^~~~~~~
a.cc:11:114: error: expected ')' before '{' token
   11 |         if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p'){
      |           ~                                                                                                      ^
      |                                                                                                                  )
a.cc:15:5: error: expected primary-expression before '}' token
   15 |     }
      |     ^
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner don = new Scanner(System.in);
		String[] an,bn;
		String as;
		an = new String[4];
		bn = new String[4];
		as = don.next();
		for(int i=0;i<4;i++){
			if(String.valueOf(as.charAt(i)).equals("d")){
				an[i]="d";
				bn[i]="b";
			}else if(String.valueOf(as.charAt(i)).equals("b")){
				an[i]="b";
				bn[i]="d";
			}else if(String.valueOf(as.charAt(i)).equals("p")){
				an[i]="p";
				bn[i]="q";
			}else{
				an[i]="q";
				bn[i]="p";
			}
		}
		if(as.equals(bn[3]+bn[2]+bn[1]+bn[0])){
			System.out.println("yes");
		}else{
			System.out.println("no");
		}
	}

Compiler output:
Main.java:30: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
bool mirror(const char &a,const char &b);
int main()
{
    char s[100000];
    scanf("%s",&s);
        int i ;
        int l = strlen(s);
        int mk = 0 ;
    for(i = 0 ;i < l/2 ;i++)
    {
        bool k  = mirror(s[i],s[l-i-1]);
        if(!k||l%2!=0)
        {
            cout << "No\n";
            mk = 1;
            break;
        }
    }


    else if(i == l/2)
    {
        cout << "Yes\n";
    }
    else
    {
        if(mk == 0)
        {
            cout << "No\n";
        }

    }
    return 0;
}

bool mirror(const char &a,const char &b)
{
    if((a == 'b' && b == 'd') ||(a == 'd' && b == 'b')
       || (a == 'p' && b == 'q') ||(a == 'q' && b == 'p'))
    {
        return true;
    }
    else
    {
        return false;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'else' without a previous 'if'
   25 |     else if(i == l/2)
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<queue>
using namespace std;
int n,ans=2,a[262144],b[262144],p1,p2;
int fang (int a,int b)
{
    for(int i=1;i<a;i++)
    {
        b=2*b;
    }
    return b;
}
int main()
{
    cin>>n;
    ans=fang(n,ans);
    p1=1;p2=1;
    for(int i=1;i<=ans;i++)
    {
        if(i%2==1)
        {
            cin>>a[p1];
            p1++;
        }
        else
        {
            cin>>b[p2];
            p2++;
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=ans)
    }
}



















Compiler output:
a.cc: In function 'int main()':
a.cc:38:27: error: expected ';' before ')' token
   38 |         for(int j=1;j<=ans)
      |                           ^
      |                           ;
a.cc:39:5: error: expected primary-expression before '}' token
   39 |     }
      |     ^
Language: C++

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

int main(){
  int a,b;
  cin>>a;
  b=1;
  for(int i=0;i<a;i++)
    b=b*2;
  vector<int> c(b);
  for(int i=0;i<b;i++)
    cin>>c.at(i);
  for(int i=0;i<b-1;i++)
    if(c.at(i)>c.at(i+1)){
      c.at(i)-=c.at(i+1);
      c.erase(c.begin()+i+1);
      }
    else if(c.at(i)==c.at(i+1))
      c.erase(c.begin()+i+1);
    else{
      c.at(i+1)-=c.at(i);
      c.erase(c.begin()+i);
      }
  if(c.size()==1)
    break;
  if(i==c.size()-1)
    i=0;
  }
cout<<c.at(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: break statement not within loop or switch
   25 |     break;
      |     ^~~~~
a.cc:26:6: error: 'i' was not declared in this scope
   26 |   if(i==c.size()-1)
      |      ^
a.cc: At global scope:
a.cc:29:1: error: 'cout' does not name a type
   29 | cout<<c.at(0)<<endl;
      | ^~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main(){
  int a,b;
  cin>>a;
  b=1;
  for(int i=0;i<a;i++)
    b=b*2;
  vector<int> c(b);
  for(int i=0;i<b;i++)
    cin>>c.at(i);
  for(int i=0;i<b-1;i++)
    if(c.at(i)>c.at(i+1)){
      c.at(i)-=c.at(i+1);
      c.erase(c.begin()+i+1);
      }
    else if(c.at(i)==c.at(i+1))
      c.erase(c.begin()+i+1);
    else{
      c.at(i+1)-=c.at(i);
      c.erase(c.begin()+i);
      }
  if(c.size==1)
    break;
  if(i==c.size()-1)
    i=0;
  }
cout<<c.at(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   24 |   if(c.size==1)
      |      ~~^~~~
      |            ()
a.cc:25:5: error: break statement not within loop or switch
   25 |     break;
      |     ^~~~~
a.cc:26:6: error: 'i' was not declared in this scope
   26 |   if(i==c.size()-1)
      |      ^
a.cc: At global scope:
a.cc:29:1: error: 'cout' does not name a type
   29 | cout<<c.at(0)<<endl;
      | ^~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int N;
vector<int> stones;

int kode_festival(int depth, int position){
    if(depth == N){
        return stones[position];
    }else{
        int left = kode_festival(depth + 1, position * 2);
        int right = kode_festival(depth + 1, position * 2 + 1);
        if(left == right){
            return left;
        }else{
            return max(left, right) - min(left, right);
        }
    }
}



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<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<list>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
using namespace std;

int segment[1 << 19];
int a;
int saiki(int b) {
	if (segment[b] != -1)return segment[b];
	int x = saiki(b * 2 + 1), y = saiki(b * 2 + 2);
	if (abs(x - y))return abs(x - y);
	return x;
}
signed main() {
	memset(segment, -1, sizeof(segment));
    cin >> a;
	for (int b = 0; b < (1 << a); b++) {
		scanf("%d", &segment[(1 << a) - 1 + b]);
	}
	cout << saiki(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(segment, -1, sizeof(segment));
      |         ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include<queue>
  +++ |+#include <cstring>
   13 | using namespace std;
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		int n = as.nexInt();
		int l = n;
		int[] a;
		int b = 0;
		int c = (int)Math.pow(2, n);
		a = new int[c];
		for(int i=0;i<c;i++){
			a[i]  = as.nextInt();
		}
		for(int s=0;s<n;s++){
			for(int i=0;i<(int)(Math.pow(2,l));i+=2){
				if(a[i]<a[i+1]){
					a[i+1]-=a[i];
					a[b]=a[i+1];
					b+=1;
				}else if(a[i]>a[i+1]){
					a[i]-=a[i+1];
					a[b]=a[i];
					b+=1;
				}else{
					a[b]=a[i];
					b+=1;
				}
			}
			l-=1;
			b = 0;
		}
		System.out.println(a[0]);
	}
}


Compiler output:
Main.java:5: error: cannot find symbol
		int n = as.nexInt();
		          ^
  symbol:   method nexInt()
  location: variable as of type Scanner
1 error
Language: C++

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

int main(){
  int A,B,C;
  cin>>A>>B>>C;
  int G=A+B-C;
  int F=A+G-C;
  int I=B+C-G;
  int go=A+C+I;
  int D=go-A-B;
  int E=go-C-F;
  int H=go-G-I;
  cout<<A<<" "<<B<<" "<<D<<endl;
  cout<<E<<" "<<C<<" "<<F<<endl;
  cout<<G<<" "<<H<<" "<<I<<endl;
}


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

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

int main(){
  int A,B,C;
  cin>>A>>B>>C;
  int G=A+B-C;
  int F=A+G-C;
  int I=B+C-G;
  int go=A+C+I;
  int D=go-A-B;
  int E=go-C-F;
  int H=go-G-I;
  cout<<A<<" "<<B<<" "<<D<<endl;
  cout<<E<<" "<<C<<" "<<F<<endl;
  cout<<G<<" "<<H<<" "<<I<<endl;
}

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

my $in=<STDIN>;
chomp $in;
$in=[split /[\s,]+/,$in];
$a=$in->[0];
$b=$in->[1];
$c=$in->[2];
$d=-$a-$b+3*$c;
$e=-2*$a-$b+4*$c;
$f=2*$a+$b-2*$c;
$g=$a+$b-$c;
$h=-$b+2*$c;
$i=-$a+2*$c;
print "$a $b $d\n$e $c $f\n$g $h $i";
Visul Basic Mono
Imports System

Module APlusB
    Sub Main()
        Dim ins As String() = Console.ReadLine().Split(New Char(){" "c})
        Console.Write(Int(ins(0)))
        Console.Write(" ")
        Console.Write(Int(ins(1)))
        Console.Write(" ")
        Console.Write(-Int(ins(0))-Int(ins(1))+3*Int(int(2)))
        Console.WriteLine("")
        Console.Write(-2*Int(ins(0))-Int(ins(1))+4*Int(ins(2)))
        Console.Write(" ")
        Console.Write(Int(ins(2)))
        Console.Write(" ")
        Console.Write(2*Int(ins(0))+Int(ins(1))-2*Int(ins(2)))
        Console.WriteLine("")
        Console.Write(Int(ins(0))+Int(ins(1))-Int(ins(2)))
        Console.Write(" ")
        Console.Write(-Int(ins(1))+2*Int(ins(2)))
        Console.Write(" ")
        Console.Write(-Int(ins(0))+2*Int(ins(2)))
        Console.WriteLine("")
    End Sub
End Module

Compiler output:
a.cc:3:14: error: stray '\' in program
    3 | $in=[split /[\s,]+/,$in];
      |              ^
a.cc:1:1: error: 'my' does not name a type
    1 | my $in=<STDIN>;
      | ^~
a.cc:2:1: error: 'chomp' does not name a type
    2 | chomp $in;
      | ^~~~~
a.cc:3:1: error: '$in' does not name a type
    3 | $in=[split /[\s,]+/,$in];
      | ^~~
a.cc:4:1: error: '$a' does not name a type
    4 | $a=$in->[0];
      | ^~
a.cc:5:1: error: '$b' does not name a type
    5 | $b=$in->[1];
      | ^~
a.cc:6:1: error: '$c' does not name a type
    6 | $c=$in->[2];
      | ^~
a.cc:7:1: error: '$d' does not name a type
    7 | $d=-$a-$b+3*$c;
      | ^~
a.cc:8:1: error: '$e' does not name a type
    8 | $e=-2*$a-$b+4*$c;
      | ^~
a.cc:9:1: error: '$f' does not name a type
    9 | $f=2*$a+$b-2*$c;
      | ^~
a.cc:10:1: error: '$g' does not name a type
   10 | $g=$a+$b-$c;
      | ^~
a.cc:11:1: error: '$h' does not name a type
   11 | $h=-$b+2*$c;
      | ^~
a.cc:12:1: error: '$i' does not name a type
   12 | $i=-$a+2*$c;
      | ^~
a.cc:13:1: error: 'print' does not name a type; did you mean 'int'?
   13 | print "$a $b $d\n$e $c $f\n$g $h $i";
      | ^~~~~
      | int
a.cc:14:1: error: 'Visul' does not name a type
   14 | Visul Basic Mono
      | ^~~~~
a.cc:19:72: error: expected unqualified-id before ')' token
   19 |         Dim ins As String() = Console.ReadLine().Split(New Char(){" "c})
      |                                                                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,e,f,g;
    scanf ("%d%d%d",&a,&b,&e);  
    c=3*e-a-b;
    h=2*e-b;
    f=2*a-h;
    i=3*e-c-f;
    d=2*e-f;
    g=3*e-h-i;
    printf ("%d %d %d\n",a,b,c);
    printf ("%d %d %d\n",b,c,d);
    printf ("%d %d %d",g,h,i);  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'h' was not declared in this scope
    7 |     h=2*e-b;
      |     ^
a.cc:9:5: error: 'i' was not declared in this scope
    9 |     i=3*e-c-f;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std ;
int main()
{
    int a , b , c ;
    cin >> a >> b >> c ;
    cout << a <<" "<< b <<" "<< 3*c-a-b <<" "<< endl ;
    cout << 4*c-2*a-b <<" "<< c <<" "<< 2*a+b-2*c <<" "<< endl ;
    cout << a+b-c <<" "<< 2*c-b <<" "<< 2*c-a <<" "<< endl ;
    return 0 ;
}}

Compiler output:
a.cc:11:2: error: expected declaration before '}' token
   11 | }}
      |  ^
Language: C++

#include<iostream>
using namespace std ;
long long a,b,c
int main()
{
    cin>>a>>b>>c;
    cout<<a<<" "<<b<<" "<<3*c-a-b<<" "<<endl;
    cout<<4*c-2*a-b<<" "<<c<<" "<<2*a+b-2*c<<" "<<endl ;
    cout<<a+b-c<<" "<<2*c-b<<" "<<2*c-a<<" "<<endl ;
    return 0 ;
}

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main()
      | ^~~
Language: C++

//G++/Gcc
#include<bits/stdc++.h>
 using namespace std;
  int f[5][5],i,j,x;
  int main()
  {
      cin>>f[1][1]>>f[1][2]>>f[2][2];
      x=f[2][2]*3;
      f[1][3]=a-f[1][1]-f[1][2];
      f[3][1]=a-f[1][3]-f[2][2];
      f[3][3]=a-f[1][1]-f[2][2];
      f[2][1]=a-f[1][1]-f[3][1];
      f[2][3]=a-f[2][1]-f[2][2];
      f[3][2]=a-f[1][2]-f[2][2];
      for(i=1;i<=3;++i)
      {
          for(j=1;j<=3;++j) cout<<f[i][j];
          cout<<endl;
      }
      return 0;
  }
  
  
  
  
  
  /*
   QTR,U KICW TIY!!!
   ;EV,UPIT STR HPPF!!!
   KJK,UPIT STR HPPF!!!
   YKX,UPIT STR HPPF!!!
   KUL,UPIT STR HPPF!!!
  */

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'a' was not declared in this scope
    9 |       f[1][3]=a-f[1][1]-f[1][2];
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int f[4][4];
int main()
{
    long long a;
    cin>>f[1][1]>>f[1][2]>>f[2][2];
    a=f[2][2]*3;
    f[1][3]=a-f[1][1]-f[1][2];
    f[3][1]=a-f[1][3]-f[2][2];
    f[3][3]=a-f[1][1]-f[2][2];
    f[2][1]=a-f[1][1]-f[3][1];
    f[2][3]=a-f[2][1]-f[2][2];
    f[3][2]=a-f[1][2]-f[2][2];
    for(int i=1;i<=3;i++)
    {
        for(int j=1;j<=3;j++)
            cout<<f[i][j]
        cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before 'cout'
   18 |             cout<<f[i][j]
      |                          ^
      |                          ;
   19 |         cout<<endl;
      |         ~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
int a[3][3]
int main()
{
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    cin >> a[0][0] >> a[0][1] >> a[1][1];
    int m = a[1][1] * 3;
    a[0][2] = m - a[0][0] - a[0][1];
    a[2][2] = m - a[0][0] - a[1][1];
    a[1][2] = m - a[0][2] - a[2][2];
    a[1][0] = m - a[1][1] - a[1][2];
    a[2][0] = m - a[0][0] - a[1][0];
    for (int i = 0; i <= 2; ++i)
    {
		for (int j = 0; j <= 2; ++j)
			cout << a[i][j] << " ";
		cout << endl; 
	}
    //system("pause");
    return 0;
}


Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main()
      | ^~~
Language: C++

a=input()
b=input()
c=input()
print a, b, 3*c-a-b
print 4*c-2*a-b, c, 2*a+b-2*c
print a+b-c, 2*c-b, 2*c-a

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[4];
    for(int i=0;i<4;i++)
    {
        cin>>a[i];
    }
    if(a[i]%4==0)
    {
        cout<<a[i]<<endl;
        return 0;
    }
    else
    {
        cout<<a[i]+4-a[i]%4<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'i' was not declared in this scope
   10 |     if(a[i]%4==0)
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(a,a%b);
}
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int x=abs(a-c),y=abs(b-d);
    cout<<((x/gcd(x,y))+(y/gcd(x,y))-1)*gcd(x,y)
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:49: error: expected ';' before 'return'
   12 |     cout<<((x/gcd(x,y))+(y/gcd(x,y))-1)*gcd(x,y)
      |                                                 ^
      |                                                 ;
   13 |     return 0;
      |     ~~~~~~
Language: C++

#include <cstdio>
#include <algorithm>

int a,b,c,d,x,y;

int main(){
    scanf("%d%d%d%d",&a,&b,&c,&d);
    printf("%d\n",a-c+b-d-__gcd(a-c,b-d));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
    8 |     printf("%d\n",a-c+b-d-__gcd(a-c,b-d));
      |                           ^~~~~
      |                           std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: 'std::__gcd' declared here
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
Language: C

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

int main(){
  
  int x1,y1,x2,y2;
  cin>>x1>>y1>>x2>>y2;

  int X=abs(x2-x1),Y=abs(y2-y1);
  
  if(!X||!Y){
    cout<<0<<endl;
    return 0;
  }

  int ans=X+Y-1;
  
  ans-=(X/(X/__gcd(X,Y))-1);
  
  cout<<ans<<endl;
  
  return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

import fractions
a,b,c,d=map(int,input().split())
c=abs(c-a)
d=abs(d-b)
g=fractions.gcd(max(c,d),min(c,d))
j=int(c/g)
k=int(d/g)
print((j+k-1)*g)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import fractions
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
using namespace std;
int main()
{
	long long n,i,a[60];
	cin>>n;
	a[0]=2;
	for (i=1;i<=n;i++) a[i]=a[i-1]+*2+2;
	cout<<a[n]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:40: error: invalid type argument of unary '*' (have 'int')
    8 |         for (i=1;i<=n;i++) a[i]=a[i-1]+*2+2;
      |                                        ^~
Language: C++

#include <iostream>
int main()
{
    std::cout<<14<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |     std::cout<<14<<endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long n,a[405];
int main()
{
    cin>>n;
    a[0]=2;
    for(i=0;i<=n;i++) a[i]=a[i-1]*2+2;
    cout<<a[n]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<=n;i++) a[i]=a[i-1]*2+2;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long a,b=2;
int main(){
    cin>>a;
    for(int i=0;i<a;i++)b=(b+1)*2;
    cout<<b<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected '}' at end of input
    7 |     cout<<b<<endl;
      |                   ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,x1=2.x2;
	cin>>n; 
	for(int i=1;i<=n;++i)
	{
		x2=x1*2+2;
		x1=x2;
	}
	cout<<x2;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: unable to find numeric literal operator 'operator""x2'
    4 |         int n,x1=2.x2;
      |                  ^~~~
a.cc:8:17: error: 'x2' was not declared in this scope; did you mean 'x1'?
    8 |                 x2=x1*2+2;
      |                 ^~
      |                 x1
a.cc:11:15: error: 'x2' was not declared in this scope; did you mean 'x1'?
   11 |         cout<<x2;
      |               ^~
      |               x1
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b=2;
    scanf("%d",&a);
    for(int i=0;i<a;i++)
    {
    b=2b+2;
	}
    printf("%d\n",b);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: unable to find numeric literal operator 'operator""b'
    9 |     b=2b+2;
      |       ^~
Language: C++

#include<iostream>
long long n,srx[101];
int i;
long long lgx(long long n)
{
    if(srx[n])
    return srx[n];
    if(n>0)
    srx[n]=lgx(n-1)*2+2;
}
int main()
{
    cin>>n;
    srx[0]=2;
    lgx(n);
    cout<<srx[n]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |     cin>>n;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<srx[n]<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |     cout<<srx[n]<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'long long int lgx(long long int)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

using namespace std;
long long n;
long long m=2;
int main()
{
    int i;
    cin>>n;
    for(i=0;i<n;i++)
    {
        m=(m+1)*2;  
    }
    cout<<m<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout<<m<<endl;
      |     ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:14: error: 'endl' was not declared in this scope
   12 |     cout<<m<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

using namespace std;
long long n;
long long m=2;
int main()
{
    int i;
    cin>>n;
    for(i=0;i<a;i++)
    {
        m=(m+1)*2;  
    }
    cout<<m<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:15: error: 'a' was not declared in this scope
    8 |     for(i=0;i<a;i++)
      |               ^
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout<<m<<endl;
      |     ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:14: error: 'endl' was not declared in this scope
   12 |     cout<<m<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include<cstdio>
#define ll long long
using namesapce std;
ll n,a[101];
int i;
ll f(ll n)
{
    if(a[n])
    {
        return a[n];
    }
    if(n>0)
    {
        a[n]=f(n-1)*2+2;
    }
}
int main()
{
    scanf("%d",&n);
    a[0]=2;
    f(n);
    printf("%lld\n",a[n]);
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namesapce'
    3 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'long long int f(long long int)':
a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long n;
long long srd[1000001];
void dg(long long n){
	srd[n]=srd[n-1]>>1+2;
	return;
}    
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		dg(n);
	cout<<f[n];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'f' was not declared in this scope
   13 |         cout<<f[n];
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
	if(srd[n])
    	return srd[n];
    if(n>0)
    	srd[n]=dg(n-1)*2+2;
}    
int main(){
	cin>>n;
	dg(n);
	return 0;
}

Compiler output:
a.cc: In function 'int dg(int)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
	if(srx[n])
    	return srd[n];
    if(n>0)
    	srd[n]=lgx(n-1)*2+2;
}    
int main(){
	cin>>n;
	dg(n);
	return 0;
}

Compiler output:
a.cc: In function 'int dg(int)':
a.cc:6:12: error: 'srx' was not declared in this scope; did you mean 'srd'?
    6 |         if(srx[n])
      |            ^~~
      |            srd
a.cc:9:16: error: 'lgx' was not declared in this scope
    9 |         srd[n]=lgx(n-1)*2+2;
      |                ^~~
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
	if(srx[n])
    	return srx[n];
    if(n>0)
    	srx[n]=lgx(n-1)*2+2;
}    
int main(){
	cin>>n;
	dg(n);
	return 0;
}

Compiler output:
a.cc: In function 'int dg(int)':
a.cc:6:12: error: 'srx' was not declared in this scope; did you mean 'srd'?
    6 |         if(srx[n])
      |            ^~~
      |            srd
a.cc:9:9: error: 'srx' was not declared in this scope; did you mean 'srd'?
    9 |         srx[n]=lgx(n-1)*2+2;
      |         ^~~
      |         srd
a.cc:9:16: error: 'lgx' was not declared in this scope
    9 |         srx[n]=lgx(n-1)*2+2;
      |                ^~~
Language: C++

#include<iostream>

int n,f[1000];

int main()
{
    std::cin>>n;
    f[0]=2;
    for(register int i=1;i<=n;i++)
      f[i]=f[i-1]*2+2;
     std::cout<<f[n]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    9 |     for(register int i=1;i<=n;i++)
      |                      ^
a.cc:11:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |      std::cout<<f[n]<<endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int f[300];
int main()
{
    f[0]=2;
    cin>>n;
    for(int i=1;i<=n;i++)
    f[n]=f[n-1]*2+2;
    cout<<f[n]<<endl;
    return 0;
}


//f[n]=f[n-1]*2+2

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
    f[0]=2;
    cin>>n;
    for(int i=1;i<=n;i++)
    f[n]=f[n-1]*2+2;
    cout<<f[n]<<endl;
    return 0;
}


//f[n]=f[n-1]*2+2

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'f' was not declared in this scope
    5 |     f[0]=2;
      |     ^
a.cc:6:10: error: 'n' was not declared in this scope
    6 |     cin>>n;
      |          ^
Language: C++

#include<iostream>
using namespace std;
const int MAXN=101;//好习惯：下标为常量
long long f[MAXN],X;//一定要用long long，我第一次                    就因此WA了一次
int main(){
    cin>>X;
    f[0]=2;/记住：赋初值
    for(int i=1;i<=X;i++) f[i]=f[i-1]*2+2;
    //一个easy的递推，按照公式
    cout<<f[X]<<endl;//输出
    return 0;//快乐结束
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected primary-expression before '/' token
    7 |     f[0]=2;/记住：赋初值
      |            ^
a.cc:7:13: error: '\U00008bb0\U00004f4f\U0000ff1a\U00008d4b\U0000521d\U0000503c' was not declared in this scope
    7 |     f[0]=2;/记住：赋初值
      |             ^~~~~~~~~~~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |     for(int i=1;i<=X;i++) f[i]=f[i-1]*2+2;
      |                 ^
Language: C++

#include<iostream>
using nsmespace std;
int a=2,n;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a*=2;
		a+=2;
	}
	cout<<a<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nsmespace'
    2 | using nsmespace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |         cout<<a<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         cout<<a<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int n;
long long f[400]
int main()
{
	scanf("%d",&n);
	f[0]=2;
	for(int i=0;i<=n;i++)
	f[i]=f[i-1]*2+2;
	printf("%d\n",f[n]);
	return 0;
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int main()
      | ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int n;
long long f[400]
int main()
{
	scanf("%d",&n);
	f[0]=2;
	for(int i=0;i<=n;i++)
	f[i]=f[i-1]*2+2;
	printf("%d",f[n]);
	return 0;
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int main()
      | ^~~
Language: C++

#include <cstdio>
int main() {
    int n,f[41] = {2};
    scanf("%d",&n);
    for (int i = 1;<= n;i++) f[i] = f[i-1]*2+2;
    printf("%d",f[n]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected primary-expression before '<=' token
    5 |     for (int i = 1;<= n;i++) f[i] = f[i-1]*2+2;
      |                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,Q;
int A[101010],B[101010];
int D[101010];
int yes[101010];
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>Q;
	FOR(i,N) D[i]=i;
	yes[0]=1;
	yes[1]=1;
	cur=0;
	FOR(i,Q) {
		cin>>A[i]>>B[i];
		A[i]--,B[i]--;
		if(A[i]==cur) cur=B[i];
		else if(B[i]==cur) cur=A[i];
		swap(D[A[i]],D[B[i]]);
		if(cur) yes[D[cur-1]]=1;
		if(cur<N-1) yes[D[cur+1]]=1;
	}
	
	cout<<count(yes,yes+N,1)<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:9: error: 'cur' was not declared in this scope
   26 |         cur=0;
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,Q;
int A[101010],B[101010];
int D[101010];
int yes[101010];
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>Q;
	FOR(i,N) D[i]=i;
	yes[0]=1;
	yes[1]=1;
	cur=0;
	FOR(i,Q) {
		cin>>A[i]>>B[i];
		if(A[i]==cur) cur=B[i];
		else if(B[i]==cur) cur=A[i];
		swap(D[A[i]],D[B[i]]);
		if(cur) yes[D[cur-1]]=1;
		if(cur<N-1) yes[D[cur+1]]=1;
	}
	
	cout<<count(yes,yes+N,1)<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:9: error: 'cur' was not declared in this scope
   26 |         cur=0;
      |         ^~~
Language: C++

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

template <typename T> class tRMQ {
  vector<T> data;
  T unit;

public:
  int n;
  function<T(const T &, const T &)> f;

  tRMQ(int _, T u, function<T(T, T)> bi) {
    unit = u;
    f = bi;
    n = 1;
    while (n < _) {
      n <<= 1;
    }
    data.resize(n * 4);
    for (int i = 0; i < n * 4; i++)
      data[i] = unit;
  }

  tRMQ(vector<T> &v, T u, function<T(T, T)> bi) {
    unit = u;
    f = bi;
    n = 1;
    while (n < v.size())
      n <<= 1;
    data.resize(n * 2 + 1);
    for (int i = 0; i < n + 1; i++) {
      if (i < v.size())
        data[i + n] = v[i];
      else
        data[i + n] = u;
    }
    for (int i = n - 1; i >= 0; i--) {
      data[i] = f(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }

  void update(int index, T val) {
    int i = index + n - 1;
    data[i] = val;
    while (i > 0) {
      i = (i - 1) / 2;
      data[i] = f(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }

  // [a, b)
  T query(int a, int b, int k, int l, int r) {
    if (a < 0 || r <= a || b <= l)
      return unit;
    if (a <= l && r <= b)
      return data[k];
    else
      return f(query(a, b, k * 2 + 1, l, (l + r) / 2),
               query(a, b, k * 2 + 2, (r + l) / 2, r));
  }
};
int DAY = 86400;
int MOR = 10800;

int main() {
  int n;
  cin >> n;
  int base = 0;
  vector<ll> d(DAY);
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    d[(base + a) % DAY] += 1;
    base += a + b;
    base %= DAY;
  }
  tRMQ<ll> q(d, 0ll, [](const ll &l, const ll &r) { return l + r; });
  ll ans = 0;
  for (int i = 0; i < DAY; i++) {
    ll b = q.query(max(-DAY + i, 0), max(-DAY + i + MOR + 1, 0)) +
           q.query(min(i, DAY), min(i + MOR + 1, DAY));
    ans = max(ans, b);
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:19: error: no matching function for call to 'tRMQ<long long int>::query(const int&, const int&)'
   81 |     ll b = q.query(max(-DAY + i, 0), max(-DAY + i + MOR + 1, 0)) +
      |            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:5: note: candidate: 'T tRMQ<T>::query(int, int, int, int, int) [with T = long long int]'
   53 |   T query(int a, int b, int k, int l, int r) {
      |     ^~~~~
a.cc:53:5: note:   candidate expects 5 arguments, 2 provided
a.cc:82:19: error: no matching function for call to 'tRMQ<long long int>::query(const int&, const int&)'
   82 |            q.query(min(i, DAY), min(i + MOR + 1, DAY));
      |            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:5: note: candidate: 'T tRMQ<T>::query(int, int, int, int, int) [with T = long long int]'
   53 |   T query(int a, int b, int k, int l, int r) {
      |     ^~~~~
a.cc:53:5: note:   candidate expects 5 arguments, 2 provided
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> v(n, vector<int>(n, 0));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            if((i+j)&1^1){
                v[i][j] = 1;
            }
        }
    }
    vector<pair<int, int>> ans;
    for (int i = 1; i < n; i += 6) {
        for (int j = 0; j < n; j += 2) {
            if(!v[i][j]){
                v[i][j] = 1;
                ans.emplace_back(i, j);
            }
        }
    }
    for (int i = 4; i < n; i += 6) {
        for (int j = 1; j < n; j += 2) {
            if(!v[i][j]){
                v[i][j] = 1;
                ans.emplace_back(i, j);
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        if(!v[i][0]){
            v[i][0] = 1;
            ans.emplace_back(i, 0);
        }
        if(!v[n-1][i]){
            v[n-1][i] = 1;
            ans.emplace_back(n-1, i);
        }
        if(!v[i][n-1]){
            v[i][n-1] = 1;
            ans.emplace_back(i, n-1);
        }
    }
    cout << ans.size() << "\n";
    for (auto &&k : ans) {
        printf("%d %d\n", k.first, k.second);4
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:47: error: expected ';' before '}' token
   64 |         printf("%d %d\n", k.first, k.second);4
      |                                               ^
      |                                               ;
   65 |     }
      |     ~