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

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm> // sort
#include <iomanip>
#include <queue>
#include <map>
#include <bits/stdc++.h>


using namespace std;

#define DEBUG 0
#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
typedef pair<int,int> pint;


const int MOD = 1000000007;

//1,2,3,4
//
//1,2
//1,2,3
//1,2,3,4
//2,3
//2,3,4
//3,4

int main(){

#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll x, y;
    cin >> x >> y;
    ll res;

    if(x > = 0 && x <= y)
    {
        res = y-x;
    }
    else
    {
        if(abs(x) <= abs(y))
        {
            res = y - x + 1; 
            if(x < 0)++res;
        }
        else
        {
            res = x + y + 1;
        }
        
    }
    

    cout << res << endl;

    return 0;     
}



Compiler output:
a.cc: In function 'int main()':
a.cc:44:12: error: expected primary-expression before '=' token
   44 |     if(x > = 0 && x <= y)
      |            ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    int cnt1 = 1;
    int cnt2 = 1;
    int cnt3 = 2;
    if(x<=y){
      if(x>=0||y<=0){
        System.out.println(y-x);
        return;
      }else if(-x>y){
        System.out.println(y-x);
        return;
      }else if(-x==y){
        System.out.println(1);
        return;
      }else{
        System.out.println(1+y+x);
        return;
      }
    }
    if(y>=0){
      cnt1+=3000000000;
      cnt2+=y+x;
      cnt3+=3000000000;
    }
    else if(-y<x){
      cnt1+=3000000000;
      cnt2+=y+x;
      cnt3+=x-y;
    }
    else{
      cnt1+=-y-x;
      cnt2+=3000000000;
      cnt3+=x-y;
    }
    System.out.println(Math.min(cnt1,Math.min(cnt2,cnt3)));
  }
}


Compiler output:
Main.java:26: error: integer number too large
      cnt1+=3000000000;
            ^
Main.java:28: error: integer number too large
      cnt3+=3000000000;
            ^
Main.java:31: error: integer number too large
      cnt1+=3000000000;
            ^
Main.java:37: error: integer number too large
      cnt2+=3000000000;
            ^
4 errors
Language: C++

/* @ by batr (T) */
#include <bits/stdc++.h>
 
#define ll long long
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
 
#define cmp_all(X) (X).begin(), (X).end(), cmp
 
#define B begin()
#define E end()
#define sz size()
#define skip continue
 
#define ppi pair<pair<int, int>, int>
#define pii pair<int, int> 
#define pli pair<ll, int>
#define pcc pair<char, char>
 
#define F first
#define S second
 
using namespace std;
 
const int maxn = 1e7 + 17;
const int MAXN = maxn * 4;
const int darr = 1e3 + 17;
const ll INF = 1e17 + 5;
const int mod = 1e9 + 7;
 
void Need_For_Speed () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int ct;
int n, m;

int main () {
	Need_For_Speed();
	cin >> n >> m;
	if (n > m) {
		cout << n - m + 2;
	}
	else {
		cout << m - x;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:29: error: 'x' was not declared in this scope
   48 |                 cout << m - x;
      |                             ^
Language: C++

/* @ by batr (T) */
#include <bits/stdc++.h>
 
#define ll long long
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
 
#define cmp_all(X) (X).begin(), (X).end(), cmp
 
#define B begin()
#define E end()
#define sz size()
#define skip continue
 
#define ppi pair<pair<int, int>, int>
#define pii pair<int, int> 
#define pli pair<ll, int>
#define pcc pair<char, char>
 
#define F first
#define S second
 
using namespace std;
 
const int maxn = 1e7 + 17;
const int MAXN = maxn * 4;
const int darr = 1e3 + 17;
const ll INF = 1e17 + 5;
const int mod = 1e9 + 7;
 
void Need_For_Speed () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int ct;
int n, m;

int main () {
	Need_For_Speed();
	cin >> n >> m;
	if (n == m) {
		cout << 0;
		return 0;
	}
	if (n == 0 && m) {
		cout << m;
		return 0;
	}
	if (n && m == 0) {
		if (n > 0) {
			ct++;
		}
		cout << m + ct;
		return 0;
	}
	if (n < 0 && m > 0) {
		n = abs(n);
		if (n <= m) {
			cout << m - n + 1;
		}
		else {
			n *= -1;
			cout << m - n + 1;
		}
	}
	if (n > 0 && m < 0) {
		m = abs(m);
		if (n <= m) {
			cout << m - n + 1;
		}
		else {
			cout << n - m + 1;
		}
	}
	if (n < 0 && m < 0) {
		n = abs(n);
		m = abs(m);
		if (n <= m) {
			cout << m - n + 2;
		}
		-5 -2
		else {
			cout << m - n;
		}
	}
	if (n > 0 && m > 0) {
		if (n <= m) {
			cout << m - n;
		}
		else {
			cout << n - m + 2;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:22: error: expected ';' before 'else'
   84 |                 -5 -2
      |                      ^
      |                      ;
   85 |                 else {
      |                 ~~~~
Language: C++

/* @ by batr (T) */
#include <bits/stdc++.h>
 
#define ll long long
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
 
#define cmp_all(X) (X).begin(), (X).end(), cmp
 
#define B begin()
#define E end()
#define sz size()
#define skip continue
 
#define ppi pair<pair<int, int>, int>
#define pii pair<int, int> 
#define pli pair<ll, int>
#define pcc pair<char, char>
 
#define F first
#define S second
 
using namespace std;
 
const int maxn = 1e7 + 17;
const int MAXN = maxn * 4;
const int darr = 1e3 + 17;
const ll INF = 1e17 + 5;
const int mod = 1e9 + 7;
 
void Need_For_Speed () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int ct;
int n, m;

int main () {
	#ifndef ONLINE_JUDGE
		freopen ("input.txt", "r", stdin);
		freopen ("output.txt", "w", stdout);
	#endif  
	Need_For_Speed();
	cin >> n >> m;
	if (n == m) {
		cout << 0;
		return 0;
	}
	if (n == 0 && m) {
		cout << m;
		return 0;
	}
	if (n && m == 0) {
		if (n > 0) {
			ct++;
		}
		cout << m + ct;
		return 0;
	}
	if (n < 0 && m > 0) {
		n = abs(n);
		if (n <= m) {
			cout << m - n + 1;
		}
		else {
			n *= -1;
			cout << m - n + 1;
		}
	}
	if (n > 0 && m < 0) {
		m = abs(m);
		if (n <= m) {
			cout << m - n + 1;
		}
		else {
			cout << n - m + 1;
		}
	}
	if (n < 0 && m < 0) {
		n = abs(n);
		m = abs(m);
		if (n <= m) {
			cout << m - n + 2;
		}
		-5 -2
		else {
			cout << m - n;
		}
	}
	if (n > 0 && m > 0) {
		if (n <= m) {
			cout << m - n;
		}
		else {
			cout << n - m + 2;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:22: error: expected ';' before 'else'
   88 |                 -5 -2
      |                      ^
      |                      ;
   89 |                 else {
      |                 ~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
#define in(a) scanf("%lld", &(a))
#define in2(a,b) scanf("%lld %lld",&(a),&(b))
#define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define ind(a) scanf("%lf", &(a))
#define ins(a) scanf("%s", (a))
#define inc(a) scanf("%c", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a))
//      puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int main(void){
    ll x, y;
    in2(x,y);
    ll ans = abs(abs(x)-abs(y));
    if(ans){
        if(x<y && x*y>=0) put(ans);
        else if(x<y) put(min(++ans), y-x);
        else if(x>y && x*y>0) put(ans+2);
        else put(++ans);
    }
    else {
        puts("1");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:32:41: error: macro "put" passed 2 arguments, but takes just 1
   32 |         else if(x<y) put(min(++ans), y-x);
      |                                         ^
main.c:22:9: note: macro "put" defined here
   22 | #define put(a) printf("%lld\n", (a))
      |         ^~~
main.c:32:22: error: 'put' undeclared (first use in this function); did you mean 'puts'?
   32 |         else if(x<y) put(min(++ans), y-x);
      |                      ^~~
      |                      puts
main.c:32:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

long long ll;

int main()
{
    ll x, y;
    cin >> x >> y;
    int ans = 0;
    if(x * y < 0) ans++;
    else if(x > y) ans += 2;
    cout << ans + abs(abs(x) - abs(y)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: expected ';' before 'x'
    8 |     ll x, y;
      |       ^~
      |       ;
a.cc:9:12: error: 'x' was not declared in this scope
    9 |     cin >> x >> y;
      |            ^
a.cc:9:17: error: 'y' was not declared in this scope
    9 |     cin >> x >> y;
      |                 ^
Language: C++

#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int main(int argc, const char * argv[]) {

    ios::sync_with_stdio(false);
    cin.tie(0);

    int x, y; cin >> x >> y;
    
    int64_t ans = 0;
    if (abs(x) <= abs(y)) {
        int64_t dis = abs(y) - abs(x);
        if (x >= 0 && y >= 0) ans = dis;
        if (x >= 0 && y < 0) ans = dis + 1;
        if (x < 0 && y >= 0) ans = dis + 1;
        if (x < 0 && y < 0) ans = dis + 2;
    } else {
        int64_t dis = abs(x) - abs(y);
        if (x >= 0 && y >= 0) ans = dis + 2;
        if (x >= 0 && y < 0) ans = dis + 1;
        if (x < 0 && y >= 0) ans = dis+ 1;
        if (x < 0 && y < 0) ans = dis;
    }
    
    cout << ans << endl;

    return 0;
}
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int main(int argc, const char * argv[]) {

    ios::sync_with_stdio(false);
    cin.tie(0);

    int x, y; cin >> x >> y;
    
    int64_t ans = 0;
    if (abs(x) == abs(y)) {
        if (x == y) ans = 0;
        else ans = 1;
    } else if (abs(x) < abs(y)) {
        int64_t dis = abs(y) - abs(x);
        if (x >= 0 && y >= 0) ans = dis;
        if (x >= 0 && y < 0) ans = dis + 1;
        if (x < 0 && y >= 0) ans = dis + 1;
        if (x < 0 && y < 0) ans = dis + 2;
    } else {
        int64_t dis = abs(x) - abs(y);
        if (x >= 0 && y >= 0) ans = dis + 2;
        if (x >= 0 && y < 0) ans = dis + 1;
        if (x < 0 && y >= 0) ans = dis + 1;
        if (x < 0 && y < 0) ans = dis;
    }
    
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:53:5: error: redefinition of 'int main(int, const char**)'
   53 | int main(int argc, const char * argv[]) {
      |     ^~~~
a.cc:14:5: note: 'int main(int, const char**)' previously defined here
   14 | int main(int argc, const char * argv[]) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;

int main(){
    int a, b;
    cin >> a >> b;

    int ansl
    if(a == -b) cout << 1 << endl;
    else if(a >= 0 && b < 0) ans = abs(a-b)+1;
    else if(a <= b) cout << abs(a-b) << endl;
    else cout << abs(a-b)+2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected initializer before 'if'
   14 |     if(a == -b) cout << 1 << endl;
      |     ^~
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else if(a >= 0 && b < 0) ans = abs(a-b)+1;
      |     ^~~~
a.cc:15:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     else if(a >= 0 && b < 0) ans = abs(a-b)+1;
      |                              ^~~
      |                              abs
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
    int x,y,c = 0;
    cin >> x >> y;
    if (abs(x)==abs(y)){
        c = 1;
    }
    else {
        if (x<y) {
            if (0<x) {c = y-x;}
            else if (0>x and 0<y) {
                if (abs(x)<y) {
                    ++c;
                    c += y-abs(x);
                }
                else if (abs(x)>y) {
                    c += abs(x)-y;
                    ++c;
                }
            }
            else if (y<0) {c = y-x;}
        }
        else if (y<x) {
            if (0<y) {
                ++c;
                c += abs(x) - y;
                ++c;
            }
            else if (0>y and 0<x) {
                if (abs(y) < x) {
                    ++c;
                    c += x -abs(y);
                }
                else if (abs(y) < x){
                    c += abs(y) - x;
                    ++c;
                }
            }
            else if (x<0) {
                ++c;
                c += x-y;
                ++c;
            }
        }
    }
    cout << c << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:49:14: error: expected '}' at end of input
   49 |     return 0;
      |              ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++) 
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    //ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    //string S; cin >> S;
    //ll H,W; cin >> H >> W;
    ll x,y;
    cin >> x >> y;
    if(x*y>=0 && y>x)cout << y-x,;
    if(x*y>=0 && x>y && x>0)cout << min(x-y+2,x+y+1);
    else if(x*y>=0 && x>y)cout << x-y+2;
    else if(x*y<0)cout << abs(x+y)+1;
}

/*



 */


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: expected primary-expression before ';' token
   19 |     if(x*y>=0 && y>x)cout << y-x,;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++) 
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    //ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    //string S; cin >> S;
    //ll H,W; cin >> H >> W;
    ll x,y;
    cin >> x >> y;
    if(x*y>=0 && y>x)cout << y-x,;
    else if(x*y>=0 && x>y)cout << min(x-y+2,x+y+1);
    else if(x*y<0)cout << abs(x+y)+1;
}

/*



 */


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: expected primary-expression before ';' token
   19 |     if(x*y>=0 && y>x)cout << y-x,;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int64_t x,y;
  cin>>x>>y;
  if(x<y&&x*y>=0){
    cout<<max(x,y)-min(x,y);
  }
   if(x<y&&x*y>0){
    cout<<2+max(x,y)-min(x,y);
  }
     if(x<y&&x*y=0){
    cout<<1+max(x,y)-min(x,y);
  }
  else {
    int a=max(x,y);
    int b=min(x,y);
    int B=abs(b);
    int c=max(a,B);
    int d=min(a,B);
    int e=c-d;
    cout<<e+1;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: lvalue required as left operand of assignment
   12 |      if(x<y&&x*y=0){
      |         ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  ll x,y; cin >>x>>y;
  ll out;
  if(x>=0&&y>=0){
    out = abs(y-x);
    if(x>y) out += 2;
  } else if(x<0&&y<0)){
    out = abs(y-x);
    if(x>y)out += 2;
  } else {
    if(x==0||y==0){
      out = abs(abs(y)-abs(x));
    } else{
      out = abs(abs(y)-abs(x))+1;
    }
  }
  cout << out << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: expected primary-expression before ')' token
   13 |   } else if(x<0&&y<0)){
      |                      ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*(y/gcd(x,y));
}

//a,b x
int main(){
	ll x,y; cin>>>x>>y;
  if(x>y) cout<<x-y+2;
  else cout<<y-x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:22: error: expected primary-expression before '>' token
   33 |         ll x,y; cin>>>x>>y;
      |                      ^
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll x,y;
  	ci(x>>y)
  if(x>0){
    co(rM(abs(x-y),abs(x+y)+1))
  }
  else{
    x*=-1;
    co(rM(abs(x-y)+1,abs(x+y)+2)
       }
       }

Compiler output:
a.cc:124:9: error: unterminated argument list invoking macro "co"
  124 |        }
      |         ^
a.cc: In function 'int main()':
a.cc:122:5: error: 'co' was not declared in this scope
  122 |     co(rM(abs(x-y)+1,abs(x+y)+2)
      |     ^~
a.cc:122:7: error: expected '}' at end of input
  122 |     co(rM(abs(x-y)+1,abs(x+y)+2)
      |       ^
a.cc:120:7: note: to match this '{'
  120 |   else{
      |       ^
a.cc:122:7: error: expected '}' at end of input
  122 |     co(rM(abs(x-y)+1,abs(x+y)+2)
      |       ^
a.cc:114:15: note: to match this '{'
  114 | signed main() {
      |               ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1000003 ;

int main(){
  ll x,y;
  cin >> x >> y;
  ll ans=abs(abs(x)-abs(y));
  if(x*y>0 && x>y)ans+=2;
  if(x*y<0)ans++;
  if()
  cout << ans << endl;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:6: error: expected primary-expression before ')' token
   30 |   if()
      |      ^
Language: C++

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

int main() {
    int x,y;
  cin>>x>>y;
  if(x==(-1*y){
  cout<<'1'<<endl;}
     else {
     if(x<y)){int t;t=y-x; cout<<t<<endl;}
      else if(x>y){
      if (x>0 && y>0){int t;t=x+y+1; cout<<t<<endl;}
        else if (x>0 && y<0){int t;t=(-y)-x+1; cout<<t<<endl;}
        else if (x<0 && y<0){int t;t=(-y)-x+2; cout<<t<<endl;}
      }
     }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected ';' before '{' token
    7 |   if(x==(-1*y){
      |               ^
      |               ;
a.cc:9:6: error: expected primary-expression before 'else'
    9 |      else {
      |      ^~~~
a.cc:8:20: error: expected ')' before 'else'
    8 |   cout<<'1'<<endl;}
      |                    ^
      |                    )
    9 |      else {
      |      ~~~~           
a.cc:7:5: note: to match this '('
    7 |   if(x==(-1*y){
      |     ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = Integer.parseInt(in.nextLine().split(" ")[0]);
        int y = Integer.parseInt(in.nextLine().split(" ")[1]);
        String xb = Integer.toBinaryString(x);
        String yb = integer.toBinaryString(y);
        int z = !(xb.length() == 32 ^ yb.length() == 32) && y - x < 0 ? Math.abs(x) - Math.abs(y) + 2
                : (!(xb.length() == 32 ^ yb.length() == 32) && x - y < 0)
                || (xb.length() == 0 ^ yb.length() == 0) && x - y < 0 ? Math.abs(y) - Math.abs(x)
                : Math.abs(y) > Math.abs(x) ? Math.abs(y) - Math.abs(x) + 1 : Math.abs(x) -Math.abs(y) + 1;
        System.out.println(z);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        String yb = integer.toBinaryString(y);
                    ^
  symbol:   variable integer
  location: class Main
1 error
Language: C++

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

int main() {
  int x, y;
  cin >> x >> y;
  if (x > y) {
    if (x<0)
      cout << (abs(y) - abs(x)) + 2 << endl;
    else if (x==0)
      cout << abs(y) + 1 << endl;
    else if (x>0&&y<0)
      cout << abs(x+y) + 1 << endl;
    else if (x>0&&y==0)
      cout << x+1 << endl;
    else if (x>0&&y>0)
      cout << (x-y) + 2 << endl;
  }
  else if (x < y) {
    if (x<0&&y==0) 
      cout << abs(x) << endl;
    else if (x<0&&y<0)
      cout << abx(x) - abs(y) << endl;
    else if (x<0&&y>0)
      cout << abs(x+y) + 1 << endl;
    else if (x==0)
      cout << y << endl;
    else if (x>0)
      cout << y-x << endl;
  }
  return 0;
}
     
    
      
      


Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'abx' was not declared in this scope; did you mean 'abs'?
   25 |       cout << abx(x) - abs(y) << endl;
      |               ^~~
      |               abs
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <unordered_map>
using namespace std;

#define REPI(i,a,b) for (ll i=(a);i<(b);i++)
#define REP(i,n) REPI(i,0,n)

typedef long long int ll;

int SURP = 1000000007;

int ceil(int a,int b){
	return (a+b-1)/b;
}

ll gcd(ll a,ll b){
	ll p;

	if (b > a){
		p = a;
		a = b;
		b = p;
	}

	while(b != 0){
		p = a % b;
		a = b;
		b = p;
	}
	return a;
}

int main(){
	ll a,b;
	cin >> a >> b;
	ll ret = LLONG_MAX;

	ll tmp1,tmp2;

	tmp1 = a;
	tmp2 = b;
	if(tmp1 <= tmp2){
		if(ret > tmp2 -tmp1) ret = tmp2 -tmp1;
	}
	tmp1 = a*(-1);
	tmp2 = b;
	if(tmp1 <= tmp2){
		if(ret > tmp2 -tmp1 + 1) ret = tmp2 -tmp1 + 1;
	}

	tmp1 = a;
	tmp2 = b*(-1);
	if(tmp1 <= tmp2){
		if(ret > tmp2 -tmp1 + 1) ret = tmp2 -tmp1 + 1;
	}

	tmp1 = a*(-1);
	tmp2 = b*(-1);
	if(tmp1 <= tmp2){
		if(ret > tmp2 -tmp1 + 2) ret = tmp2 -tmp1 + 2;
	}
	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: 'LLONG_MAX' was not declared in this scope
   45 |         ll ret = LLONG_MAX;
      |                  ^~~~~~~~~
a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <unordered_map>
  +++ |+#include <climits>
   12 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
int MOD=1000000007;

int main(){
	int x,y,ans=0; cin >> x >> y;
	if(x>=0 && y>=0 && y>=x) cout << y-x << endl;
	else if(x>=0 && y>=0 && x>y) cout << abs(y-x)*2+2 << endl;
	else if(x>=0 && y<0) cout << abs(y)-x+1 << endl;
	else if(x<0 && y<0 && x=y) cout << abs(y)-abs(x)+2 << endl;
	else if(x<0 && y<0 && x<=y) cout << abs(x)-abs(y) << endl;
	else cout << y-abs(x)+1 << endl;

	}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: lvalue required as left operand of assignment
   15 |         else if(x<0 && y<0 && x=y) cout << abs(y)-abs(x)+2 << endl;
      |                 ~~~~~~~~~~~^~~~
Language: C++

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

int main(void)
{
  int x, y;
  cin >> x >> y;

  int count = 0;
  if(abs(x) < abs(y)){
      count = abs(y) - abs(x);
      if(x<0&&y=>0 || x=>0 &&y<0)
        count++;
      else if(x<0 && y<0)
        count+=2;
  }
  else{
      count = abs(x)- abs(y);
      if(x>0 && y>0)
        count+=2;
      else if(x<=0 && y>0|| x>0 && y <= 0)
        count++;
  }

 
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected primary-expression before '>' token
   13 |       if(x<0&&y=>0 || x=>0 &&y<0)
      |                 ^
a.cc:13:25: error: expected primary-expression before '>' token
   13 |       if(x<0&&y=>0 || x=>0 &&y<0)
      |                         ^
Language: C++

x,y=gets.split.map(&:to_i)
puts [y-x, 1+(-y)-x, 1+y-(-x), 2+(-y)-(-x)].select(&:positive?).min

Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x,y=gets.split.map(&:to_i)
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long 

int main(int argc, char const *argv[])
{
	int x,y,cnt;
	scanf("%d%d",&x,&y);
	cnt = abs(abs(x) - abs(y));
	if(x > y){
		if(x * y < 0)	++cnt;
		else	cnt += 2;
	}
	printf("%d\n", cnt);
	return 0
}


Compiler output:
main.c: In function 'main':
main.c:20:17: error: expected ';' before '}' token
   20 |         return 0
      |                 ^
      |                 ;
   21 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int  main(){
  long long x,y; cin>>x>>y;
  if(x*y>0){
    if(x>y)ans+=2;
  }
  else if(x*y<0){
    ans++;
  }
  else{
    if(x>y)ans++;
  }
  return 0;
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(x>y)ans+=2;
      |            ^~~
      |            abs
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans++;
      |     ^~~
      |     abs
a.cc:13:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     if(x>y)ans++;
      |            ^~~
      |            abs
a.cc:16:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
inline int read(){
	int f=1,ans=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return f*ans;
}int x,y;
int dis(int x,int y){return y-x;}
int main(){
	int minn=INT_MAX;
	x=read(),y=read();
	if(x<=y) minn=min(minn,dis(x,y));
	if(-x<=y) minn=min(minn,1+dis(-x,y));
	if(x<0&&y<0) minn=min(minn,2*dis(y,x)+2);
	printf("%d\n",minn); 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'INT_MAX' was not declared in this scope
   14 |         int minn=INT_MAX;
      |                  ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<algorithm>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<58;
 
int main() {
	ll x,y;
	cin >> x >> y;
	ll ans = 0;
	if(x >= 0 && y >= 0 ||　x < 0 && y < 0){
      if(y >= x) ans = y - x;
      else ans = x - y + 2;
    }
  	else{
      if(llabs(y) >= llabs(x)) ans = y - x + 1;
      else ans = x - y + 1;
    }
	cout << ans << endl;
}

Compiler output:
a.cc:25:31: error: extended character 　 is not valid in an identifier
   25 |         if(x >= 0 && y >= 0 ||　x < 0 && y < 0){
      |                               ^
a.cc: In function 'int main()':
a.cc:25:31: error: '\U00003000x' was not declared in this scope
   25 |         if(x >= 0 && y >= 0 ||　x < 0 && y < 0){
      |                               ^~~
Language: C

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

int main() {
    long x, y;
    cin >> x >> y;
    long ans;
    if (x >= 0) {
        if (y >= 0) {
            ans = (x <= y) ? (y - x) : (x - y + 2);
        } else {
            ans = abs(y + x) + 1;
        }
    } else {
        if (y >= 0) {
            ans = abs(x + y) + 1;
        } else {
            ans = (x <= y) ? (y - x) : (x - y + 2);
        }
    }

    cout << ans << endl;
    return 0;
}


Compiler output:
main.c: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;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll x, y;
    cin >> x >> y;
    ll s = abs(abs(x) - abs(y));
    //! 反転ボタンを押す数を決める
    if (y < x && (x < 0 || y > 0))
        s += 2;
    else if (y < x && 0 <= x)
        s++;
    else if (x < y && y > 0 && x < 0)
        s++;
    cout << s << endl;
    return 0;
}#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll x, y;
    cin >> x >> y;
    ll s = abs(abs(x) - abs(y));
    //! 反転ボタンを押す数を決める
    if (y < x && (x < 0 || y > 0))
        s += 2;
    else if (y < x && 0 <= x)
        s++;
    else if (x < y && y > 0 && x < 0)
        s++;
    cout << s << endl;
    return 0;
}

Compiler output:
a.cc:28:2: error: stray '#' in program
   28 | }#include <bits/stdc++.h>
      |  ^
a.cc:28:3: error: 'include' does not name a type
   28 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:38:10: error: redefinition of 'const ll MOD'
   38 | const ll MOD = 1000000007;
      |          ^~~
a.cc:11:10: note: 'const ll MOD' previously defined here
   11 | const ll MOD = 1000000007;
      |          ^~~
a.cc:39:10: error: redefinition of 'const ll INF'
   39 | const ll INF = (ll)1e15;
      |          ^~~
a.cc:12:10: note: 'const ll INF' previously defined here
   12 | const ll INF = (ll)1e15;
      |          ^~~
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main()
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main()
      |     ^~~~
Language: C++

//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}

int
main(void){  
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  ll x, y, ans=0;
  cin >> x >> y;

  if(x >= 0 && y >= x) ans += abs(abs(y)-abs(x));
  else if(x >= 0 && x > y) {
    x = -x;
    ans++;
    ans += abs(abs(y)-ans(x));
  }
  else if(x < 0 && y >= x) ans += abs(abs(y)-abs(x));
  // x<0 && y < x
  else {
    x = -x;
    ans++;
    ans += abs(abs(y)-abs(x));
    x = -x;
    ans++;    
  }
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:26: error: 'ans' cannot be used as a function
   57 |     ans += abs(abs(y)-ans(x));
      |                       ~~~^~~
Language: C++

#include <iostream>
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}
int main(){
    int x,y;
    cin >> x >> y;
    int ans = INT_MAX;
    int dx = {1,1,-1,-1};
    int dy = {1,-1,1,-1};

    for (int i = 0; i < 4; ++i) {
        int tx = x * dx[i];
        int ty = y * dy[i];
        if (tx <= ty) {
            ans = min(ans, ty - tx);
        }
    }
    cout << ans << endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: scalar object 'dx' requires one element in initializer
   30 |     int dx = {1,1,-1,-1};
      |         ^~
a.cc:31:9: error: scalar object 'dy' requires one element in initializer
   31 |     int dy = {1,-1,1,-1};
      |         ^~
Language: C++

//program luogu.AT2263
#include <iostream>
#include <cstdio>
using namespace std;
#define LL long long

LL x,y;

int main(){
    scanf("%lld %lld",&x,&y);
    if( x==y )
    	printf("0\n");
    else if( !x || !y) {
    	if( y>x )
    		printf("%lld\n",y-x);
    	else
    		printf("%lld\n",x-y+1);
	}
    else if( x>0 && y>0 ) {
    	if( x>y )
    		printf("%lld\n",x-y+2);
    	else
    		printf("%lld\n",y-x);
	}
	else if( ( x<0 && y>0 ) || ( x>0 && y<0 ) )
		printf("%lld\n",abs(abs(a)-abs(b))+1);
	else {
		if( x>y )
    		printf("%lld\n",x-y+2);
    	else
    		printf("%lld\n",y-x);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:41: error: 'a' was not declared in this scope
   26 |                 printf("%lld\n",abs(abs(a)-abs(b))+1);
      |                                         ^
a.cc:26:48: error: 'b' was not declared in this scope
   26 |                 printf("%lld\n",abs(abs(a)-abs(b))+1);
      |                                                ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
inline long long abs(long long x) {
	return x > 0 ? x : -x;
}
long long x, y;
int main() {
	scanf ("%lld%lld", &x, &y);
	long long a = abs(x), b = abs(y);
	if (a > b) {
		if (x > 0 && y > 0) {
			printf ("%lld", -y + x + 2);
			return 0;
		} else if (x > 0 && y < 0) {
			printf ("%lld", y + x + 1);
			return 0; 
		} else if (x < 0 && y > 0) {
			printf ("%lld", -y - x + 1);
			return 0;
		} else if (x < 0 && y < 0) {
			printf ("%lld", -x + y);
			return 0;
		}
	} else {
		if (x > 0 && y > 0) {
			printf ("%lld", y - x);
			return 0;
		} else if (x > 0 && y < 0) {
			cout << -y - x + 1;
			return 0;
		} else if (x < 0 && y > 0) {
			cout << y + x + 1;
			return 0;
		} else if (x < 0 && y < 0) {
			cout << -y + x + 2;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: call of overloaded 'abs(long long int&)' is ambiguous
   10 |         long long a = abs(x), b = abs(y);
      |                       ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:4:18: note: candidate: 'long long int abs(long long int)'
    4 | inline long long abs(long long x) {
      |                  ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
a.cc:11:17: error: 'b' was not declared in this scope
   11 |         if (a > b) {
      |                 ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
inline long long abs(long long x) {
	return x > 0 ? x : -x;
}
long long x, y;
int main() {
	scanf ("%lld%lld", &x, &y);
	long long a = abs(x), b = abs(y);
	if (a > b) {
		if (x > 0 && y > 0) {
			printf ("%lld", -y + x + 2);
			return 0;
		} else if (x > 0 && y < 0) {
			printf ("%lld", -y + x + 1);
			return 0; 
		} else if (x < 0 && y > 0) {
			printf ("%lld", -y - x + 1);
			return 0;
		} else if (x < 0 && y < 0) {
			printf ("%lld", -x + y);
			return 0;
		}
	} else {
		if (x > 0 && y > 0) {
			printf ("%lld", y - x);
			return 0;
		} else if (x > 0 && y < 0) {
			cout << -y - x + 1;
			return 0;
		} else if (x < 0 && y > 0) {
			cout << y + x + 1;
			return 0;
		} else if (x < 0 && y < 0) {
			cout << -y + x + 2;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: call of overloaded 'abs(long long int&)' is ambiguous
   10 |         long long a = abs(x), b = abs(y);
      |                       ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:4:18: note: candidate: 'long long int abs(long long int)'
    4 | inline long long abs(long long x) {
      |                  ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
a.cc:11:17: error: 'b' was not declared in this scope
   11 |         if (a > b) {
      |                 ^
Language: C++

#include <iostream>

using namespace std;

int main() {
    int x, y;
    cin >> x >> y;

    int ans = numeric_limits<int>::max();
    for (int bit = 0; bit < 1 << 3; ++bit) {
        int cnt = 0, tx = x, ty = y;
        if (bit & (1 << 1)) {
            tx *= -1;
            ++cnt;
        }
        if (bit & (1)) {
            ty *= -1;
            ++cnt;
        }
        cnt += ty - tx;
        if (cnt < 0)continue;
        ans = min(ans, cnt);
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'numeric_limits' was not declared in this scope
    9 |     int ans = numeric_limits<int>::max();
      |               ^~~~~~~~~~~~~~
a.cc:9:30: error: expected primary-expression before 'int'
    9 |     int ans = numeric_limits<int>::max();
      |                              ^~~
Language: C++

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

int main() {
    int A, B, A-, B-;
    cin >> A >> B;
    A- = A * (-1);
    B- = B * (-1);

    int ans = pow(10, 9);
    if (A <= B) {
        ans = min(ans, B - A);
    }
    if (A <= B-) {
        ans = min(ans, B- - A);
    }
    if (A- <= B) {
        ans = min(ans, B - A-);
    }
    if (A- <= B-) {
        ans = min(ans, B- - A-);
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: expected initializer before '-' token
    5 |     int A, B, A-, B-;
      |                ^
a.cc:7:8: error: expected primary-expression before '=' token
    7 |     A- = A * (-1);
      |        ^
a.cc:8:8: error: expected primary-expression before '=' token
    8 |     B- = B * (-1);
      |        ^
a.cc:14:16: error: expected primary-expression before ')' token
   14 |     if (A <= B-) {
      |                ^
a.cc:17:12: error: expected primary-expression before '<=' token
   17 |     if (A- <= B) {
      |            ^~
a.cc:18:30: error: expected primary-expression before ')' token
   18 |         ans = min(ans, B - A-);
      |                              ^
a.cc:20:12: error: expected primary-expression before '<=' token
   20 |     if (A- <= B-) {
      |            ^~
a.cc:20:17: error: expected primary-expression before ')' token
   20 |     if (A- <= B-) {
      |                 ^
a.cc:21:31: error: expected primary-expression before ')' token
   21 |         ans = min(ans, B- - A-);
      |                               ^
Language: C

#include <iostream>
using namespace std;
int main(){
	long long int n,m;
	cin>>n>>m;
	if(m>=n)
	{
		cout<<min(m-n,m+n+1);
	}else if(n*m>=0){
		
		cout<<n-m+2;
		
		}else
		{
			cout<<n+m+1;
		}
	
	}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int x,y;
  cin >> x >> y;
  if(x==0){
    if(y>0){
      cout << y <<endl;
    }else{
      cout << -y+1 << endl;
    }
    return 0;
  }
  if(y==0){
    if(x>0){
      cout << 1+x << endl;
    }else{
      cout << -x << endl;
    }
    retrun 0;
  }
  if(x>=0 && y>x){
    cout << y-x << endl;
    return 0;
  }
  if(y>=0 && x>y){
    cout << y-x+1 << endl;
    return 0;
  }
  if(x>=0 && y<=0){
    cout << abs(y+x)+1 << endl;
    return 0;
  }
  if(y>=0 && x<=0){
    cout << abs(y+x)+1 << endl;
    return 0;
  }
  if(y<=0 && y>x){
    cout << y-x << endl;
    return 0;
  }
  if(x<=0 && y<x){
    cout << x-y+2 << endl;
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'retrun' was not declared in this scope
   20 |     retrun 0;
      |     ^~~~~~