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

#include <iostream>
using namespace std;
int main(){
    long long n, a, b, ans;
    cin >> n >> a >> b;
    if(a%2==1&&b%2==1){
        ans = (b-a) / 2;
    }else if(a%2==0&&b%2==0){
        ans = (b-a) / 2;
    }
    ans = min({n-a,b-1,ans});
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   11 |     ans = min({n-a,b-1,ans});
      |           ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,a,b;
    cin>>n>>a>>b;
    if((b-a)%2==0)
        cout<<(b-a)/2<<endl;
    else
      cout<<min((a+(((b-a)-1)/2)),((n-b+1)+(b-a-1)/2)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:54: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |       cout<<min((a+(((b-a)-1)/2)),((n-b+1)+(b-a-1)/2)<<endl;
      |                                   ~~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <climits>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <array>
#include <memory>

#define IN(a,b) (a.find(b) != a.end())
#define p(a,b) make_pair(a,b)
#define readVec(a) for (int __i = 0; __i<(int)a.size();__i++){cin>>a[__i];}

// jimjam

template<typename T>
void pMin(T &a, T b) {if (b<a){a=b;}}
template<typename T>
void pMax(T &a, T b) {if (b>a){a=b;}}
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& c);
template<typename A, typename B>
std::ostream& operator<<(std::ostream& os, const std::pair<A,B>& c) {std::cout << "(" << c.first << ", " << c.second << ")";return os;}
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& c) {
	if (c.size() == 0) {os << "{}"; return os;}
	os << "{" << c[0];
	for (int64_t i = 1; i < (int)c.size(); i++) {os <<", "<<c[i];}
	os << "}";
	return os;
}

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int64_t n, a, b; cin >> n >> a >> b;

	if ((b-a)%2==0) {
		cout << (b-a)/2 << "\n";
	} else {
		int64_t ans = b-1;	
		pMin(ans,n-a);
		{
			int64_t toLeft = a; // time
			pMin(ans, toLeft + (b-toLeft)/2);
		} 
		{
			int64_t toRight =n-b+1;
			pMin(ans, toRight + (n-a-toLeft)/2);
		}
		cout<<ans<<"\n";
	}
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:56:50: error: 'toLeft' was not declared in this scope
   56 |                         pMin(ans, toRight + (n-a-toLeft)/2);
      |                                                  ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

int main(){cout<<fixed<<setprecision(20);
		   ll n,a,b;
           cin>>n>>a>>b;
           if((b-a)%2==0)cout<<abs(a-b)/2<<endl;
           else{
             ll ans=INF;
             ll c=b-a;
             ll d=min(n-b,a-1);
             ans=d+1+(b-a-1)/2;
             chmin(ans,cnt+(b-a)/2);
             cout<<ans<<endl;
           }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: 'cnt' was not declared in this scope; did you mean 'int'?
   34 |              chmin(ans,cnt+(b-a)/2);
      |                        ^~~
      |                        int
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
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; }
 
ll MOD = 1000000007;
ll INF =1<<30;



int main(){
    ll n,a,b;
    cin >> n >> a>>b;
    if((b-a)%2==0){
        cout << (b-a)/2 <<endl;
        return 0;
    }
    else cout << min(a+(b-a-1)/2,min(n-b+1+(n-a+(n-b+1)/2),min(b-1,n-a)) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:74: error: invalid operands of types 'const long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   24 |     else cout << min(a+(b-a-1)/2,min(n-b+1+(n-a+(n-b+1)/2),min(b-1,n-a)) <<endl;
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower

using namespace std;

int main()
{
  long long n, a, b;
  cin >> n >> a >> b 
  if ((b - a) % 2 == 0)
  {
    cout << (b - a) / 2 << endl;
    return 0;
  }
  else{
    cout << min(a - 1, n - b) + 1 + (b - a - 1) / 2 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected ';' before 'if'
   24 |   cin >> n >> a >> b
      |                     ^
      |                     ;
   25 |   if ((b - a) % 2 == 0)
      |   ~~                 
a.cc:30:3: error: 'else' without a previous 'if'
   30 |   else{
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std; 
typedef long long int ll;
const long long int m=pow(10,9)+7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    unsigned long long int n,a,b;
    cin>>n>>a>>b;
    ll d,x,temp;
    d=abs(b-a);
    if(d%2==0)
        cout<<d/2<<endl;
    else
    {
        if(a>b)
        {temp=a;a=b;b=temp;}
        x=min(b-1,n-a);
        cout<<x<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
   13 |     d=abs(b-a);
      |       ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 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;
      |            ^~~
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); }
      |   ^~~
Language: Java

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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

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

    if((b-a)%2==0)
        cout << (b-a)/2 << endl;
    else
        cout << min(a-1,n-b)+1+(b-a-1)/2 << endl;

    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:5: error: illegal character: '#'
#define rep(i,x) for(int i=0;i<x;i++)
^
Main.java:5: error: class, interface, enum, or record expected
#define rep(i,x) for(int i=0;i<x;i++)
        ^
Main.java:5: error: class, interface, enum, or record expected
#define rep(i,x) for(int i=0;i<x;i++)
                             ^
Main.java:5: error: class, interface, enum, or record expected
#define rep(i,x) for(int i=0;i<x;i++)
                                 ^
Main.java:6: error: illegal character: '#'
#define put(ans)    cout << ans << endl;
^
Main.java:10: error: not a statement
    cin >> n >> a >> b;
                  ^
Main.java:13: error: not a statement
        cout << (b-a)/2 << endl;
                        ^
Main.java:15: error: not a statement
        cout << min(a-1,n-b)+1+(b-a-1)/2 << endl;
                                         ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
12 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N,A,B;
  cin >> N >> A >> B;
  int C=0;
  C= B-A;
  int D=0;
  if(C%2==0)
  {
    C=C/2;
    cout << c << endl;
  }
  else
  {
   B=B-A;
   C=A;
   C=C+(B-1)/2
   cout << C << endl;
  }
}
   B=B-A;

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'c' was not declared in this scope
   13 |     cout << c << endl;
      |             ^
a.cc:19:15: error: expected ';' before 'cout'
   19 |    C=C+(B-1)/2
      |               ^
      |               ;
   20 |    cout << C << endl;
      |    ~~~~        
a.cc: At global scope:
a.cc:23:4: error: 'B' does not name a type
   23 |    B=B-A;
      |    ^
Language: C++

n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
  print((b-a)//2)
else:
  print(min(a-1, n-b) + 1 + ((b-a-1)//2)

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

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

int main(){

    ull N, A, B;
    cin >> N >> A >> B;

    ll min_value = min(A-1, N-B);
    ll dif = B - A;

    if (dif%2 == 0){
        ans = dif;
    }
    else{
        ans = min_value + 1 + (B-A-1)/2;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         ans = dif;
      |         ^~~
      |         abs
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         ans = min_value + 1 + (B-A-1)/2;
      |         ^~~
      |         abs
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<vector<int>> Graph;

int main() {
    ll n,a,b;
    cin >> n >> a >> b;
    if(a%2==b%2){
        cout << (b-a)/2 << endl;
    } else {
        cout << min(b-1,n-a) + 1 (b-a-1)/2 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:34: error: expression cannot be used as a function
   15 |         cout << min(b-1,n-a) + 1 (b-a-1)/2 << endl;
      |                                ~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)
#define be(v) (v).begin(), (v).end()
#define dcout cout << fixed << setprecision(20) 
ll INF = 1LL << 60;
ll mod = 1e9 + 7;

int main() {
	int k,a,b;
	cin >> k >> a >> b;
	if((b-a)%2==0) {
		cout << min((b-a)/2,min(b-1,n-a)) << endl;
		return 0;
	}
	if(a==1;b==n) {
		cout << (b-a+1)/2 << endl;
		return 0;
	}
	int n = a-1;
	int m = k-b;
	cout << min(n,m)+1+((b-a-1)/2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:45: error: 'n' was not declared in this scope
   16 |                 cout << min((b-a)/2,min(b-1,n-a)) << endl;
      |                                             ^
a.cc:19:20: error: 'n' was not declared in this scope
   19 |         if(a==1;b==n) {
      |                    ^
Language: Java

import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n =sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
        if((a+b)%2==0){
            System.out.println((a+b)/2-a);
        } else {
            if(a-1>n-b){
                long ans = n-b,tmpA = a+n-b,tmpB = n;
                while((tmpA!=n)&&(tmpA+tmpB)%2!=0){
                    tmpA ++;
                    ans ++;
                }
                if(tmpA!=n&&((tmpA+tmpB)%2==0)){
                    ans += Math.,max((tmpA+tmpB)/2-tmpB,0);
                }
                System.out.println(ans);
            } else {
                long ans = a-1,tmpA = 1,tmpB = b-(a-1);
                while(tmpB!=1&&(tmpB!=1)&&(tmpA+tmpB)%2!=0){
                    tmpB --;
                    ans ++;
                }
                if(((tmpA+tmpB)%2==0)){
                    ans +=Math.max((tmpA+tmpB)/2-tmpA,0);
                }
                System.out.println(ans);
            }
        }
    }
}


Compiler output:
Main.java:16: error: <identifier> expected
                    ans += Math.,max((tmpA+tmpB)/2-tmpB,0);
                                ^
1 error
Language: Java

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

public class A {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static FastReader s = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    private static int[] rai(int n) {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        return arr;
    }

    private static int[][] rai(int n, int m) {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextInt();
            }
        }
        return arr;
    }

    private static long[] ral(int n) {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        return arr;
    }

    private static long[][] ral(int n, int m) {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                arr[i][j] = s.nextLong();
            }
        }
        return arr;
    }

    private static int ri() {
        return s.nextInt();
    }

    private static long rl() {
        return s.nextLong();
    }

    private static String rs() {
        return s.next();
    }

    public static void main(String[] args) {
        StringBuilder ans = new StringBuilder();
//        int t = ri();
        int t=1;
        while (t-- > 0)
        {
            int n=ri();
            int v1=ri();
            int v2=ri();

            int a=Math.min(v1,v2);
            int b=Math.max(v1,v2);
            if(((b-a-1)&1)==1)
            {
                ans.append(b-((b+a)/2));
            }
            else
            {
                int val=Math.min(b-1,n-a);
                ans.append(val);
            }
            ans.append("\n");
        }
        out.print(ans.toString());
        out.flush();

    }
}


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

#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    long long n,a,b;
    cin>>n>>a>>b;
    int res=min(b-1,n-a);
    if((b-a)%2) cout<<res;
    else cout<<min(res,(b-a)/2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: no matching function for call to 'min(int&, long long int)'
   13 |     else cout<<min(res,(b-a)/2);
      |                ~~~^~~~~~~~~~~~~
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:13:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   13 |     else cout<<min(res,(b-a)/2);
      |                ~~~^~~~~~~~~~~~~
/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:13:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |     else cout<<min(res,(b-a)/2);
      |                ~~~^~~~~~~~~~~~~
Language: Java

import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    
    int N = scan.nextInt();
    int A = scan.nextInt();
    int B = scan.nextInt();
    
    if(Math.abs(A - B) % 2 == 0){
      System.out.println(Math.abs(A - B) / 2);
    }else{
      System.out.println(Math.abs(A - B) / 2 + 1);
    }

Compiler output:
Main.java:15: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    
    int N = scan.nextInt();
    int A = scan.nextInt();
    int B = scan.nextInt();
    
    if(Math.abs(A - B) % 2 == 0){
      System.out.println(Math.abs(A - B) / 2);
    }else{
      System.out.println(Math.abs(A - B) / 2 + 1)
    }
  }
}

Compiler output:
Main.java:14: error: ';' expected
      System.out.println(Math.abs(A - B) / 2 + 1)
                                                 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long

int ans(ll n, ll a, ll b)
{
  int x = (a >= b) ? a - b : b - a;
  if(x % 2)
  {
    int dis_a, dis_b;
    dis_a = max(a - 1, n - a);
    dis_b = max(b - 1, n - b);
    return min(dis_a, dis_b);
  }
  else
  {
    return x / 2;
  }
}

int main()
{
  ll n, a, b;
  cin >> n >> a >> b;
  
  cout << ans(n, a, b) << endl;
  return 0;
}

Compiler output:
a.cc:6:4: error: expected ';' before 'ans'
    6 | int ans(ll n, ll a, ll b)
      |    ^~~~
      |    ;
a.cc: In function 'int main()':
a.cc:24:3: error: 'll' was not declared in this scope
   24 |   ll n, a, b;
      |   ^~
a.cc:25:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 |   cin >> n >> a >> b;
      |          ^
      |          yn
a.cc:25:15: error: 'a' was not declared in this scope
   25 |   cin >> n >> a >> b;
      |               ^
a.cc:25:20: error: 'b' was not declared in this scope
   25 |   cin >> n >> a >> b;
      |                    ^
a.cc:27:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   cout << ans(n, a, b) << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  ll ans=0;
  if ((b-a)%2 == 0) ans = max(a,b)-(a+b)/2;
  else ans = min(n-min(a,b),max(a,b)-1));
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:40: error: expected ';' before ')' token
   12 |   else ans = min(n-min(a,b),max(a,b)-1));
      |                                        ^
      |                                        ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define full(a) a.begin(),a.end()
#define stoink stack<ll>
#define vec vector <ll>
#define vg vector<vector<ll> >
#define vgw vector<vector<pair<ll,ll> >
#define pa pair<ll,ll>
#define mp make_pair
#define pb push_back
int main() {
 ll n,a,b;
 cin >> n >> a >> b;
 if ( (abs(b - a)) % 2 == 0)
    cout<< (abs(b - a))/2;
 else
 {
    cout<<(a + b)/2
 }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: expected ';' before '}' token
   19 |     cout<<(a + b)/2
      |                    ^
      |                    ;
   20 |  }
      |  ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main(){
	ll n, a, b;
	cin >> n >> a >> b;
	ll k = abs(a-b);
	if(k%2 == 0){
		cout << k/2 << endl;
	}else{
//		ll ans0 = min(b-1, n-a); 
		ll ans1 = (n-b+1+n-a)/2;
		ll ans2 = (a+1+b)/2;
		cout << min(min(ans0, ans1), ans2) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:33: error: 'ans0' was not declared in this scope; did you mean 'ans2'?
   17 |                 cout << min(min(ans0, ans1), ans2) << endl;
      |                                 ^~~~
      |                                 ans2
Language: C

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll n, a, b; cin >> n >> a >> b;

    if((b - a) % 2 == 0){
        cout << (b - a) / 2 << endl;
    }
    else{
        cout << min(b - 1, n - a) << endl;
    }

    return 0;
}

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() {
  double int N, A, B;
  cin >> N >> A >> B;
  
  if ( A%2 == B%2 ){
    cout << (B-A)/2 << endl; 
  }
  else {
    cout << min ( (A+B-1)/2 , (2*N-A-B+1)/2 ) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: two or more data types in declaration of 'N'
    5 |   double int N, A, B;
      |   ^~~~~~
a.cc:5:3: error: two or more data types in declaration of 'A'
a.cc:5:3: error: two or more data types in declaration of 'B'
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> A >> B;
      |          ^
a.cc:6:15: error: 'A' was not declared in this scope
    6 |   cin >> N >> A >> B;
      |               ^
a.cc:6:20: error: 'B' was not declared in this scope
    6 |   cin >> N >> A >> B;
      |                    ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <bitset>
#include <map>
#include <math.h>
#include <utility>

using namespace std;

const double PI = acos(-1);

int main(){

    int N, A, B;
    cin >> N >> A >> B;

    if ((B - A) % 2 == 0) {
        cout << (B - A) / 2 << endl;
    } else {
        cout << min(A + (B-A-1)/2, (N-B+1) + (B-A-1)/2); << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:58: error: expected primary-expression before '<<' token
   24 |         cout << min(A + (B-A-1)/2, (N-B+1) + (B-A-1)/2); << endl;
      |                                                          ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  long long N, A, B;
  cin >> N >> A >> B;
  if((B-A)%2==0) cout << (B-A)/2 << endl;
  else cout << min((N-B+1+N-A)/2, min((A+B-1)/2), min(B-1, N-A))) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: no matching function for call to 'min(long long int)'
    9 |   else cout << min((N-B+1+N-A)/2, min((A+B-1)/2), min(B-1, N-A))) << endl;
      |                                   ~~~^~~~~~~~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:9:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |   else cout << min((N-B+1+N-A)/2, min((A+B-1)/2), min(B-1, N-A))) << endl;
      |                                   ~~~^~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

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

int main() {
  int A,B,C;
  ein >> A >> B >> C;
  if(B - A % 2 == 0){
    cout << (B - A) / 2 << endl;
  }
  else{
    cout << A - C << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'ein' was not declared in this scope; did you mean 'sin'?
    6 |   ein >> A >> B >> C;
      |   ^~~
      |   sin
Language: C++

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=1e9+7;
using namespace std;

void solve(){
    ll n,a,b; cin>>n>>a>>b;
    if(abs(b-a)%2==0) {printf("%lld\n",abs(b-a)/2); return;}
    if(a>b) swap(a,b);
    ll ans=min(b-1, n-a);
    ll an=min(a-1+(b-a+1)/2+1,n-b+1+(n-(a+n-b))/2);
    if(a==1) ans=min(ans,b/2);
    if(b==n) ans=min(ans,(n-a+1)/2)
    printf("%lld\n",min(an,ans)); 
}
int main() 
{
    int _=1;  //scanf("%d",&_);
    while(_--) solve();
    return 0;
}
/*
*/
 

Compiler output:
a.cc: In function 'void solve()':
a.cc:18:36: error: expected ';' before 'printf'
   18 |     if(b==n) ans=min(ans,(n-a+1)/2)
      |                                    ^
      |                                    ;
   19 |     printf("%lld\n",min(an,ans));
      |     ~~~~~~
Language: C++

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=1e9+7;
using namespace std;
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=1e9+7;
using namespace std;


void solve(){
    ll n,a,b; cin>>n>>a>>b;
    if(abs(b-a)%2==0) {printf("%lld\n",abs(b-a)/2); return;}
    if(a>b) swap(a,b);
    printf("%lld\n",max(0LL,min(b-1, n-a))); 
}
int main() 
{
    int _=1;  //scanf("%d",&_);
    while(_--) solve();
    return 0;
}
/*
*/
 

Compiler output:
a.cc:16:11: error: redefinition of 'const int N'
   16 | const int N=1e6+10;
      |           ^
a.cc:7:11: note: 'const int N' previously defined here
    7 | const int N=1e6+10;
      |           ^
a.cc:17:11: error: redefinition of 'const int mod'
   17 | const int mod=1e9+7;
      |           ^~~
a.cc:8:11: note: 'const int mod' previously defined here
    8 | const int mod=1e9+7;
      |           ^~~
Language: C++

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=1e9+7;
using namespace std;
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=1e9+7;
using namespace std;


void solve(){
    ll n,a,b; cin>>n>>a>>b;
    if(abs(b-a)%2==0) {printf("%lld\n",abs(b-a)/2); return;}
    if(a>b) swap(a,b);
    printf("%lld\n",max(0LL,min(b-1, n-a))); 
}
int main() 
{
    int _=1;  //scanf("%d",&_);
    while(_--) solve();
    return 0;
}
/*
*/
 

void solve(){
    ll n,a,b; cin>>n>>a>>b;
    if(abs(b-a)%2==0) printf("%lld\n",abs(b-a)/2);
    if(a>b) swap(a,b);
    printf("%lld\n",max(0LL,min(b-1, n-a))); 
}
int main() 
{
    int _=1;  //scanf("%d",&_);
    while(_--) solve();
    return 0;
}
/*
*/
 

Compiler output:
a.cc:16:11: error: redefinition of 'const int N'
   16 | const int N=1e6+10;
      |           ^
a.cc:7:11: note: 'const int N' previously defined here
    7 | const int N=1e6+10;
      |           ^
a.cc:17:11: error: redefinition of 'const int mod'
   17 | const int mod=1e9+7;
      |           ^~~
a.cc:8:11: note: 'const int mod' previously defined here
    8 | const int mod=1e9+7;
      |           ^~~
a.cc:37:6: error: redefinition of 'void solve()'
   37 | void solve(){
      |      ^~~~~
a.cc:21:6: note: 'void solve()' previously defined here
   21 | void solve(){
      |      ^~~~~
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main()
      |     ^~~~
a.cc:27:5: note: 'int main()' previously defined here
   27 | int main()
      |     ^~~~
Language: C++

#include<stdio.h>
main(){
	long long n,a,b;scanf("%lld%lld%lld",&n,&a,&b);
	if((b-a)&1)printf("%lld\n",min((unsigned long long)((n<<1)-a-b+1),(unsigned long long)(a+b-1))>>1);
	else printf("%lld\n",b-a>>1);
	return 0;
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:36: error: 'min' was not declared in this scope; did you mean 'main'?
    4 |         if((b-a)&1)printf("%lld\n",min((unsigned long long)((n<<1)-a-b+1),(unsigned long long)(a+b-1))>>1);
      |                                    ^~~
      |                                    main
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int64_t N,A,B; cin>>N>>A>>B;

    int64_t ans;
    if((B-A)%2){
        ans=min(A-1,N-B)+1;
        ans+=(B-A-1)/2;
    }else{
        ans=(B-A)/2;
    }

    cout<<ans<<endl;
}#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int64_t N,A,B; cin>>N>>A>>B;

    int64_t ans;
    if((B-A)%2){
        ans=min(A-1,N-B)+1;
        ans+=(B-A-1)/2;
    }else{
        ans=(B-A)/2;
    }

    cout<<ans<<endl;
}

Compiler output:
a.cc:20:2: error: stray '#' in program
   20 | }#include <bits/stdc++.h>
      |  ^
a.cc:20:3: error: 'include' does not name a type
   20 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:25:10: error: redefinition of 'uint64_t MOD'
   25 | uint64_t MOD=1000000007;
      |          ^~~
a.cc:6:10: note: 'uint64_t MOD' previously defined here
    6 | uint64_t MOD=1000000007;
      |          ^~~
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: Java

import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        if ((a - b) % 2 == 0) {
            System.out.println(Math.abs(a - b) / 2);
        } else {
            System.out.println(Math.min(Math.max(a, b) - 1, n - Math.min(a, b)));
        }
    }


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

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  if((b-a)%2==0) cout << (b-a)/2 << endl;
  else {
    int tmp1=(a-1)+1+(b-a-1)/2;
    int tmp2=(n-b)+1+(b-a-1)/2;
    int tmp3=(b-1);
    int tmp4=(n-a);
    int t=min(tmp1,tmp2);
    int r=min(tmp3,tmp4);
    int ans = min(t,r)
    cout << ans <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected ',' or ';' before 'cout'
   16 |     cout << ans <<endl;
      |     ^~~~
Language: C++

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

int main(){
  long long n,a,b;
  cin >> n >> a >> b;
  //(どちらかが卓1,nのいずれかに到達するのに必要な最小のラウンド数)+(偶奇を調整するラウンド)+(偶奇の調整後に2人が出会うまでのラウンド数(2人の間の距離の半分))
  cout << long long min(a-1,n-b)+1+(b-a-1)/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before 'long'
    8 |   cout << long long min(a-1,n-b)+1+(b-a-1)/2 << endl;
      |           ^~~~
Language: C++

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  //(どちらかが卓1,nのいずれかに到達するのに必要な最小のラウンド数)+(偶奇を調整するラウンド)+(偶奇の調整後に2人が出会うまでのラウンド数(2人の間の距離の半分))
  cout << min(a-1,n-b)+1+(b−a−1)/2 << endl;
}


Compiler output:
a.cc:8:27: error: extended character − is not valid in an identifier
    8 |   cout << min(a-1,n-b)+1+(b−a−1)/2 << endl;
      |                           ^
a.cc:8:27: error: extended character − is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:27: error: 'b\U00002212a\U000022121' was not declared in this scope
    8 |   cout << min(a-1,n-b)+1+(b−a−1)/2 << endl;
      |                           ^~~~~
Language: C++

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  //(どちらかが卓1,nのいずれかに到達するのに必要な最小のラウンド数)+(偶奇を調整するラウンド)+(偶奇の調整後に2人が出会うまでのラウンド数(2人の間の距離の半分))
  cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
}


Compiler output:
a.cc:8:17: error: extended character − is not valid in an identifier
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |                 ^
a.cc:8:24: error: extended character − is not valid in an identifier
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |                        ^
a.cc:8:36: error: extended character − is not valid in an identifier
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |                                    ^
a.cc:8:36: error: extended character − is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:16: error: expected ')' before '\U00002212'
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |              ~ ^~
      |                )
a.cc:8:23: error: expected ')' before '\U00002212'
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |              ~        ^~
      |                       )
a.cc:8:36: error: 'b\U00002212a\U000022121' was not declared in this scope
    8 |   cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
      |                                    ^~~~~
Language: C++

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  //(どちらかが卓1,nのいずれかに到達するのに必要な最小のラウンド数)+(偶奇を調整するラウンド)+(偶奇の調整後に2人が出会うまでのラウンド数(2人の間の距離の半分))
  cout << min(a − 1, n − b) + 1 + (b−a−1)/2 << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

long long maxl(long long n, m) {
  if(n-m > 0) return n;
  else return m;
}
long long minl(long long n, m) {
  if(n-m > 0) return m;
  else return n;
}

int main() {
  long long N, A, B; cin >> N >> A >> B;
  
  long long a = abs(A-B);
  if(a%2 == 0) cout << a/2 << endl;
  else cout << minl(maxl(A-1,B-1), maxl(N-A,N-B)) << endl;
}


Compiler output:
a.cc:5:29: error: 'm' has not been declared
    5 | long long maxl(long long n, m) {
      |                             ^
a.cc: In function 'long long int maxl(long long int, int)':
a.cc:6:8: error: 'm' was not declared in this scope
    6 |   if(n-m > 0) return n;
      |        ^
a.cc: At global scope:
a.cc:9:29: error: 'm' has not been declared
    9 | long long minl(long long n, m) {
      |                             ^
a.cc: In function 'long long int minl(long long int, int)':
a.cc:10:8: error: 'm' was not declared in this scope
   10 |   if(n-m > 0) return m;
      |        ^
Language: C++

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

int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  priority_queue<ll, vector<ll>, greater<ll>> ans;
  //卓1で試合をするとき
  ll ans1 = 0;
  ans1 = max(A-1, B-1);
  ans.push(ans1);
  //卓Nで試合するとき
  ll ans2 = 0;
  ans2 = max(N-A, N-B);
  ans.push(ans2);
  //2人の中間ポイントで試合するとき
  if ((B-A) % 2 == 0) {
    ll ans3;
    ans3 = (B-A)/2;
    ans.push(ans3);
  }
  else {
    ll ans6;
    ans6 = min(A-1, B-1) + 1 +(B-A-1)/2;
    asn.push(ans6);
  }

  
  cout << ans.top() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'asn' was not declared in this scope; did you mean 'ans'?
   27 |     asn.push(ans6);
      |     ^~~
      |     ans
Language: C++

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

int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  priority_queue<ll, vector<ll>, greater<ll>> ans;
  //卓1で試合をするとき
  ll ans1 = 0;
  ans1 = max(A-1, B-1);
  ans.push(ans1);
  //卓Nで試合するとき
  ll ans2 = 0;
  ans2 = max(N-A, N-B);
  ans.push(ans2);
  //2人の中間ポイントで試合するとき
  if ((B-A) % 2 == 0) {
    ll ans3, ans4, ans5;
    ans3 = (B-A)/2;
    ans4 = ((B-1)*2-(B-A))/2;
    ans5 = ((N-A)*2-(B-A))/2;
    ans.push(ans3);
    ans.push(ans4);
    ans.push(ans5);
  }
  else {
    ll ans6;
    ans6 = min(A-1, B-1) + 1 +(B-A-1)/2;
    asn.push(ans6);
  }

  
  cout << ans.top() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'asn' was not declared in this scope; did you mean 'ans'?
   31 |     asn.push(ans6);
      |     ^~~
      |     ans
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i <= n; i++)
#define ll long long
using namespace std;

auto keta(ll n) {
    ll res;
    for(ll i = 0; i < 100; i++) {
        n = n / 10;

        if(n == 0) {
            res = i + 1;
            break;
        }
    }
    return res;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll w=(b-a)%2;
    if(w == 0) {
        ll ans = (b-a)/2;
        cout << ans << endl;
    } else {
        ll p = n - a, q = b - 1;
        if(p >= q) {
            ll ans=a+(b-1-a)/2;
            cout << ans << endl;
        } else{
            ll ans =n-b+1+(b-a-1)/2
            cout << ans << endl;
        }

    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: expected ',' or ';' before 'cout'
   34 |             cout << ans << endl;
      |             ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i <= n; i++)
#define ll long long
using namespace std;

auto keta(ll n) {
    ll res;
    for(ll i = 0; i < 100; i++) {
        n = n / 10;

        if(n == 0) {
            res = i + 1;
            break;
        }
    }
    return res;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll w=(b-a)%2;
    if(w == 0) {
        ll ans = (b-a)/2;
        cout << ans << endl;
    } else {
        ll p = n - a, q = b - 1;
        if(p >= q) {
            ll ans=a+(b-1-a)/2;
            cout << ans << endl;
        } else{
            ll ans =x-b+1+(b-a-1)/2
            cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: 'x' was not declared in this scope
   33 |             ll ans =x-b+1+(b-a-1)/2
      |                     ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:20:12: note: to match this '{'
   20 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/multiprecision/ll.hpp>
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/tools/minima.hpp>

#define rep(i, n) for (int i = 0; i < (n); ++i)

namespace adaptor = boost::adaptors;
using namespace std;
using boost::math::tools::brent_find_minima;
using boost::irange;
using boost::algorithm::split;
using boost::algorithm::replace_all;
using boost::multiprecision::ll;
using ll = long long;
using P = pair<int, int>;
using boost::algorithm::join;
// TOP

void	Main()
{
	ll n, g, l;
	cin >> n >> g >> l;

	ll dif;
	dif = abs(g - l);
	if (dif % 2 == 0)
		cout << dif / 2 << endl;
	else
	{
		if (g < l)
			swap(g, l);
		ll ans;
		ans = (dif + min(abs(l - 1), abs(g - n)) * 2 + 1) / 2;
		cout << ans << endl;
	}
}
// END
















int		main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	Main();
}


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

#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/tools/minima.hpp>

#define rep(i, n) for (int i = 0; i < (n); ++i)

namespace adaptor = boost::adaptors;
using namespace std;
using boost::math::tools::brent_find_minima;
using boost::irange;
using boost::algorithm::split;
using boost::algorithm::replace_all;
using boost::multiprecision::cpp_int;
using ll = long long;
using P = pair<int, int>;
using boost::algorithm::join;
// TOP

void	Main()
{
	cpp_int n, g, l;
	cin >> n >> g >> l;

	cpp_int dif;
	dif = abs(g - l);
	if (dif % 2 == 0)
		cout << dif / 2 << endl;
	else
	{
		if (g < l)
			swap(g, l);
		cpp_int ans;
		ans = (dif + min(abs(l - 1), abs(g - n)) * 2 + 1) / 2;
		cout << ans << endl;
	}
}
// END
















int		main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	Main();
}


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

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using ll = long long;

int main() {
  ll n, a, b; cin >> n >> a >> b;
  if ((b - a) % 2 == 0) cout << (b - a) / 2 << endl;
  else {
    tmp = (a + b - 1) / 2;
    cout << min(tmp, n - tmp) << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   10 |     tmp = (a + b - 1) / 2;
      |     ^~~
      |     tm