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

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

using LL = long long;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: redeclaration of 'LL res'
   16 |         LL res = n-b, nowb = n, nowa = a+(n-b);
      |            ^~~
a.cc:12:12: note: 'LL res' previously declared here
   12 |         LL res = a-1, nowa = 1, nowb = b-(a-1);
      |            ^~~
a.cc:16:23: error: redeclaration of 'LL nowb'
   16 |         LL res = n-b, nowb = n, nowa = a+(n-b);
      |                       ^~~~
a.cc:12:33: note: 'LL nowb' previously declared here
   12 |         LL res = a-1, nowa = 1, nowb = b-(a-1);
      |                                 ^~~~
a.cc:16:33: error: redeclaration of 'LL nowa'
   16 |         LL res = n-b, nowb = n, nowa = a+(n-b);
      |                                 ^~~~
a.cc:12:23: note: 'LL nowa' previously declared here
   12 |         LL res = a-1, nowa = 1, nowb = b-(a-1);
      |                       ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
  int N;
  int A;
  int B;
  
  cin >> N;
  cin >> A;
  cin >> B;
  if((A+B)%2==0){
    cout << (B-A)/2;
  }else if((N-B)<(A-1)){
	N-B＋１＋(B-A-1)/2;
  }else{
    A-1+1+(B-A-1)/2;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'B\U0000ff0b\U0000ff11\U0000ff0b' was not declared in this scope
   16 |         N-B＋１＋(B-A-1)/2;
      |           ^~~~~~~
Language: Java

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    sc.close();

    int diff = Math.abs(a - b);
    if (diff % 2 == 0) {
      System.out.println(diff / 2);
    } else {
      int center = (int) Math.ceil(n / 2.0);
      int max = Math.max(a, b);
      int min = Math.min(a, b);
      if (max <= center) {
        System.out.println(max - 1);
      } else {
        System.out.println(n - min);
      }
    }
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long A, B, N, R, swap;
  cin >> N >> A >> B;
  if(B > A){
    swap = B;
    B = A;
    A = swap;
  }
  if((A - B) % 2 == 0)){
    R = (A - B ) / 2;
  }else{
    if(N - B > A - 1){
      	B = 1; A = A + 1 - B;A--;R = B;
      	R += (A - B) / 2;
      }
    }
    else{
      A = N; B = B + N - A;B++;R = N - A + 1;
      R += (A - B ) / 2;
    }
  }
  cout << R;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected primary-expression before ')' token
   11 |   if((A - B) % 2 == 0)){
      |                       ^
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else{
      |     ^~~~
a.cc: At global scope:
a.cc:24:3: error: 'cout' does not name a type
   24 |   cout << R;
      |   ^~~~
a.cc:25:3: error: expected unqualified-id before 'return'
   25 |   return 0;
      |   ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<cstdio>
#include<iostream>
typedef long long ll;
using namespace std;
int main() {
  ll n = 0, a = 0, b = 0;
  cin >> n >> a >> b;
  if(a == b) {
    cout << 0 << endl;
    return 0;
  }
  ll sa = min(a, b);
  ll sb = max(a, b);
  ll l = sb - 1;
  ll r = n - sa;
  ll res = min(l, r);
  if(d % 2 == 1) {
    ll d = sb - sa - 1;
    res = min(res, (d + 1) / 2);
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: 'd' was not declared in this scope
   17 |   if(d % 2 == 1) {
      |      ^
a.cc:18:8: error: redeclaration of 'll d'
   18 |     ll d = sb - sa - 1;
      |        ^
a.cc:17:6: note: '<typeprefixerror>d' previously declared here
   17 |   if(d % 2 == 1) {
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	// your code goes here
    long long int n, a,b;
    cin>>n>>a>>b;
    long long int i=0;
    if((b-a)%2 == 0 ){
        
        cout<<(b-a)/2<<endl;
    }
    else{
        if((a-1) <= (n-b)){
            i = b-1;
        }
        else{
           i = n-a;
        }
        }
        cout<<i<<endl;
    }
	return 0;
}


Compiler output:
a.cc:23:9: error: expected unqualified-id before 'return'
   23 |         return 0;
      |         ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

bool line(ll  a,ll b){
	ll c1 = min(abs(N-b),abs(b-1));
  if(c1 == abs(N-b))  return true;
  else return false;
}

int main(){
  ll n;
  cin >> n;
  ll a,b;
  cin >> a >> b;
  ll round = 0;
  
  while(a!=b){
    if(b == N && a !=1){
		a++;
      	round++;
    }
    else if(a == 1 && b != N){
		b--;
      round++;
    }
    else if(b-a == 1){
      if(line(a,b)){
        b++;
        a++;
        round++;
    }
      else {
        b--;
        a--;
        round++;
      }
    }
    else{
      b--;
      a++;
    }
  }
  
  cout << round << endl;
  return 0;
    
    

Compiler output:
a.cc: In function 'bool line(ll, ll)':
a.cc:6:25: error: 'N' was not declared in this scope
    6 |         ll c1 = min(abs(N-b),abs(b-1));
      |                         ^
a.cc: In function 'int main()':
a.cc:19:13: error: 'N' was not declared in this scope
   19 |     if(b == N && a !=1){
      |             ^
a.cc:46:12: error: expected '}' at end of input
   46 |   return 0;
      |            ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
a.cc: In function 'bool line(ll, ll)':
a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    9 | }
      | ^
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	long long n,a,b;
    	scanf("%lld%lld%lld",&n,&a,&b);
    	if((b-a)%2==0)
    		printf("%lld\n",(b-a)/2);
    	else
    	{
          long long h1=a,h2=b;
          long long ans1=n-b;
          h1+=ans1;
          ans1++;
          h1++;
          ans1+=((n-h1)/2);
    		long long ans2=a-1;
          h2-=ans2;
          ans2++;
          h2--;
          ans2+=((h2-1)/2);
    	printf("%lld\n",min(ans1,ans));
    	}
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   22 |         printf("%lld\n",min(ans1,ans));
      |                                  ^~~
      |                                  ans2
Language: C++

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

using LL = long long;

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


Compiler output:
a.cc:18:5: error: 'cout' does not name a type
   18 |     cout << ans << endl;
      |     ^~~~
a.cc:19:9: error: expected unqualified-id before 'return'
   19 |         return 0;
      |         ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: unable to find numeric literal operator 'operator""n'
    7 |   long long m = min((a+b-1)/2,(2n-a-b+1)/2);
      |                                ^~
Language: C++

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

typedef long long ll;

int main(){

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

    if(a>b) swap(a,b);

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected ',' or ';' before 'cout'
   20 |         cout<<min(x,min(y,z));
      |         ^~~~
Language: C++

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

typedef long long ll;

int main(){

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

    if(a>b) swap(a,b);

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected ',' or ';' before 'cout'
   20 |         cout<<min(x,min(y,z))
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#define int long long int
#define MAX 1000007
#define MOD 1000000007
#define FO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
void solve() {
	int n, a, b;
	cin >> n >> a >> b;
	if()
	if((b-a)%2 == 0)
		cout << (b-a)/2;
	else {
		//cout << min(b-1, n-a);
		if(b-1 < n-a)
			cout << b-1;
		else
			cout << n-a;
	}
    return;
}
int32_t main() {
    FO;
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:10:12: error: expected primary-expression before ')' token
   10 |         if()
      |            ^
Language: Java

import java.url.*;
public class smallestnum{
    public static void main(String[] args){
       int A,B,C;
       Scanner scan = new Scanner(System.in);
       if(A==true && B == false)
       {
         System.out.println("A is winner");
       }
      else if(B==true && A == false)
      {
        System.out.println("B is winner");
      }
      else if(A==true && B==true)
      {
        System.out.println("A and B have to contest...");
      }
      else 
      {
        System.out.println("No contest anymore...");
      }
    }
}

Compiler output:
Main.java:2: error: class smallestnum is public, should be declared in a file named smallestnum.java
public class smallestnum{
       ^
Main.java:1: error: package java.url does not exist
import java.url.*;
^
Main.java:5: error: cannot find symbol
       Scanner scan = new Scanner(System.in);
       ^
  symbol:   class Scanner
  location: class smallestnum
Main.java:5: error: cannot find symbol
       Scanner scan = new Scanner(System.in);
                          ^
  symbol:   class Scanner
  location: class smallestnum
Main.java:6: error: incomparable types: int and boolean
       if(A==true && B == false)
           ^
Main.java:6: error: incomparable types: int and boolean
       if(A==true && B == false)
                       ^
Main.java:10: error: incomparable types: int and boolean
      else if(B==true && A == false)
               ^
Main.java:10: error: incomparable types: int and boolean
      else if(B==true && A == false)
                           ^
Main.java:14: error: incomparable types: int and boolean
      else if(A==true && B==true)
               ^
Main.java:14: error: incomparable types: int and boolean
      else if(A==true && B==true)
                          ^
10 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ')' before '{' token
   10 |   if((b%2 != a%2){
      |     ~            ^
      |                  )
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)x.size()
#define int ll

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, a, b;
	cin >> n >> a >> b;
	if ((b - a) % 2 == 0) {
		cout << (b - a) / 2 << '\n';
	} 
	else {
		cout << min(b - 1, n - a) << '\n'
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:50: error: expected ';' before '}' token
   22 |                 cout << min(b - 1, n - a) << '\n'
      |                                                  ^
      |                                                  ;
   23 |         }
      |         ~
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i<N; i++)
#define RVROOP(i, N) for(int i=N; i>=0; i--)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
  ll N, A, B; cin>>N>>A>>B;
  int ans=min(B,N-1-A);
  if((B-A)%2==0){
    ans=min(ans, (B-A)/2);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: no matching function for call to 'min(int&, ll)'
   13 |     ans=min(ans, (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:2:
/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:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   13 |     ans=min(ans, (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:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |     ans=min(ans, (B-A)/2);
      |         ~~~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

#define getBit(x,i) (x&(1<<i))
#define setBit(x,i) (x|(1<<i))
#define mem(A,N) memset(A,N,sizeof(A))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define rep(i, x, y)  for(int i = x; i < y; ++i)
#define Rep(i, x, y)  for(int i = x; i <= y; ++i)
#define srep(i, x, y) for(int i = x; i > y; --i)
#define sRep(i, x, y) for(int i = x; i >= y; --i)
#define all(v) v.begin(),v.end()
#define Sort(x) sort(x.begin(), x.end())
#define f1(i,n) for (int i=1; i<=n; i++)
#define f0(i,n) for (int i=0; i<n; i++)
#define sz(x) ((int)(x).size())
#define len(x) ((int)(x).length())
#define fi first
#define se second

#define linf 0x7FFFFFFFFFFFFFFF
#define inf 0x7FFFFFFF
#define mod 1000000007
#define eps 1e-9
#define Pi 3.14159265358979323846

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define write(x) cerr << #x << " = " << (x) << ", ";
#define writeI0 cerr << "i = " << 0 << ", ";
#define dumpI0 cerr << "i = " << 0 << endl;
#define printSet(s) for(auto it = s.begin(); it!=s.end(); it++) (it==s.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printPairSet(s) for(auto it = s.begin(); it!=s.end(); it++) (it==s.begin())? cout << '(' << it->first << ", " << it->second << ')' : cout << " (" << it->first << ", " << it->second << ')'; cout << endl;
#define printVector(x) for(auto it = x.begin(); it!=x.end(); it++) (it==x.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printArray(a,x,y) for(auto it = a+x; it != a+y; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;
#define PrintArray(a,x,y) for(auto it = a+x; it != a+y+1; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;

// ***************** End Of Template ********************

ll n;
ll a, b;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> n >> a >> b;
    ll sol1 = b-a;
    ll sol2 = b-1;
    ll sol3 = (n-a);

    ll t = a-1;
    if ((b-t-1) % 2 == 0) {
        sol2 = min(sol2, t + (b-t-1)/2);
    }
    else {
        sol2 = min(sol2, t + 1 + (b-1 - t-1)/2);
    }

    ll t = n-b;
    if ((n-(a+t)) % 2 == 0) {
        sol3 = min(sol3, t + (n-(a+t))/2);
    }
    else {
        sol3 = min(sol3, t + 1 + (n-(a+t+1))/2);
    }

    if (sol1 % 2 == 0)
        cout << min(min(sol1/2LL,sol2), sol3) << '\n';
    else
        cout << min(sol2, sol3) << '\n';

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:8: error: redeclaration of 'll t'
   72 |     ll t = n-b;
      |        ^
a.cc:64:8: note: 'll t' previously declared here
   64 |     ll t = a-1;
      |        ^
Language: C++

#include<bits/stdc++.h>
#define ll unsigned long long
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    ll n,a,b;
    cin>>n>>a>>b;
    if((b-a)%2==0){cout<<(b-a)/2;return 0;}
    else{cout<<min(n-a,min(b-1,min((a+b+1)/2),(2*n-a-b+1)/2));return 0;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: no matching function for call to 'min(long long unsigned int)'
   10 |     else{cout<<min(n-a,min(b-1,min((a+b+1)/2),(2*n-a-b+1)/2));return 0;}
      |                                ~~~^~~~~~~~~~~
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:10:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   10 |     else{cout<<min(n-a,min(b-1,min((a+b+1)/2),(2*n-a-b+1)/2));return 0;}
      |                                ~~~^~~~~~~~~~~
/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 "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  MainWindow w;
  w.show();

  return a.exec();
}
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;


int main(){
    ll n,a,b;
    scanf("%lld %lld %lld",&n,&a,&b);
    if(b<a)
        swap(a,b);
    ll ans = b-1;
    ans = min(ans, n-a);
    if((b-a)%2==0)
        ans = min(ans,(b-a)/2);
    else
        ans = min(ans,(b-a)/2+min(a-1,n-y));
    printf("%lld\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:41: error: 'y' was not declared in this scope
   29 |         ans = min(ans,(b-a)/2+min(a-1,n-y));
      |                                         ^
Language: C++

#include <bits/stdc++.h>
   
#define x first
#define y second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define Max(x,y) (x)>(y)?(x):(y)
#define Min(x,y) (x)<(y)?(x):(y)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
int mian(){
    LL n,a,b; cin >> n >> a >> b;
    if(a > b) swap(a,b);
    if((b-a+1)&1) cout << (b-a)/2 << '\n';
    else{
        cout << min(a,n-b+1)+(b-a)/2 << '\n';
    }
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
    unsigned Int n,a,b;cin >> n >> a >> b;
    if(a>=b) swap(a,b);
    if(abs(a-b)%2==0) cout << abs(a-b)/2 << endl;
    else{
        if(abs(a-1)<=abs(b-n)){
            cout << abs(b-1) << endl;
        }else{
            cout << abs(a-n) << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected initializer before 'n'
   15 |     unsigned Int n,a,b;cin >> n >> a >> b;
      |                  ^
a.cc:15:31: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |     unsigned Int n,a,b;cin >> n >> a >> b;
      |                               ^
      |                               yn
a.cc:15:36: error: 'a' was not declared in this scope
   15 |     unsigned Int n,a,b;cin >> n >> a >> b;
      |                                    ^
a.cc:15:41: error: 'b' was not declared in this scope
   15 |     unsigned Int n,a,b;cin >> n >> a >> b;
      |                                         ^
Language: C++

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

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

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

const long long INF = 1000000000;

int main() {
	long long n, a, b;
	cin >> n >> a >> b;
	long long ans=0;
	if(abs(a-b)%2 == 0){
		ans = abs(a-b)/2;
	}else{
		long long l = max(a-1, b-1);
		long long r = max(n-a, n-b);
		ans = min(l, r);
		long long l2 = (a+b-1)/2;
		long long r2 = (n+n-a-b+1)/2;
		ans = min(ans, l2);
		ans = min(ans, r2);


	cout << ans <<endl;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

#include "algorithm"
#include "functional"
#include "iostream"
#include "map"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
using namespace std;
typedef long long ll;

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;
    return;
  }

  if (N - A < B - 1) {
    ll res = min(N - A, N - B + (B - A + 1) / 2);
    cout << res << endl;

  } else {
    ll res = min(B - 1, A - 1 + (B - A + 1) / 2);
    cout << res << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |     return;
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int MOD = 1000000007;
int INF = numeric_limits<int>::max() / 2;


signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int N, A, B;
  cin >> N >> A >> B;
  int a = max(A, B);
  int b = min(A, B);
  if(abs(B-A) % 2 == 0){
    int ans = abs(B-A);
    cout << ans/2 << endl;
  }
  else{
    int ans1 = (b-1)+1+((a-b)/2);
    int ans2 = (N-a)+1+((a-b)/2);
    cout << min(ans1, ans2) << endl;
  }

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'LL' was not declared in this scope
    5 |     LL n, a, b, ans; cin >> n >> a >> b;
      |     ^~
a.cc:5:29: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     LL n, a, b, ans; cin >> n >> a >> b;
      |                             ^
      |                             yn
a.cc:5:34: error: 'a' was not declared in this scope
    5 |     LL n, a, b, ans; cin >> n >> a >> b;
      |                                  ^
a.cc:5:39: error: 'b' was not declared in this scope
    5 |     LL n, a, b, ans; cin >> n >> a >> b;
      |                                       ^
a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |         ans = (b-a) / 2 + 2;
      |         ^~~
      |         abs
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |         ans = (b-a) / 2;
      |         ^~~
      |         abs
a.cc:11:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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


Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main()
      | ~~~
Language: C++

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

typedef long long ll;
#define rep(i, a, n) for(int i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
using namespace std;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
    string s;
    float N, A, B;
    cin >> N >> A >> B;
    float answer = 0;
    if ((B - A) % 2 == 0) {
        while(true) {
            if (B == A) {
                cout << answer << endl;
                return 0;
            } else {
                ++A;
                --B;
                ++answer;
            }
        }
    } else {
        if ((N-A) >= (B - 1)) {
            cout << (B - 1) << endl;
            return 0;
        } else {
            cout << (N - A) << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:17: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   40 |     if ((B - A) % 2 == 0) {
      |         ~~~~~~~ ^ ~
      |            |      |
      |            float  int
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: no matching function for call to 'min(ll)'
   32 |       cout<<1+min(b-a)/2<<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:32:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |       cout<<1+min(b-a)/2<<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: Java

import java.util.*;
import javax.lang.model.util.ElementScanner6;

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

        // 入力
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        // 処理
        long out = 0;
        long tmp = 0
        if ((b - a) % 2 == 0) {
            tmp = (b - a) / 2;
        }
        out = (b - 1) < (n - a) ? (b - 1) : (n - a);
        if (tmp != 0 && tmp < out) {
            out = tmp;
        }

        // 出力
        System.out.println(out);
    }
}

Compiler output:
Main.java:15: error: ';' expected
        long tmp = 0
                    ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
const int MAX = 700000;
const int MOD = 1000000007;

int main(){
  ll n,a,b;
  cin>>n>>a>>b;
  ll ma=max(a,b);
  ll mi=min(a,b);
  if((ma-mi)%2==0){
    COUT((ma-mi)/2);
  }
  else{
    ll maa=mi;
    ll mii=n-ma;
    if(ma-mi==1) COUT(min(maa,mii));
    else{
      COUT(min(maa,mii)-1);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:34:11: note: to match this '{'
   34 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long A, B, N, R, swap;
  cin >> N >> A >> B;
  if(B > A){
    swap = B;
    B = A;
    A = swap;
  }
  if((A - B) % 2 == 0)){
    R = (A - B ) / 2;
  }else{
    if(N - B > A - 1){
      R = A - 1;
    }
    else{
      R = N - B;
    }
  }
  cout << R;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected primary-expression before ')' token
   11 |   if((A - B) % 2 == 0)){
      |                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<string> 
using namespace std;
long long n,a,b,ans;
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>a>>b;
	if ((b-a)%2==0) ans=(b-a)/2;
	else {
		if (abs(b-a)>2)	ans=min(n-b+1+(b-a-1)/2,a+(b-a-1)/2);
		else ans=min(b-1,n-a);5 2 45
	}
	cout<<ans<<endl;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before numeric constant
   15 |                 else ans=min(b-1,n-a);5 2 45
      |                                        ^~
      |                                        ;
Language: C++

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main()
      | ~~~                 
a.cc: In function 'int main()':
a.cc:13:19: error: 'a' was not declared in this scope
   13 |     cout<<min(max(a, b) - 1,n-min(a, b)) ;
      |                   ^
a.cc:13:22: error: 'b' was not declared in this scope
   13 |     cout<<min(max(a, b) - 1,n-min(a, b)) ;
      |                      ^
Language: C++

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

#define REP(i, a, b) for(int i = a; i <= b; ++i)
#define DEC(i, a, b) for(int i = a; i >= b; --i)
#define getmid(l,r) ((l) + ((r) - (l)) / 2)
#define MEM(a,b) memset(a,b,sizeof(a))
#define FI first
#define SE second
#define SZ(x) ((int)(x).size())
#define MP make_pair
#define PB push_back
 
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
const int mod = 1000000007;

ll N, A, B;

int main(){
    ios_base::sync_with_stdio(false);
	cin >> N >> A >> B;
    if(A > B) swap(A, B);
    if((B - A) % 2 == 0){
        cout << (B - A) / 2 << endl;
    }
    else{
        ll ans = A - 1 + ((B - A) + 1) / 2;
        ans = min(ans, N - B + ((B - A) + 1) / 2;
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:49: error: expected ')' before ';' token
   30 |         ans = min(ans, N - B + ((B - A) + 1) / 2;
      |                  ~                              ^
      |                                                 )
Language: C++

#include <iostream>
using namespace std;
using ull = unsigned long long;
using ll = long long;

int main() {
	ull N, A, B;
	cin >> N >> A >> B;
	
	ull dif = (A > B) ? A - B : B - A;
	ull ans = 0;
	
	if(dif % 2 == 0) {
		ans = diff / 2;
	} else {
		ull L = max(A, B);
		ull S = min(A, B);
		
		ull ansL = L - 1;
		ull ansS = N - S;
		
		ans = min(ansL, ansS);
	}
	
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'diff' was not declared in this scope; did you mean 'dif'?
   14 |                 ans = diff / 2;
      |                       ^~~~
      |                       dif
Language: C++

#include <iostream>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:58: error: expected ')' before ';' token
   12 |         cout << min(b - 1ll, min(n - a, ((b - a) >> 1ll));
      |                    ~                                     ^
      |                                                          )
Language: C++

#include <bits/stdc++.h>
using namespace std;
constexpr auto MOD = 1000000007;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VLL;

string s;
long long n, m;

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


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

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

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




}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: expected ')' before ';' token
   13 |     else(cout<<maxA<<endl;)}
      |         ~                ^
      |                          )
a.cc:13:27: error: expected primary-expression before ')' token
   13 |     else(cout<<maxA<<endl;)}
      |                           ^
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main(){
  int n,a,b;
  int ans;
  cin>>n>>a>>b;
  if(a<b)swap(a,b);
  int d = a-b;
  if(d % 2 == 0){
      ans = d/2;
  }else{
      maxp =max(a,b);
      int nd = n - min(a,b);
      ans = min(maxp,nd);  
  }
 cout<< ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'maxp' was not declared in this scope
   14 |       maxp =max(a,b);
      |       ^~~~
Language: C

#include <stdio.h>
int main(void){
int count;
int n,k,b;
scanf("%d %d %d",&n,&a,&b);


return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:22: error: 'a' undeclared (first use in this function)
    5 | scanf("%d %d %d",&n,&a,&b);
      |                      ^
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
typedef long long ll;
int main()
{
  ll n,a,b;
  cin >> n >> a >> b;

  if((b-a)%2==0){
    cout << (b-a)/2 << "\n";
  }
  else{
    ll c = n-b+1+(b-a-1)/2;
    ll d = a + (b-a-1)/2;
    ll res = min(c,d);
    cout << res << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n >> a >> b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define rep(i,n) for(int i=0;i<n;++i)
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << (b-a)/2 << "\n";
      |     ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:14: error: 'min' was not declared in this scope; did you mean 'main'?
   16 |     ll res = min(c,d);
      |              ^~~
      |              main
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << res << "\n";
      |     ^~~~
a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

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

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
//#define endl '\n'

using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;

//const int N = 5e5 + 5, M = 1e6 + 5, A = 6561, LG = 17, MOD = 1e9 + 7;
const int BLOCK = 1900;
const int BLOCKN = N / BLOCK + 1;
const long double EPS = 1e-7;

  ll N, A, B;
ll simul1(ll A, ll B){
  ll ans = A - 1;
  B -= (A-1);
  A=1;
  ans++;
  B--;
  ans+=(B-A)/2;
  return ans;
}
ll simul2(ll A, ll B){
  return simul1(N-B+1,N-A+1);
}
int main(){
#ifdef ONLINE_JUDGE
  ios_base::sync_with_stdio(0);
  cin.tie(0);
#endif // ONLINE_JUDGE


  cin >> N >> A >> B;

  if((A&1)==(B&1)){
    cout<<(B-A)/2<<'\n';
  } else {
    cout<<min(simul1(A,B),simul2(A,B))<<'\n';
  }

  return 0;
}


Compiler output:
a.cc:20:20: error: 'N' was not declared in this scope
   20 | const int BLOCKN = N / BLOCK + 1;
      |                    ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'n' was not declared in this scope
   11 |         ll y = n-a + n-b + 1;
      |                ^
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 if (B-A==1) {
        cout <<(B-A)/2+2 << endl;
  }
  else {
       cout << (B-A)/2+1 << else;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected primary-expression before 'else'
   14 |        cout << (B-A)/2+1 << else;
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define M_PI 3.14159265358979323846
// #define __LOCAL

#ifdef __LOCAL
#define DBG(X) cout << #X << " = " << (X) << endl;
#define SAY(X) cout << (X) << endl;
#else
#define DBG(X)
#define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

ull N,A,B;
ull ans;

int main()
{
    cin >> N >> A >> B;
    if((B-A)%2==0){
        ans = (B-A)/2 ;
        cout << ans << endl;
        return 0;
    }
    else{
        ull ans1 = max(A-1,B-1);
        ull ansN = max(N-A,N-B);
        ans = min(ans1,ans2);
        cout << ans << endl;
        return 0;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:24: error: 'ans2' was not declared in this scope; did you mean 'ansN'?
   58 |         ans = min(ans1,ans2);
      |                        ^~~~
      |                        ansN
Language: C

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


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


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

public class Main {
	public static void main(String args[]) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		long N = sc.nextLong();
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		if((A-B)%2==0) {
			out.println((Math.max(A, B)-Math.min(A, B))/2);
		}
		else {
			out.println(Math.min(A, B)+(Math.max(A, B)-Math.min(A, B)-1)/2);
		}

		out.println(result);

		out.flush();
	}


}

class FastScanner {
	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() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; 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 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();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) nl;
	}
	public double nextDouble() { return Double.parseDouble(next());}
}



Compiler output:
Main.java:22: error: cannot find symbol
		out.println(result);
		            ^
  symbol:   variable result
  location: class Main
1 error