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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

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

  if (y >= x) {
    if (x >= 0) { //1,2
      n = y-x; //B*0
    } else {
      if (y >= 0) {
        if (y >= -x) { //-1,5
          n = y+x+1; //B+A...
        } else { //-6, 5
          n = x-y+1;
        }
      } else　{
        n = y-x; //B*0
      }
    }
  } else {
    if (y >= 0) { //2,1
      n = x-y+2; //B+A+...+A+B
    } else {
      if (x >= -y) { //2,-1
        n = x+y+1; //B+A+...
      } else { //2,-3
        n = -x-y+1; //A...B
      }
    }

  }


  cout<<n;

  return 0;
}


Compiler output:
a.cc:21:9: error: extended character 　 is not valid in an identifier
   21 |       } else　{
      |         ^
a.cc: In function 'int main()':
a.cc:21:9: error: 'else\U00003000' was not declared in this scope
   21 |       } else　{
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

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

  if (y >= x) {
    if (x >= 0) { //1,2
      n = y-x; //B*0
    } else {
      if (y >= 0) {
        if (y >= -x) { //-1,5
          n = y+x+1 //B+A...
        } else { //-6, 5
          n = x-y+1
        }
      } else　{
        n = y-x; //B*0
      }
    }
  } else {
    if (y >= 0) { //2,1
      n = x-y+2; //B+A+...+A+B
    } else {
      if (x >= -y) { //2,-1
        n = x+y+1; //B+A+...
      } else { //2,-3
        n = -x-y+1; //A...B
      }
    }

  }


  cout<<n;

  return 0;
}


Compiler output:
a.cc:21:9: error: extended character 　 is not valid in an identifier
   21 |       } else　{
      |         ^
a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before '}' token
   17 |           n = y+x+1 //B+A...
      |                    ^
      |                    ;
   18 |         } else { //-6, 5
      |         ~           
a.cc:19:20: error: expected ';' before '}' token
   19 |           n = x-y+1
      |                    ^
      |                    ;
   20 |         }
      |         ~           
a.cc:21:9: error: 'else\U00003000' was not declared in this scope
   21 |       } else　{
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

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

  if (y >= x) {
    if (x >= 0) {
      n = y-x; //B*0
    } else {
      if (y >= -x) {
        n = y+x+1; //B*1
      } else {
        n = y-x; //B*0
      }
    }
  } else {
    if (y >= 0) {
      n = x-y+2 //B+A+...+A+B
    } else {
      if (x >= -y) {
        n = x+y+1; //B+A+... 
      } else {
        n = x+y;
      }
    }
    
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: expected ';' before '}' token
   23 |       n = x-y+2 //B+A+...+A+B
      |                ^
      |                ;
   24 |     } else {
      |     ~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <fstream>
#include <cassert>
using namespace std;

#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define rep(i, s, n)  for(int i = s; i <= (n); ++i)
#define rev(i, n, s)  for(int i = (n); i >= s; --i)
#define fore(x, a) for(auto &&x : a)
typedef long long ll;
const int mod = 1000000007;
const int N = 100005;


int main() {
#ifdef loc
  if(!freopen((string(FOLDER) + "inp.txt").c_str(), "r", stdin)) {
    assert(0);
  }
  freopen((string(FOLDER) + "out.txt").c_str(), "w", stdout);
#endif
  boost;
  int a, b;
  cin >> a >> b;
  ll a, b;
  cin >> a >> b;
  ll ans = abs(abs(b) - abs(a));
  if (a*b < 0) ans++;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: conflicting declaration 'll a'
   51 |   ll a, b;
      |      ^
a.cc:49:7: note: previous declaration as 'int a'
   49 |   int a, b;
      |       ^
a.cc:51:9: error: conflicting declaration 'll b'
   51 |   ll a, b;
      |         ^
a.cc:49:10: note: previous declaration as 'int b'
   49 |   int a, b;
      |          ^
Language: C

#include <stdio.h>
#include <math.h>
int main(void)
{
  int x,y,i=0;
  scanf("%d",&x);
  scanf("%d",&y);
  if((x=>0&&y<0)||(x<0&&y=>0)){
    i=1;
  }else if(x<0&&y<0){
    i=2;
  }
  int value;
  x=abs(x);
  y=abs(y);
  if(x==y){
    printf("%d\n",i);
  }else if(x>y){
    value=x-y;
    printf("%d\n",value+i);
  }else{
    value=y-x;
    printf("%d\n",value+i);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected expression before '>' token
    8 |   if((x=>0&&y<0)||(x<0&&y=>0)){
      |         ^
main.c:8:27: error: expected expression before '>' token
    8 |   if((x=>0&&y<0)||(x<0&&y=>0)){
      |                           ^
main.c:14:5: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   14 |   x=abs(x);
      |     ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | int main(void)
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'x' was not declared in this scope
   25 |                 if(x<0)
      |                    ^
Language: C++

#include <iostream>
using namespace std;

long long solve(long long x, long long y){
	if(a <= b) return b - a;
	return 1e15;
}

int main(){
	long long x, y;
	cin >> x >> y;
	long long ans = 1e15;
	ans = min(ans, solve(x, y));
	ans = min(ans, solve(-x, y) + 1);
	ans = min(ans, solve(x, -y) + 1);
	ans = min(ans, solve(-x, -y) + 2);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int solve(long long int, long long int)':
a.cc:5:12: error: 'a' was not declared in this scope
    5 |         if(a <= b) return b - a;
      |            ^
a.cc:5:17: error: 'b' was not declared in this scope
    5 |         if(a <= b) return b - a;
      |                 ^
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.NoSuchElementException;

public class A {
	public static void main(String[] args) {
		FS r = new FS();
		long x = r.nextLong();
		long y = r.nextLong();
		long tmpx = x;
		long tmpy = y;
		long minCount = 1000000500;
		long c = 0;
		// case 1  :  + -> +
		if(tmpx < 0){
			tmpx = -tmpx;
			c++;
		}
		if(tmpy < 0){
			tmpy = -tmpy;
			c++;
		}
		if(tmpy < tmpx) c = minCount+1;
		else c += tmpy - tmpx;
		minCount = Math.min(minCount, c);
		// case 2  :  + -> -
		c = 0;
		tmpx = x;
		tmpy = y;
		if(tmpx < 0){
			tmpx = -tmpx;
			c++;
		}
		if(tmpy > 0){
			tmpy = -tmpy;
			c++;
		}
		if(tmpy < tmpx) c = minCount+1;
		else c+= tmpy - tmpx;
		minCount = Math.min(minCount, c);
		// case 3  :  - -> +
		c = 0;
		tmpx = x;
		tmpy = y;
		if(tmpx > 0){
			tmpx = -tmpx;
			c++;
		}
		if(tmpy < 0){
			tmpy = -tmpy;
			c++;
		}
		if(tmpy < tmpx) c = minCount+1;
		else c+= tmpy - tmpx;
		minCount = Math.min(minCount, c);
		// case 4  :  - -> -
		c = 0;
		tmpx = x;
		tmpy = y;
		if(tmpx > 0){
			tmpx = -tmpx;
			c++;
		}
		if(tmpy > 0){
			tmpy = -tmpy;
			c++;
		}
		if(tmpy < tmpx) c = minCount+1;
		else c+= tmpy - tmpx;
		minCount = Math.min(minCount, c);

		System.out.println(minCount);
	}

	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}

		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}


Compiler output:
Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

import java.util.Scanner;
class Main{
public static void main(String args[]){
Scanner inp=new Scanner(System.in);
int x=inp.nextInt();
int y=inp.nextInt();
int c=0;

y-x=c;

System.out.println(c);
}
}

Compiler output:
Main.java:9: error: unexpected type
y-x=c;
 ^
  required: variable
  found:    value
1 error
Language: C++

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:32:34: error: expected ';' before '}' token
   32 |             ret = min(ret, y+x+1)
      |                                  ^
      |                                  ;
   33 |         }
      |         ~
Language: Java

import java.util.Scanner;
public class renshu{
 
public static void main(String[] args){
	Scanner kbs=new Scanner(System.in);
	int x=kbs.nextInt();
	int y=kbs.nextInt();
	int a=0,b=0;
	 if(y<0&&x>0){
		y*=-1;
		a++;
	 }else if(y>0&&x<0){
		x*=-1;
		a++;
	}
	else if(y<0&&x<0){
		a+=2;
		x*=-1;
		y*=-1;
	}
		
	
	
	b=x-y;
	if(b<0){b*=-1;}
	System.out.println(a+b);
	
	}
}

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

    #include <bits/stdc++.h>
     
    using namespace std;
     
    #define FOR(i,a,b)		for(int i=(a),_b=(b);i<(_b);++i)
    #define FORD(i,a,b)		for(int i=(a),_b=(b);i>(_b);--i)
    #define pb			push_back
    #define mp			make_pair
    #define	all(c)			(c).begin(),(c).end()
    #define	present(c,x)		((c).find(x) != (c).end())
    #define	cpresent(c,x)		(find(all(c),x) != (c).end())
    #define	endl			'\n'
     
    typedef long long		ll;
    typedef unsigned long long	ull;
    typedef unsigned char	 	byte;
    typedef vector<int>		vi;
    typedef pair<int, int>		pii;
    typedef pair<ll, ll>		pll;
    typedef vector<pii>		vpii;
     
    const int MX = 25;
     
    int main(int argc, char *argv[])
    {
    #ifdef	HTRINH_UNIT_TEST
    	freopen(argv[1],"r",stdin);
    	ifstream cin(argv[1]);
    #endif
    #if 0
    	ofstream cout(argv[2]);
    #endif
    	ios :: sync_with_stdio(false);
    	cin.tie(NULL);
     
    	int x,y;
    	cin >> x >> y;
    	if (x == y) {
    		cout << 0 << endl;
    	} else if (x < y) {
    		if (x >= 0 || y <= 0) cout << y-x << endl;
    		else cout << 1+abs(abs(y)-abs(x)) << endl;
    		}
    	} else { // x > y
    		if (y >= 0) cout << 1+x+y << endl;
    		else {
    			if (x == 0) cout << 1+abs(y) << endl;
    			else if (x > 0) {
    				if (abs(x) >= abs(y)) cout << 1+abs(x)-abs(y) << endl;
    				else cout << 1+abs(y)-abs(x) << endl;
    			} else {
    				cout << 2+abs(y)-abs(x) << endl;
    			}
    		}
    	}
    	return 0;
    }

Compiler output:
a.cc:44:11: error: expected unqualified-id before 'else'
   44 |         } else { // x > y
      |           ^~~~
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:5: error: expected declaration before '}' token
   57 |     }
      |     ^
Language: C++

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

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

	vector<int64_t> p = { x, y, -x, -y };

	int64_t g[4][4];
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 4; j++) {
			g[i][j] = 1e9;
			if (i == j) {
				g[i][j] = 0;
			}
			if (p[i] == -p[j]) {
				g[i][j] = min(g[i][j], 1LL);
			}
			if (p[i] <= p[j]) {
				g[i][j] = min(g[i][j], p[j] - p[i]);
			}
		}
	}

	for (int k = 0; k < 4; k++) {
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 4; j++) {
				g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
			}
		}
	}

	cout << g[0][1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:46: error: no matching function for call to 'min(int64_t&, long long int)'
   18 |                                 g[i][j] = min(g[i][j], 1LL);
      |                                           ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:46: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   18 |                                 g[i][j] = min(g[i][j], 1LL);
      |                                           ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:18:46: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   18 |                                 g[i][j] = min(g[i][j], 1LL);
      |                                           ~~~^~~~~~~~~~~~~~
Language: C++

import java.util.*;

class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        int A = sc.nextInt(), B = sc.nextInt();

                        if (B > A) {
                                System.out.println(Math.min(B - A, B + A + 2));
                        } else {
                                System.out.println(Math.min(A - B + 2, -A - B + 1));
                        }
                }
        }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String args[]) {
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String args[]) {
      |                                 ^~~~~~
a.cc:15:2: error: expected ';' after class definition
   15 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:21: error: expected '{' before '(' token
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                     ^
a.cc:5:21: error: expected 'catch' before '(' token
a.cc:5:22: error: 'Scanner' does not name a type
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                      ^~~~~~~
a.cc:5:33: error: expected ')' before '=' token
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                                 ^
a.cc:5:21: note: to match this '('
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                     ^
a.cc:5:33: error: expected '{' before '=' token
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                                 ^
a.cc:5:33: error: expected primary-expression before '=' token
a.cc:5:39: error: expected type-specifier before 'Scanner'
    5 |                 try (Scanner sc = new Scanner(System.in)) {
      |                                       ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <utility>
#include <string>
#include <cmath>
#include <set>
#include <functional>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define show(x) cout << #x << " = " << x << endl;
typedef long long ll;
typedef pair<int,int> pii;
int main(){
    ll x,y;
    cin >> x >> y;
    ll ans = LONG_LONG_MAX;
    if(x<=y)ans = min(ans,y-x);
    if(-x<=y)ans = min(ans,y+x+1);
    if(x<=-y)ans = min(ans,-y-x+1);
    if(-x<=-y)ans = min(ans,-y+x+2);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: 'LONG_LONG_MAX' was not declared in this scope
   23 |     ll ans = LONG_LONG_MAX;
      |              ^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;
int N,K;
int A[SIZE];
int main(){
	REP(i,7){
		cin >> A[i];
	}
	int ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
	if((A[0] && A[3] && A[4] )){
	   ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:6:7: error: 'SIZE' was not declared in this scope
    6 | int A[SIZE];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:9:24: error: 'A' was not declared in this scope
    9 |                 cin >> A[i];
      |                        ^
a.cc:11:17: error: 'A' was not declared in this scope
   11 |         int ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;
LL N,K;
LL A[SIZE];
int main(){
	REP(i,7){
		cin >> A[i];
	}
	LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
	if((A[0] && A[3] && A[4] )){
	   ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:5:1: error: 'LL' does not name a type
    5 | LL N,K;
      | ^~
a.cc:6:1: error: 'LL' does not name a type
    6 | LL A[SIZE];
      | ^~
a.cc: In function 'int main()':
a.cc:9:24: error: 'A' was not declared in this scope
    9 |                 cin >> A[i];
      |                        ^
a.cc:11:9: error: 'LL' was not declared in this scope
   11 |         LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
      |         ^~
a.cc:12:13: error: 'A' was not declared in this scope
   12 |         if((A[0] && A[3] && A[4] )){
      |             ^
a.cc:13:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |            ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3);
      |            ^~~
      |            abs
a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int main()
{
	ll x,y;
	while(cin>>x>>y)
	{
		ans=(ll)1e18;
		//x<=y才能用op:A 
		if(x<=y)
		ans=min(ans,y-x);
		if(-x<=y)
		ans=min(ans,1+y-(-x));//先变号BA 
		if(x<=-y)
		ans=min(ans,1+(-y-x));//加完后变号AB
		if(-x<=-y)
		ans=min(ans,1+1+(-y)-(-x));//BAB
		
		cout<<ans<<endl;
	} 
	
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |                 ans=(ll)1e18;
      |                 ^~~
      |                 abs
Language: C++

#include <iostream>
using namespace std;

int main(){

  int x, y;

  cin >> x >> y;

  if(x == y * (-1)){
    cout << 1 << endl;
    return 0;
  }
  
  if(x >= 0 && y >= 0){    
    if(x < y){
      cout << y - x << endl;
    } else {
      cout << x - y + 2 << endl;
    }
  }

  else if(x < 0 && y < 0){
    if(x < y){
      cout << y - x << endl;
    } else {
      cout << x - y + 2 << endl;
    }
  } 
  else if(x >= 0 && y < 0){
    if(x > (y * (-1))){
      cout << x + y + 1 << endl;
    } else {
      cout << (x + y) * (-1) + 1 << endl;
    }
  } 
  else { // x < 0 && y >= 0
    if(y > (x * (-1))){
      cout << x + y + 1 << endl;
    } else {
      cout << (x + y) * (-1) + 1 << enld;
    }
  }


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:37: error: 'enld' was not declared in this scope
   41 |       cout << (x + y) * (-1) + 1 << enld;
      |                                     ^~~~
Language: Java

import java.util.Scanner;

public class agc008_a {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        long y = sc.nextLong();
        sc.close();
        long ax = Math.abs(x);
        long ay = Math.abs(y);
        long clickCnt = 0;

        if (x == 0) {
            if (0 < y) {
                clickCnt = y;
            } else {
                clickCnt = ay + 1;
            }
        } else if (y == 0) {
            if (0 < x) {
                clickCnt = ax;
            } else {
                clickCnt = ax + 1;
            }
        } else if (x > 0 && y > 0) {
            // 両方正
            if (x < y) {
                clickCnt = y - x;
            } else {
                clickCnt = y - x + 2;
            }
        } else if (x < 0 && y > 0) {
            // x:負、y:正
            clickCnt = y - x;
        } else if (x > 0 && y < 0) {
            // x:正、y:負
            if (ax < ay) {
                clickCnt = ay - ax + 1;
            } else {
                clickCnt = x + y + 1;
            }
        } else if (x < 0 && y < 0) {
            // x:負、y:負
            if (ax < ay) {
                clickCnt = 2 + ay - ax;
            } else {
                clickCnt = ax - ay;
            }
        }

        System.out.println(clickCnt);
    }

}


Compiler output:
Main.java:3: error: class agc008_a is public, should be declared in a file named agc008_a.java
public class agc008_a {
       ^
1 error
Language: Java

import java.util.Scanner;

public class {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        long y = sc.nextLong();
        sc.close();
        long ax = Math.abs(x);
        long ay = Math.abs(y);
        long clickCnt;
        if (x >= 0 && y >= 0) {
            // 両方正
            if (x < y) {
                clickCnt = y - x;
            } else {
                clickCnt = y - x + 2;
            }
        } else if (x < 0 && y >= 0) {
            // x:負、y:正
            clickCnt = y - x;
        } else if (x >= 0 && y < 0) {
            // x:正、y:負
            if (ax < ay) {
                clickCnt = ay - ax + 1;
            } else {
                clickCnt = x + y + 1;
            }
        } else {
            // x:負、y:負
            if (ax < ay) {
                clickCnt = 2 + ay - ax;
            } else {
                clickCnt = ax - ay;
            }
        }
        System.out.println(clickCnt);
    }
}


Compiler output:
Main.java:3: error: <identifier> expected
public class {
            ^
1 error
Language: C++

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define LONG_INF 100000000000000
int main(){
 int a,b;
cin >>a >> b;
int cnt=0;
if(a < 0){
 a *= -1;
 b *= -1;
 if(a*b > 0) cnt = 2;
}

if(a*b<0) cnt++;
if(abs(a) >= abs(b)){
   cout << abs(a+b)+1 <<endl:
}else{
  cout << abs(b)-abs(a)+cnt << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:29: error: expected ';' before ':' token
   39 |    cout << abs(a+b)+1 <<endl:
      |                             ^
      |                             ;
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll a,b,c,d;
    while(cin>>a>>b)
    {
        c=0;
        if(a<0&&b<0)
        {
            a=a*(-1);
            b=b*(-1);
            if(a<b)c=abs(a-b)+2;
            else
                c=abs(a-b);

        }
        else if(a<=0&&b>0)
        {
            if(a==0)c=b;
            a=a*(-1);
           else if(a<b)
                c=abs(a-b)+1;
            else c=a+b+1;
        }
        else if(a>=0&&b<0)
        {
            b=b*(-1);
            if(a==0)c=b;
            else 

                c=abs(a-b)+1;
        }
        else if(a>0&&b>0)
        {
            if(a>b)
            {
                c=(a+b)+1;

            }
            else  c=(abs(a-b));
        }


        cout<<c<<endl;
    }
    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected '}' before 'else'
   23 |            else if(a<b)
      |            ^~~~
a.cc:20:9: note: to match this '{'
   20 |         {
      |         ^
a.cc:27:9: error: 'else' without a previous 'if'
   27 |         else if(a>=0&&b<0)
      |         ^~~~
a.cc: At global scope:
a.cc:48:5: error: expected unqualified-id before 'return'
   48 |     return 0;
      |     ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define LONG_INF 100000000000000
int main(){
 int a,b;
cin >>a >> b;
if(a < 0){
 a *= -1;
 b *= -1;
}
int cnt=0;
if(a*b<0) cnt++;
else if(a < 0&&b < 0) cnt = 2;
if(abs(a) >= abs(b)){
   cout << abs(a+b)+1 <<endl:
}else{
  cout << abs(b)-abs(a)+cnt << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:29: error: expected ';' before ':' token
   38 |    cout << abs(a+b)+1 <<endl:
      |                             ^
      |                             ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before '}' token
   25 |       cnt=1+x+y
      |                ^
      |                ;
   26 |     }
      |     ~           
a.cc:28:10: error: expected ';' before '}' token
   28 | cout<<cnt
      |          ^
      |          ;
   29 | }
      | ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before '}' token
   25 |       cnt=1+x+y
      |                ^
      |                ;
   26 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namepsace std;
int main(){
    int a,b;
    cin>>a>>b;
    int ans = 0;
    if(a<0&&b>0||a>0&&b<0)
        ans++;
    if(a>b&&a<0&&b<0)
        ans+=2;
    a=abs(a);
    b=abs(b);
    ans+=abs(a-b);


}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>a>>b;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include<bits/stdc++.h>
using namepsace std;
int main(){
    int a,b;
    cin>>a>>b;
    int ans = 0;
    if(a<0&&b>0||a>0&&b<0)
        ans++;
    if(a>b&&a<0&&b<0);
        ans+=2;
    a=abs(a);
    b=abs(b);
    ans+=abs(a-b);


}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>a>>b;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
using namespace std;

int main() {
  int a, b, ans = 0;
  cin >> a >> b;
  if((a >= 0 && b < 0) || (a < 0 && b >= 0)) {
    if(b != 0)) {
      ans++;
    }
  }else {
    if(a > b) ans += 2;
  }
  if(a < 0) a = -a;
  if(b < 0) b = -b;
  ans += max(a, b) - min(a, b);
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before ')' token
   10 |     if(b != 0)) {
      |               ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
void test1(){
    int x,y;
    cin>>x>>y;
    if(abs(x)==abs(y)&&a/b==-1){
        cout<<-1<<endl;
        return;
    }
    if(x<=y){
        if(x<0&&y>=0) cout<<abs(abs(y)-(abs(x)))+1<<endl;
        else cout<<y-x<<endl;
        return;
    }else{
        if(abs(x)>abs(y)){      //x<0&&y<0||x>0&&y<0
            if(x>0&&y>0){
                cout<<abs(abs(y)-(abs(x)))+2<<endl;
            }else{  //x>0&&y<0
                cout<<abs(abs(y)-(abs(x)))+1<<endl;
            }
            return;
        }
        else{
            if(x<0&&y<0){
                cout<<x-y+2<<endl;
            }else{
                if(x>0&&y<0){
                    cout<<abs(abs(x)-abs(y))+1<<endl;
                }
                else cout<<x-y+1<<endl;
            }
            return;
        }
    }
}

int main()
{
        test1();
    return 0;
}


Compiler output:
a.cc: In function 'void test1()':
a.cc:7:24: error: 'a' was not declared in this scope
    7 |     if(abs(x)==abs(y)&&a/b==-1){
      |                        ^
a.cc:7:26: error: 'b' was not declared in this scope
    7 |     if(abs(x)==abs(y)&&a/b==-1){
      |                          ^
Language: C

#include <stdio.h>

int main(void) {
	int x, y;
	int button = 0;
	
	scanf("%d %d", &x, &y);
	
	if (y == x*-1) button = 1;
	
	if (x < y){
		if (x > 0) button = y - x;
		else button = y - x*-1 + 1;
	else {
		if ((x > 0 && y > 0) || (x < 0 && y < 0)) button = x - y + 2;
		else if (x == 0) button = y*-1 + 1;
		else if (y == 0) button = x+1;
		else button = x + y + 1;
	}
	
	printf("%d\n", button);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:9: error: expected '}' before 'else'
   14 |         else {
      |         ^~~~
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

long long int x, y;
long long int anscnt;

int main(){
	scanf("%lld %lld", &x, &y);
	if (y < x){
		if (y > 0){
			anscnt = (x - y) + 2;
		}
		else if (x < 0){
			anscnt = (x - y) + 2;
		}
		else{
			if (x > (y * -1)){
				anscnt = (y - x * -1) + 1;
			}
			else{
				anscnt = (y * -1 - x) + 1;
			}
		}
	}
	else if (x == y){
		anscnt = 0;
	}
	else if (x < y){
		if (x >= 0){
			anscnt = y - x;
		}
		else if (y <= 0){
			anscnt = y - x;
		}
		else{
			if (x > (y * -1)){
				anscnt = (y - x * -1) + 1;
			}
			else{
				anscnt = (y * -1 - x) + 1;
			}
		}
	}
	printf("%lld\n", anscnt);
	

Compiler output:
a.cc: In function 'int main()':
a.cc:46:34: error: expected '}' at end of input
   46 |         printf("%lld\n", anscnt);
      |                                  ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

long long int x, y;
long long int anscnt;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: expected primary-expression before '<' token
   34 |                 else if (y =< 0){
      |                             ^
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

LL x, y;

int main(void) {
    cin >> x >> y;
    LL ans = INF;
    if (-x == y) {
        cout << 1 << endl;
        return 0;
    }
    if (x < 0 && y < 0) {
        if (x > y) {
            ans = llabs(llabs(x) - llabs(y)) + 2;
            ans = min(ans, )
        } else {
            ans = min(ans, y - x);
        }
    } else if (x < 0) {
        if (-x < y) {
            ans = y - x;
        } else {
            ans = y + x + 1;
        }
    } else if (y < 0) {
        if (x < -y) {
            ans = llabs(x + y) + 1;
        } else {
            ans = 1 + y + x;
        }
    } else {
        if (x < y) {
            ans = y - x;
        } else {
            ans = 1 + y + x;
            ans = min(ans, -y + x + 2);
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:28: error: expected primary-expression before ')' token
   73 |             ans = min(ans, )
      |                            ^
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);

		int x = scn.nextInt();
		int y = scn.nextInt();
		int cnt = 0;

		if(Math.abs(x) > Math.abs(y) && x > 0 && y >= 0) {
			x = -x;
			cnt++;
		} else  if(Math.abs(x) > Math.abs(y) && x > 0 && y <= 0) {
			x = -x;
			cnt++;
		} else if(Math.abs(x) < Math.abs(y) && x <= 0 && y > 0) {
			x = -x;
			cnt++;
		} else if(Math.abs(x) < Math.abs(y) && x < 0 && y <= 0) {
			x = -x;
			cnt++;
		}
		
		while(Math.abs(x) != Math.abs(y)){
			x++;
			cnt++;
		}
		
		if(x == -y && (x > 0 || x < 0) cnt++;



		System.out.println(cnt);
	}
}

Compiler output:
Main.java:29: error: ')' expected
		if(x == -y && (x > 0 || x < 0) cnt++;
		                              ^
1 error
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> x >> y;
      |   ^~~
a.cc:5:5: error: 'cout' was not declared in this scope
    5 |     cout << (y-x);
      |     ^~~~
a.cc:8:7: error: 'cout' was not declared in this scope
    8 |       cout << (y-(-x)+1);
      |       ^~~~
a.cc:10:7: error: 'cout' was not declared in this scope
   10 |       cout << (y-(-x)+1);
      |       ^~~~
a.cc:12:7: error: 'cout' was not declared in this scope
   12 |       cout << (-y-x+1);
      |       ^~~~
a.cc:16:7: error: 'cout' was not declared in this scope
   16 |       cout << (y-x);
      |       ^~~~
a.cc:18:7: error: 'cout' was not declared in this scope
   18 |       cout << min(y-x,y-(-x)+1);
      |       ^~~~
a.cc:18:15: error: 'min' was not declared in this scope; did you mean 'main'?
   18 |       cout << min(y-x,y-(-x)+1);
      |               ^~~
      |               main
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << (x-y+2);
      |     ^~~~
Language: Java

import java.io.*;
import java.util.StringTokenizer;

public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Taska solver = new Taska();
        solver.solve(1, in, out);
        out.close();
    }

    static class Taska {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int x = in.nextInt();
            int y = in.nextInt();
            if (x == y) {
                out.println(0);
                return;
            }
            int d = Math.abs(Math.abs(x) - Math.abs(y));
            int ans = d;
            // make abs equal
            if (Math.abs(x + d) == Math.abs(y)) {
                if ((x + d) != y) ans++;
                out.println(ans);
                return;
            }
            ans++;
            x *= -1;
            if ((x + d) != y) ans++;
            out.println(ans);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

#include <bits/stdc++.h>

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(ll i=0;i<(n);i++)

using namespace std;



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

    if(x < y){
        cout << y-x << endl;
    }
    else if(x > y){
        else if(0 < x && y < 0){
            cout << 1 + abs(y+x) << endl;
        }
        else{
            cout << 2 + abs(y-x) << endl;
        }
    }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected '}' before 'else'
   19 |         else if(0 < x && y < 0){
      |         ^~~~
a.cc:18:19: note: to match this '{'
   18 |     else if(x > y){
      |                   ^
a.cc: At global scope:
a.cc:28:5: error: expected unqualified-id before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);
#define setnow clock_t tStart=clock();
#define time (double)(clock() - tStart)/CLOCKS_PER_SEC;
typedef long long ll;
typedef long long int lli;
typedef pair < int, int> dbl;
const int maxInt = 1e9*2;
const lli maxLong = 1e18*2;
#define int long long int


int main(){
           // setnow;
           int x,y;
           cin >> x >> y;
           if(x >= 0 && y >= 0){
                if(x < y)
                        return cout << y - x, 0;
                if(x > y)
                        return cout << 2 + x - y, 0;
           }
           if(x < 0 && y < 0){
                if(x < y)
                        return cout << abs(x - y), 0;
                if(x > y)
                        return cout << 2 + abs(x - y), 0;
           }
           if(x >= 0 && y < 0){
                return cout << 1 + abs(x - (abs(y))), 0;
           }
           if(x < 0 && y >= 0){
                return cout << 1 + abs(abs(x)- y), 0;
           }
           // cout << fixed << time;
	return 0;
}


Compiler output:
a.cc:11:23: error: '::main' must return 'int'
   11 | #define int long long int
      |                       ^~~
a.cc:14:1: note: in expansion of macro 'int'
   14 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

//#define DEBUG
ll power(ll x,ll y){
  ll t=1;
  while(y>0){
    if(y%2) y-=1,t=t*x%mod;
    else y/=2,x=x*x%mod;
  }
  return t;
}
#ifdef DEBUG
#define dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define dprintf(fmt,...)
#endif

int main(){
  ll x,y; scanf("%lld%lld",&x,&y);
  if(y>=0){
    ll ans = INF;
    if(x<=y) ans = min(ans,1ll*y-x);
    if(-x<=y) ans = min(ans,1ll*y+x+1);
    if(abs(x)>=abs(y)){
      if(x<0) ans=min(ans,abs(x)-abs(y)+1);
      else abs=min(ans,2+abs(x)-abs(y));
    }
    printf("%lld\n",ans);
  }else{
    if(x<=y) printf("%lld\n",y-x);
    else{
      if(abs(x)>=abs(y)){
        ll ans = 1+abs(x)-abs(y);
        printf("%lld\n",ans);
      }else{
        ll ans = min(1+abs(y)-x,2+abs(y)+x);
        printf("%lld\n",ans);
      }
    }
  }   
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:39: error: overloaded function with no contextual type information
   45 |       else abs=min(ans,2+abs(x)-abs(y));
      |                                       ^