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

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


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;
      |     ^~
a.cc:6:27: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |     scanf("%lld%lld%lld",&n,&a,&b);
      |                           ^
      |                           yn
a.cc:6:30: error: 'a' was not declared in this scope
    6 |     scanf("%lld%lld%lld",&n,&a,&b);
      |                              ^
a.cc:6:33: error: 'b' was not declared in this scope
    6 |     scanf("%lld%lld%lld",&n,&a,&b);
      |                                 ^
Language: Java

class Solution {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong() - 1;
        long B = scanner.nextLong() - 1;
        long d = Math.abs(A - B);
        if (d % 2 == 0) {
            System.out.println(d / 2);
        } else {
            long e = Math.min(A, N - B - 1);
            System.out.println(e + (d - 1) / 2 + 1);
        }
    }
}

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

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

int main(){
  int N,A,B,res = 0,diff,direc,small,big;
  cin >> N >> A >> B;
  if((B - A)%2 != 0){
  	res = min(A - 1,N - B)+1+(B-A-1)/2
  }else{
  	res = (B - A)/2;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:43: error: expected ';' before '}' token
    8 |         res = min(A - 1,N - B)+1+(B-A-1)/2
      |                                           ^
      |                                           ;
    9 |   }else{
      |   ~
Language: C++

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

int main(){
  int N,A,B,res = 0,diff,direc,small,big;
  cin >> N >> A >> B;
  if((B - A)%2 != 0){
  	res = min(A - 1,N - B)+(B-A-1)/2
  }else{
  	res = (B - A)/2;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: expected ';' before '}' token
    8 |         res = min(A - 1,N - B)+(B-A-1)/2
      |                                         ^
      |                                         ;
    9 |   }else{
      |   ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'min(long long int)'
   13 |         cout << min((n-b+1)-(a-b+1))/2,a-1 + (b-a+1)/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:   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:13:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |         cout << min((n-b+1)-(a-b+1))/2,a-1 + (b-a+1)/2);
      |                 ~~~^~~~~~~~~~~~~~~~~
/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>

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

using namespace std;

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

  if((b-a)%2==0)cout<<(b-a)/2
  else cout<<b-1;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ';' before 'else'
   11 |   if((b-a)%2==0)cout<<(b-a)/2
      |                              ^
      |                              ;
   12 |   else cout<<b-1;
      |   ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,n,t;
    cin>>n>>a>>b;

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


}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n,t;
    cin>>n>>a>>b;

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


}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n;
    cin>>n>>a>>b;

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


}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 't' was not declared in this scope
   12 |             cout<<t;
      |                   ^
a.cc: At global scope:
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: Java

import java.util.*;

public class Main{
public static void main(String[] args){

	Scanner sc = new Scanner(System.in);

	long n=sc.nextLong();
	long a=sc.nextLomg();
	long b=sc.nextLong();

	if((b-a)%2==1 && ((a-1)>=(n-b))){
		System.out.println(n-a);
	}else if((b-a)%2==1 && ((a-1)<(n-b))){
		System.out.println(b-1);
	}else if((b-a)%2==0){
		System.out.println((b-a)/2);
}

	
}
}


Compiler output:
Main.java:9: error: cannot find symbol
	long a=sc.nextLomg();
	         ^
  symbol:   method nextLomg()
  location: variable sc of type Scanner
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 if((b-a)%2==1&&(a-1)>(n-b)){
    cout<<n-b+1<<endl;
  }
  else{
    cout<<a<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: lvalue required as left operand of assignment
    6 |   if((b-a)%2=0){
      |      ~~~~~^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 |   cin>>n>>a>>b;
      |        ^
      |        yn
a.cc:4:11: error: 'a' was not declared in this scope
    4 |   cin>>n>>a>>b;
      |           ^
a.cc:4:14: error: 'b' was not declared in this scope
    4 |   cin>>n>>a>>b;
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
int a,b,c;
  cin>>a>>b>>c;
  int t;
  t=a+b;
  if(a==t)
  {
    if(a>b)
      cout<<b<<endl;
      else
        cout<<a<<<endl;
  }
  else
    int p;
    p=t-a;
  cout<<p;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected primary-expression before '<' token
   14 |         cout<<a<<<endl;
      |                  ^
a.cc:18:5: error: 'p' was not declared in this scope
   18 |     p=t-a;
      |     ^
Language: C++

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


int main(void){
  float N, A, B;
  cin >> N >> A >> B;
  float diff = abs(A - B);
  if(diff % 2 == 0){
    cout << diff / 2 << endl;    
  }
  else{
    float large = 0, small = 0;
    if(A > B){
      large = A;
      small = B;
    }
    else{
      large = B;
      small = A;
    }
    if(N - small > large - 1) cout << large - 1 << endl;
    else cout << N - small << endl;
    
    
  }
  
  
 return 0; 
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:6:9: note: in expansion of macro 'long'
    6 |    long long n, a, b;
      |         ^~~~
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin >> n >> a >> b;
      |                ^
      |                yn
a.cc:7:21: error: 'a' was not declared in this scope
    7 |         cin >> n >> a >> b;
      |                     ^
a.cc:7:26: error: 'b' was not declared in this scope
    7 |         cin >> n >> a >> b;
      |                          ^
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:10:12: note: in expansion of macro 'long'
   10 |       long long t=a;
      |            ^~~~
a.cc:12:9: error: 't' was not declared in this scope; did you mean 'tm'?
   12 |       b=t;
      |         ^
      |         tm
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:14:14: note: in expansion of macro 'long'
   14 |         long long diff = b - a;
      |              ^~~~
a.cc:15:12: error: 'diff' was not declared in this scope
   15 |         if(diff % 2 == 1){
      |            ^~~~
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:16:22: note: in expansion of macro 'long'
   16 |                 long long left = a;
      |                      ^~~~
a.cc:3:14: error: expected initializer before 'long'
    3 | #define long long ll
      |              ^~~~
a.cc:17:22: note: in expansion of macro 'long'
   17 |                 long long right = n - b + 1;
      |                      ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:4: error: 'll' was not declared in this scope
    6 |    ll n, a, b;
      |    ^~
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin >> n >> a >> b;
      |                ^
      |                yn
a.cc:7:21: error: 'a' was not declared in this scope
    7 |         cin >> n >> a >> b;
      |                     ^
a.cc:7:26: error: 'b' was not declared in this scope
    7 |         cin >> n >> a >> b;
      |                          ^
a.cc:10:9: error: expected ';' before 't'
   10 |       ll t=a;
      |         ^~
      |         ;
a.cc:12:9: error: 't' was not declared in this scope; did you mean 'tm'?
   12 |       b=t;
      |         ^
      |         tm
a.cc:14:11: error: expected ';' before 'diff'
   14 |         ll diff = b - a;
      |           ^~~~~
      |           ;
a.cc:15:12: error: 'diff' was not declared in this scope
   15 |         if(diff % 2 == 1){
      |            ^~~~
a.cc:16:19: error: expected ';' before 'left'
   16 |                 ll left = a;
      |                   ^~~~~
      |                   ;
a.cc:17:19: error: expected ';' before 'right'
   17 |                 ll right = n - b + 1;
      |                   ^~~~~~
      |                   ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:52: error: expected ';' before '}' token
    9 |   else if(a == 1 || a == n){cout << b-1 << endl;++x}
      |                                                    ^
      |                                                    ;
a.cc:10:61: error: expected ';' before '}' token
   10 |   else if((b == 1 || b == n)&& x==0){cout << a-1 << endl;++x}
      |                                                             ^
      |                                                             ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: lvalue required as left operand of assignment
   10 |   else if((b == 1 || b == n)&& x=0){cout << a-1 << endl;++x;}
      |           ~~~~~~~~~~~~~~~~~~^~~~
a.cc:11:16: error: lvalue required as left operand of assignment
   11 |   else if(a!=b && x=0)
      |           ~~~~~^~~~
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:52: error: expected ';' before '}' token
    9 |   else if(a == 1 || a == n){cout << b-1 << endl;++x}
      |                                                    ^
      |                                                    ;
a.cc:10:29: error: lvalue required as left operand of assignment
   10 |   else if((b == 1 || b == n)&& x=0){cout << a-1 << endl;++x}
      |           ~~~~~~~~~~~~~~~~~~^~~~
a.cc:10:60: error: expected ';' before '}' token
   10 |   else if((b == 1 || b == n)&& x=0){cout << a-1 << endl;++x}
      |                                                            ^
      |                                                            ;
a.cc:11:16: error: lvalue required as left operand of assignment
   11 |   else if(a!=b && x=0)
      |           ~~~~~^~~~
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:44: error: expected ';' before '}' token
   19 |         count = min(n-a, b-1) + 1 + (b-a)/2
      |                                            ^
      |                                            ;
   20 |     }
      |     ~
Language: C++

cont = list(map(int,input().rstrip().split()))
N = cont[0]
A = cont[1] 
B = cont[2] 
if(A%2==B%2): 
  print(int(abs(B-A)/2)) 
else: 
  dist1 = A - 1
  dist2 = N - B 
  if(dist1<dist2): 
    x = A - 1 
    y = x 
    x+=1 #parity 
    y = x 
    #B = B - y
    #A = 1 
    y+=(B-A-1)/2 
    print(int(y))
  else: 
    x = N - B 
    y = x 
    x+=1 
    y = x 
    #A = A + y 
    #B = N 
    y+= (B-A)/2 
    print(int(y))


Compiler output:
a.cc:13:10: error: stray '#' in program
   13 |     x+=1 #parity
      |          ^
a.cc:15:6: error: invalid preprocessing directive #B
   15 |     #B = B - y
      |      ^
a.cc:16:6: error: invalid preprocessing directive #A
   16 |     #A = 1
      |      ^
a.cc:24:6: error: invalid preprocessing directive #A
   24 |     #A = A + y
      |      ^
a.cc:25:6: error: invalid preprocessing directive #B
   25 |     #B = N
      |      ^
a.cc:1:1: error: 'cont' does not name a type; did you mean 'const'?
    1 | cont = list(map(int,input().rstrip().split()))
      | ^~~~
      | const
Language: C++

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


Compiler output:
a.cc:13:2: error: unterminated argument list invoking macro "PUTS"
   13 | }
      |  ^
a.cc: In function 'int main()':
a.cc:11:9: error: 'PUTS' was not declared in this scope
   11 |         PUTS(min((b+a+1)/2, (n-a+n-b+1)/2);
      |         ^~~~
a.cc:11:13: error: expected '}' at end of input
   11 |         PUTS(min((b+a+1)/2, (n-a+n-b+1)/2);
      |             ^
a.cc:10:12: note: to match this '{'
   10 |     } else {
      |            ^
a.cc:11:13: error: expected '}' at end of input
   11 |         PUTS(min((b+a+1)/2, (n-a+n-b+1)/2);
      |             ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import java.util.Scanner;

public class TableTennisTraining {

public static void main(String[] args) {

	/*System.out.println("数字を入力してください");*/
	Scanner scanner=new Scanner(System.in);

	int n = scanner.nextInt();
	int a = scanner.nextInt();
	int b = scanner.nextInt();

	/*System.out.println(n+" "+a+" "+b);*/

	int x,y;

	if((a%2==0&&b%2==0)||(a%2!=0&&b%2!=0)) {
		x=(b-a)/2;
		System.out.println(x);
		}else{
		y=Math.min(a-1, n-b)+1+(b-a-1)/2;
		System.out.println(y);
	}
}
}


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

#include <stdio.h>
#include <stdlib.h>

void
solver(long long n, long long a, long long b)
{
    long long d = b-a;
    long long r;

    if (d%2==0) {
        printf("%lld\n", d/2);
    }
    else {
        if (n-b>a-1) {
            d = a-1;
        }
        else {
            d = n-b;
        }
        d += (b-a+1)/2;
        printf("%lld\n", d);
    }
    return;
}

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 <stdio.h>
#include <stdlib.h>

struct test {
    long long N, A, B;
    long long ans;
} test[] =
{
    {5, 2, 4, 1},
    {5, 2, 3, 2},
};

void
solver(long long n, long long a, long long b)
{
    long long d = b-a;

    if (d%2==0) {
        printf("%lld\n", d/2);
    }
    else {
        if (n-b>a-1) {
            printf("%lld\n", a);
        }
        else {
            printf("%lld\n", n-b+1);
        }
    }
    return;
}#include <stdio.h>
#include <stdlib.h>

struct test {
    long long N, A, B;
    long long ans;
} test[] =
{
    {5, 2, 4, 1},
    {5, 2, 3, 2},
};

void
solver(long long n, long long a, long long b)
{
    long long d = b-a;

    if (d%2==0) {
        printf("%lld\n", d/2);
    }
    else {
        if (n-b>a-1) {
            printf("%lld\n", a);
        }
        else {
            printf("%lld\n", n-b+1);
        }
    }
    return;
}

Compiler output:
main.c:30:2: error: stray '#' in program
   30 | }#include <stdio.h>
      |  ^
main.c:30:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   30 | }#include <stdio.h>
      |           ^
main.c:36:3: warning: data definition has no type or storage class
   36 | } test[] =
      |   ^~~~
main.c:36:3: error: type defaults to 'int' in declaration of 'test' [-Wimplicit-int]
main.c:36:3: error: conflicting types for 'test'; have 'int[]'
main.c:7:3: note: previous definition of 'test' with type 'struct test[2]'
    7 | } test[] =
      |   ^~~~
main.c:38:5: warning: braces around scalar initializer
   38 |     {5, 2, 4, 1},
      |     ^
main.c:38:5: note: (near initialization for 'test[0]')
main.c:38:9: warning: excess elements in scalar initializer
   38 |     {5, 2, 4, 1},
      |         ^
main.c:38:9: note: (near initialization for 'test[0]')
main.c:38:12: warning: excess elements in scalar initializer
   38 |     {5, 2, 4, 1},
      |            ^
main.c:38:12: note: (near initialization for 'test[0]')
main.c:38:15: warning: excess elements in scalar initializer
   38 |     {5, 2, 4, 1},
      |               ^
main.c:38:15: note: (near initialization for 'test[0]')
main.c:39:5: warning: braces around scalar initializer
   39 |     {5, 2, 3, 2},
      |     ^
main.c:39:5: note: (near initialization for 'test[1]')
main.c:39:9: warning: excess elements in scalar initializer
   39 |     {5, 2, 3, 2},
      |         ^
main.c:39:9: note: (near initialization for 'test[1]')
main.c:39:12: warning: excess elements in scalar initializer
   39 |     {5, 2, 3, 2},
      |            ^
main.c:39:12: note: (near initialization for 'test[1]')
main.c:39:15: warning: excess elements in scalar initializer
   39 |     {5, 2, 3, 2},
      |               ^
main.c:39:15: note: (near initialization for 'test[1]')
main.c:43:1: error: redefinition of 'solver'
   43 | solver(long long n, long long a, long long b)
      | ^~~~~~
main.c:14:1: note: previous definition of 'solver' with type 'void(long long int,  long long int,  long long int)'
   14 | solver(long long n, long long a, long long b)
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
signed main(){
int x=0,y=0,z=0;
std::cin >> x>>y>>z;
if((z-y)%2==0)std::cout << (z-y)/2 << '\n';
else std::cout << min(min(z-1,x-y),min((y+z-1)/2,(2*x+1-z-y)/2)) << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'min' was not declared in this scope; did you mean 'std::min'?
    7 | else std::cout << min(min(z-1,x-y),min((y+z-1)/2,(2*x+1-z-y)/2)) << '\n';
      |                       ^~~
      |                       std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:7:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
    7 | else std::cout << min(min(z-1,x-y),min((y+z-1)/2,(2*x+1-z-y)/2)) << '\n';
      |                   ^~~
      |                   std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: Java

import java.beans.Introspector;
import java.util.*;
public final class tennis {
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    long n = s.nextLong();
    long a = s.nextLong();
    long b = s.nextLong();
    
    if((b-a)%2==0)
        System.out.println(((b-a)/2));
    else{
        long ans = Math.min(n-a, b-1);
        System.out.println(ans);
    }
    
  }
}

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

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define nmax 100005
using namespace std;
int main()
{
    int a,b,n;
    cin>>>n>>a>>b;
    cout << min(a-1,n-b)+1+(b-a-1)/2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before '>' token
   12 |     cin>>>n>>a>>b;
      |          ^
Language: C++



#include <iostream>
#include <cmath>

using namespace std;

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

    return 0;
}

    
    cout<<x;

    return 0;
}


Compiler output:
a.cc:40:5: error: 'cout' does not name a type
   40 |     cout<<x;
      |     ^~~~
a.cc:42:5: error: expected unqualified-id before 'return'
   42 |     return 0;
      |     ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

using namespace std;
int n,a,b;
int main() {
	cin>>n>>a>>b;
  	cout>>min(a-1,n-b)+1+((b-a-1)/2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         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 | using namespace std;
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout>>min(a-1,n-b)+1+((b-a-1)/2);
      |         ^~~~
a.cc:5:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:5:15: error: 'min' was not declared in this scope; did you mean 'main'?
    5 |         cout>>min(a-1,n-b)+1+((b-a-1)/2);
      |               ^~~
      |               main
Language: C++

#include <iostream>

using namespace std;
typedef long long ll
int main(){
    ll N;
    ll A,B;
    cin >> N >> A >> B;
    if(A%2 == B%2){
        cout << abs(A-B)/2 << endl;
    }else{
        cout << min(B-1,N-A) << endl;
    }
    return 0;
}

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

#include <iostream>

using namespace std;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'else' without a previous 'if'
   13 |                 }else{
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



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

    int n, a, b;
    cin >> n >> a >> b;

    if(a % 2 == b % 2) {
        cout << (b - a) / 2 << endl;
        return 0;
    }

    cout << min(a - 1, n - b) + 1 + (b - a - 1) / 2 << endl;å
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:61: error: '\U000000e5' was not declared in this scope
   42 |     cout << min(a - 1, n - b) + 1 + (b - a - 1) / 2 << endl;å
      |                                                             ^
Language: C++

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

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

        return 0;
    }


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

import java.util.*;
 
class AtCoder {
    public static void main(String[] args) {
 
        Scanner in = new Scanner(System.in);
      try{
        long n, a, b;
        n = in.nextLong();
        a = in.nextLong();
        b = in.nextLong();
 
        if ((b - a) % 2 == 0)
            System.out.println((b - a) / 2);
        else
            System.out.println(b - 1);
        in.close();
      }catch(Ecxeption e)
      {
        return;
      }
    }
}

Compiler output:
Main.java:18: error: cannot find symbol
      }catch(Ecxeption e)
             ^
  symbol:   class Ecxeption
  location: class AtCoder
1 error
Language: Java

import java.util.*;
 
class AtCoder {
    public static void main(String[] args) {
 
        Scanner in = new Scanner(System.in);
      try{
        long n, a, b;
        n = in.nextLong();
        a = in.nextLong();
        b = in.nextLong();
 
        if ((b - a) % 2 == 0)
            System.out.println((b - a) / 2);
        else
            System.out.println(b - 1);
        in.close();
      }catch(Ecxrption e)
      {
        return;
      }
    }
}

Compiler output:
Main.java:18: error: cannot find symbol
      }catch(Ecxrption e)
             ^
  symbol:   class Ecxrption
  location: class AtCoder
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lld long long int
#define M 1000000007
#define fors(i,n) for(int i=0;i<n;++i)
#define fore(i,a,b) for(int i=a;i<=b;++i)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define vv vector<int>
#define endl "\n"
#define test(i) cout<<i<<endl
#define itrt int t; cin>>t; fors(i,t)
#define itr1 int t; cin>>t;
#define ff first
#define ss second
#define pb push_back
#define vmp make_pair
#define ppb pop_back
#define sorta(a,n) sort(arr,arr+n)
#define sortv(x) sort(x.begin(),x.end())
void file(){
    #ifdef LOCAL
    freopen("demo.in","r",stdin);
    freopen("demo.out","w",stdout);
    #endif
}
int main(){
    fastio;
    file();
  int N,A,B;
  cin>>N>>A>>B;
  	cout<<min(A−1,N−B)+1+(B−A−1)/2;
}

Compiler output:
a.cc:31:19: error: extended character − is not valid in an identifier
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                   ^
a.cc:31:23: error: extended character − is not valid in an identifier
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                       ^
a.cc:31:31: error: extended character − is not valid in an identifier
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                               ^
a.cc:31:31: error: extended character − is not valid in an identifier
a.cc: In function 'int main()':
a.cc:31:19: error: 'A\U000022121' was not declared in this scope
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                   ^~~
a.cc:31:23: error: 'N\U00002212B' was not declared in this scope
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                       ^~~
a.cc:31:31: error: 'B\U00002212A\U000022121' was not declared in this scope
   31 |         cout<<min(A−1,N−B)+1+(B−A−1)/2;
      |                               ^~~~~
Language: C++

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n,a,b; cin >> n >> a >> b;
  if ((b-a)%2==0) cout << (b-a)/2 << endl;
  else {
    ll ans1 = min(a-1, n-b) + 1 + (a+b-1)/2;
    cout << min(b-1,ans) << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'ans' was not declared in this scope; did you mean 'ans1'?
   12 |     cout << min(b-1,ans) << endl;
      |                     ^~~
      |                     ans1
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

int main( void ){
	ll N, A, B;
	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;
	}
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: 'a' was not declared in this scope
   25 |                 cout << min( a - 1, n - b ) + 1 + ( b - a - 1 ) / 2 << endl;
      |                              ^
a.cc:25:37: error: 'n' was not declared in this scope
   25 |                 cout << min( a - 1, n - b ) + 1 + ( b - a - 1 ) / 2 << endl;
      |                                     ^
a.cc:25:41: error: 'b' was not declared in this scope
   25 |                 cout << min( a - 1, n - b ) + 1 + ( b - a - 1 ) / 2 << endl;
      |                                         ^
Language: C++

#include<stdio.h>
int main(){
  int A,B,N;
  int ans,d;
  scanf("%d%d%d",&N,&A.&B);
  d=B-A;
  if(d%2==0)
    ans=d/2;
  else{
    d=B-1;
    ans=N-A;
    if(ans>d)
      ans=d;
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected unqualified-id before '&' token
    5 |   scanf("%d%d%d",&N,&A.&B);
      |                        ^
Language: C++

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

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

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: no matching function for call to 'min(ll&, <unresolved overloaded function type>)'
   21 |                 ll ans = min(up,min);
      |                          ~~~^~~~~~~~
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: 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:36: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const long long int&'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |                         ~~~~~~~~~~~^~~
/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:21:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |                 ll ans = min(up,min);
      |                          ~~~^~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: cannot resolve overloaded function 'min' based on conversion to type 'll' {aka 'long long int'}
   21 |                 ll ans = min{ (up,min) };
      |                          ^~~
Language: C++

#include<iostream>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else
      |   ^~~~
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){
            long long int s=(b-a)/2;
            cout<<s;
        }
        else{
         auto min=min(a-1,n-b);
             int c=min+(b-a+1)/2;
            cout<<c;
            }
    
   return 0;     
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: use of 'min' before deduction of 'auto'
   13 |          auto min=min(a-1,n-b);
      |                   ^~~
Language: C++

#include<iostream>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before 'return'
    9 |     cout<<return (b-a)/2;;
      |           ^~~~~~
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else
      |   ^~~~
a.cc:11:15: error: expected primary-expression before 'return'
   11 |         cout<<return min(a-1, n-b) + 1 + (b-a-1)/2;
      |               ^~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: expected primary-expression before '==' token
    7 |         if ((B - A) % 2) == 0) {
      |                          ^~
a.cc: At global scope:
a.cc:16:9: error: 'cout' does not name a type
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
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){
            long long int s=(b-a)/2;
            cout<<s;
        }
        else{
         long long    int n=min(a-1,n-b)
             int c=n+(b-a+1)/2;
            cout<<c;
            }
    
   return 0;     
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected ',' or ';' before 'int'
   14 |              int c=n+(b-a+1)/2;
      |              ^~~
a.cc:15:19: error: 'c' was not declared in this scope
   15 |             cout<<c;
      |                   ^
Language: C++

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

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


Compiler output:
a.cc:16:9: error: 'cout' does not name a type
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected ';' before 'ans'
   11 |       ans =min( N - B,A-1)
      |                           ^
      |                           ;
   12 |        ans=ans+ 1 + (B - A - 1) / 2;
      |        ~~~                 
a.cc: At global scope:
a.cc:16:9: error: 'cout' does not name a type
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^