criyle/codenet-compile-errors huggingface dataset:
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) + 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:15:9: error: 'cout' does not name a type
   15 |         cout << ans << endl;
      |         ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expression cannot be used as a function
   13 |             ans=min(a-1,n-b)+1(b-a-1)/2;
      |                              ~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)

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

 ll dt = B-A;
 if(dt==0){
   cout<<0<<endl;
   return 0;
 }

 if(dt%2==0){
   cout<<((dt-1)/2LL)+1<<endl;
   return 0;
 }
 ll rr = min(B-1,(N-A));



 //yasumi
 //migi
 ll dt = N - (A+(N-B)+1);
 rr = min(rr,((dt-1)/2LL)+1);
 dt = B-(A-1+1)-1;
 rr = min(rr,((dt-1)/2LL)+1);








cout<<rr<<endl;
return 0;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: redeclaration of 'long long int dt'
   31 |  ll dt = N - (A+(N-B)+1);
      |     ^~
a.cc:15:5: note: 'long long int dt' previously declared here
   15 |  ll dt = B-A;
      |     ^~
Language: C

#include<iostream>
#include<string>
using namespace std;

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


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

//#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main(){
    ll N,A,B;
    cin >> N >> A >> B;
    ll gap = abs(A - B);
    if( (gap%2)==0 ){
        cout << gap/2 << endl;
    }else{
        /*
        //ぼつ
        ll dis0_A = A - 1;
        ll dis0_B = B - 1;
        ll dis0 = max(dis0_A,dis0_B);
        ll disN_A = abs(A - N);
        ll disN_B = abs(B - N);
        ll disN = max(disN_A,disN_B);
        ll ans = min(dis0,disN);
        */

        ll ans = min(dis0_A,disN_B) + 1 + (B-A-1)/2;//相対距離は変わっていないので，早く折り返しができる方に向かう

        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:22: error: 'dis0_A' was not declared in this scope
   59 |         ll ans = min(dis0_A,disN_B) + 1 + (B-A-1)/2;//相対距離は変わっていないので，早く折り返しができる方に向かう
      |                      ^~~~~~
a.cc:59:29: error: 'disN_B' was not declared in this scope
   59 |         ll ans = min(dis0_A,disN_B) + 1 + (B-A-1)/2;//相対距離は変わっていないので，早く折り返しができる方に向かう
      |                             ^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:52: error: expected ';' before '}' token
   12 |     cout << x + 1 + (max(a, b) - min(a, b) - 1) / 2
      |                                                    ^
      |                                                    ;
   13 |   }
      |   ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:34: error: expected ';' before '}' token
   15 |     i = (c + 1)/2 + min(N-A, B-1)
      |                                  ^
      |                                  ;
   16 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
    ll n,a,b;
    cin>>n>>a>>b;
    ll c;
    c=b-a;
    if(c%2==0)
        cout<<c/2;
    else
    {

		if(a==1 || b==n)
            cout<<(c-1)/2 + 1;
		else
		{
        if((a-1 >= n-b){
            a+=n-b;
            b+=n-b;
			cout<<(n-b+((c-1)/2+1));
        }
		else{
            b-=a-1;
            a-=a-1;
			cout<<(a-1+((c-1)/2+1));
		}
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ')' before '{' token
   21 |         if((a-1 >= n-b){
      |           ~            ^
      |                        )
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected ';' before '}' token
   23 |   cout << i
      |            ^
      |            ;
   24 | }
      | ~
Language: C++

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


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define co(n) cout << n << endl
using namespace std;
int main(){
  long a, b, c=0, d=0, e, f, g, h, n;
  cin >> n >> a >> b;
  if((b-a)%2==0) co((b-a)/2);
  else if(b-a==1) co(min(b-1, n-a));
  else if(b-1>n-a) co(n-(b-a+1)/2);
  else co((b+a-1)/2;
  return 0;
}


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

#include<stdio.h>

int compare(int a,int b);

int main()
{
  int N,A,B;
  int X,x,ans;

  scanf("%d",&N);
  scanf("%d",&A);
  scanf("%d",&B); 

  if(A > B){
    x = B;
    X = A;
  }
  else{
    x = A;
    X = B;
  }

  if((X - x)%2 == 0){
    ans = (X - x)/2;
  }
  else{   
    //ans = compare(N - x,X - 1,((N - x) + (N - X) + 1)/2);
    if(N - x > X - 1){
      ans = compare(X - 1,((x - 1) + (X - 1) + 1)/2);
    }
    else{
      ans = compare(N - x,((N - x) + (N - X) + 1)/2);
    }
      
  }

  
  printf("%d\n",ans);
  
  
  return 0;
}

int compare(int a,int b,int c){
  if(a > b){
      return b;
  }
  else{
    return a;
  }
}


Compiler output:
main.c:44:5: error: conflicting types for 'compare'; have 'int(int,  int,  int)'
   44 | int compare(int a,int b,int c){
      |     ^~~~~~~
main.c:3:5: note: previous declaration of 'compare' with type 'int(int,  int)'
    3 | int compare(int a,int b);
      |     ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: expected primary-expression before '<' token
   17 |                 else if(B-1=<N-A){
      |                             ^
Language: Java

import java.util.Scanner;

public class main {

	public static void main(String[] args) 
	{
		Scanner std = new Scanner(System.in);
		int n = std.nextInt();
		int a = std.nextInt();
		int b = std.nextInt();
		int c = 0;
		
		if(n % 2 == 0)
		{
			c = 1 + ((b - a) / 2);
		}
		else
		{
			c = 1 + (b - a) / 2;
		}
		
		System.out.println(c);
	}

}

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

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define MIN(a, b)  (((a) < (b)) ? (a) : (b)) 
#define MAX(a, b)  (((a) > (b)) ? (a) : (b)) 
int main(void) {
    long long   n,a,b;
    scanf("%lld" "%lld" "%lld",&n,&a,&b);
    long long t =abs(a-b);
    
    if(t%2==0){
        printf("%lld",t/2);
        return 0;
    }else{
        long long ans ;
        ans = MIN(MIN(a,b)-1,n-MAX(a,b))+((t+1)/2));
        printf("%lld",ans);
        return 0;       
        }
    }

Compiler output:
main.c: In function 'main':
main.c:16:51: error: expected ';' before ')' token
   16 |         ans = MIN(MIN(a,b)-1,n-MAX(a,b))+((t+1)/2));
      |                                                   ^
      |                                                   ;
main.c:16:51: error: expected statement before ')' token
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define MIN(a, b)  (((a) < (b)) ? (a) : (b)) 
#define MAX(a, b)  (((a) > (b)) ? (a) : (b)) 
int main(void) {
    long long   n,a,b;
    scanf("%lld" "%lld" "%lld",&n,&a,&b);
    long long t =abs(a-b);
    
    if(t%2==0){
        printf("%lld",t/2);
        return 0;
    }else{
        long long ans ;
        ans = MIN(MIN(a,b)-1,n-MAX(a,b))+(t+1)/2);
        printf("%lld",ans);
        return 0;       
        }
    }

Compiler output:
main.c: In function 'main':
main.c:16:49: error: expected ';' before ')' token
   16 |         ans = MIN(MIN(a,b)-1,n-MAX(a,b))+(t+1)/2);
      |                                                 ^
      |                                                 ;
main.c:16:49: error: expected statement before ')' token
Language: C++

#include<iostream>
using namespacestd;
int main(){
unsigned long long int n,a,b;
  cin>>n>>a>>b;
  if((b-a)%2==0)cout<<(b-a)/2;
  else if(a<b) cout<<a;
  else cout<<b;
  return 0;



}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacestd'
    2 | using namespacestd;
      |       ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n>>a>>b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if((b-a)%2==0)cout<<(b-a)/2;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   else if(a<b) cout<<a;
      |                ^~~~
      |                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   else cout<<b;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include <stdio.h>
int main (void)
{
  int n,a,b;
  int sa,sum=0,sa2,top,down;
  scanf("%d %d %d",&n,&a,&b);
  if( a >= b)
  {
    sa = a-b;
  }
  else
  {
    sa = b-a;
  }
  if( sa % 2 == 0)
  {
    printf("%d", sa / 2);
  }
  else if( sa % 2 == 1)
  {
    if(a > b)
    {
      top = b - 1;
      down = n - a;
      if( top >= down)
      {
      	sum += (down + 1);
      	b = b + down + 1;
      	sa2 = n - b;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
      else if( down > top)
      {
        sum += top + 1;
      	a = a - top - 1;
      	sa2 = a - 1;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
    }
    else if( b > a )
     {
      top = a - 1;
      down = n - b;
      if( top >= down)
      {
      	sum += (down + 1);
      	a = a + down + 1;
      	sa2 = n - a;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
      else if( down > top)
      {
        sum += top + 1;
      	b = b - top - 1;
      	sa2 = b - 1;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:64:1: error: expected declaration or statement at end of input
   64 | }
      | ^
Language: C

#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
	long long N,A,B;
	scanf("%lld %lld %lld",&N,&A,&B);
	if(llabs(A-B)%2 == 1){
		printf("%lld",min(min(N-A,N-B),min(A,B)));
		return 0;
		}
	else if(llabs(A-B)%2 == 0){
		printf("%lld",llabs(A-B)/2);
		}
	return 0;
	}

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

#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
	long long N,A,B;
	scanf("%lld %lld %lld",&N,&A,&B);
	if(llabs(A-B)%2 == 1){
		printf("%lld",min(min(N-A,N-B),min(A,B)));
		return 0;
		}
	else if(llabs(A-B)%2 == 0){
		printf("%lld",llabs(A-B)/2);
		}
	return 0;
	}


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

#include <stdio.h>
int main (void)
{
  int n,a,b;
  int sa,sum=0,sa2,top,down;
  scanf("%d %d %d",&n,&a,&b);
  if( a >= b)
  {
    sa = a-b;
  }
  else
  {
    sa = b-a;
  }
  if( sa % 2 == 0)
  {
    printf("%d", sa / 2);
  }
  else if( sa % 2 == 1)
  {
    if(a > b)
    {
      top = b - 1;
      down = n - a;
      if( top > down)
      {
      	sum += (down + 1);
      	b = b + down + 1;
      	sa2 = n - b;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
      else if( down > top)
      {
        sum += top + 1;
      	a = a - top - 1;
      	sa2 = a - 1;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
    }
    else if( b > a )
     {
      top = a - 1;
      down = n - b;
      if( top > down)
      {
      	sum += (down + 1);
      	a = a + down + 1;
      	sa2 = n - a;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
      else if( down > top)
      {
        sum += top + 1;
      	b = b - top - 1;
      	sa2 = b - 1;
      	sum += (sa2 / 2);
      	printf("%d",sum);
      }
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:64:1: error: expected declaration or statement at end of input
   64 | }
      | ^
Language: C++

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

int main() {
  int N ,A ,B;
  cin >> N >> A >> B;
  int sum =0;
  for ( int i = 0; i < N; i++ ){
    for(int k = 0; k < N;k++) {
      if (A==N){
        continue;
      }
      A++;
    }
    for (int j=0;j<N;j++){
      if (B==N){
        continue;
      }
      B--;
    }
    if (A==B){
      break;
    }
    sum++;
  
  cout << sum+1<< endl;
}
  

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

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

int main() {
  int N ,A ,B;
  cin >> N >> A >> B;
  int sum =0;
  for ( int i = 0; i < N; i++ ){
    for(int k = 0; k < N;k++) {
      if (A==N){
        continue;
      }
      A++;
    }
    for (int j=0;j<N;j++){
      if (B==N){
        continue;
      }
      B--;
    }
    if (A==B){
      break;
    }
    sum++
  
  cout << sum+1<< endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: expected ';' before 'cout'
   24 |     sum++
      |          ^
      |          ;
   25 | 
   26 |   cout << sum+1<< endl;
      |   ~~~~    
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
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 << 1 << endl;
    cout <<(B-A)/2<< endl;
  }
  else if((A-1)<(N-B)){
    //cout << 2 << endl;
    cout << B-1 << endl;
  }
  else if((A-1)>(N-B)){
    //cout << 3 << endl;
    cout << N-A << endl;
  }
  else((A-1)==(N-B)){
   // cout << 4 << endl;
    cout << B-1 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ';' before '{' token
   20 |   else((A-1)==(N-B)){
      |                     ^
      |                     ;
Language: C++

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

int main() {
  int N ,A ,B;
  cin >> N >> A >> B;
 
  for ( int i = 0; i < N; i++ ){
    for(int k = 0; k < N;k++) {
      if (A==N){
        continue;
      }
      A++;
    }
    for (int j=0;j<N;j++){
      if (B==N){
        continue;
      }
      B--;
    }
    if (A==B){
      break;
    }
  }
  cout << i+1 << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'i' was not declared in this scope
   25 |   cout << i+1 << endl;
      |           ^
Language: C++

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

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

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

#include <stdio.h>

int main()
{
	int n, a, b, ans;
	int head_a, head_b, back_a, back_b, head, back;


	scanf("%d %d %d", &n, &a, &b);

	if (abs(a - b) % 2 == 0)
	{
		ans = abs(a - b) / 2;
		printf("%d\n", ans);
	}

	else
	{
		head_a = a - 1;
		head_b = b - 1;

		back_a = n - a;
		back_b = n - b;

		head = head_a + head_b;
		back = back_a + back_b;

		if (head < back)
		{
			if (head_a < head_b)
			{
				ans = head_b;
			}
			else
			{
				ans = head_a;
			}
		}

		else
		{
			if (back_a < back_b)
			{
				ans = back_b;
			}
			else
			{
				ans = back_a;
			}
		}

		printf("%d\n", ans);
	}

	return 0;


}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'abs' was not declared in this scope; did you mean 'ans'?
   11 |         if (abs(a - b) % 2 == 0)
      |             ^~~
      |             ans
Language: C++

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

Compiler output:
a.cc:2:17: error: 'STD' is not a namespace-name
    2 | using namespace STD;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:6:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |       cin>>n>>a>>b;
      |       ^~~
      |       std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout<<m;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
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;
else
cout<<B-A+1;
return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,a,b;
  	cin>>n>>a>>b;
  	long long absol = abs(a-b);
  	long long r1 = 0x3f3f3f3f,r2,r3;
  	if(absol%2==0)
  		r1 = absol/2;
  	r2 = max(a,b) - 1;
  	r3 = n - min(a,b);
  	long long r4 = a + (b - a -1)/2;
  	long long r5 = n - b + 1 + (a + n - b - 1)/2;
  	cout<<min(r1,min(r2,min(r3,min(r4,r5))))<<'\n';
}

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

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


Compiler output:
main.c: In function 'main':
main.c:23:78: error: expected ')' before ';' token
   23 |                 printf("%I64lld\n",min(b-1+1+(a-b-1)/2,n-a+1+(n-(b+n-a)-1)/2);
      |                       ~                                                      ^
      |                                                                              )
main.c:23:79: error: expected ';' before '}' token
   23 |                 printf("%I64lld\n",min(b-1+1+(a-b-1)/2,n-a+1+(n-(b+n-a)-1)/2);
      |                                                                               ^
      |                                                                               ;
   24 |         }
      |         ~
Language: C++

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


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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: expected ';' before '}' token
   14 |         ans=ans-(b-a-1)/2
      |                          ^
      |                          ;
   15 |     }
      |     ~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main(){
  long long int n;
  long long int a,b;
  cin>>n>>a>>b;
  long long int x,y,cnt;
  if(abs(a-b)%2==0){
    cnt=abs(a-b)/2;
    cout<<cnt<<endl;
    return 0;
  }

  x=min(max(a-1,n-a),max(b-1,n-b));
  if(x<max(b-1,n-b))y=min(b-1,n-b);
  else y=min(a-1,n-a)

  if(x-y>1){
    cnt=y-1+(x-y+1)/2;
    cout<<cnt<<endl;
    return 0;
  }
  cout<<x<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before 'if'
   19 |   else y=min(a-1,n-a)
      |                      ^
      |                      ;
   20 | 
   21 |   if(x-y>1){
      |   ~~
Language: C++

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

int key(long long int a,long long int b,long long int n){

  if(a - 1 <= n - b)
    return a;
  else if(a - 1 > n - b)
    return b;

}
 
int longint ni(long long int a,long long int b){
   long long int k=(max(a,b)-min(a,b))/2;
    return k;  
}

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

Compiler output:
a.cc:13:13: error: expected initializer before 'ni'
   13 | int longint ni(long long int a,long long int b){
      |             ^~
a.cc: In function 'int main()':
a.cc:32:24: error: 'ni' was not declared in this scope; did you mean 'n'?
   32 |          cout << a-1 + ni(0,b-a+1);
      |                        ^~
      |                        n
a.cc:34:26: error: 'ni' was not declared in this scope; did you mean 'n'?
   34 |          cout << b-a+2 + ni(0,b-a+2);
      |                          ^~
      |                          n
a.cc:39:24: error: 'ni' was not declared in this scope; did you mean 'n'?
   39 |          cout << n-b + ni(a+n-b,0);
      |                        ^~
      |                        n
a.cc:41:27: error: 'ni' was not declared in this scope; did you mean 'n'?
   41 |           cout << n-b+2 + ni(a+n-b+1,0);
      |                           ^~
      |                           n
a.cc: In function 'int key(long long int, long long int, long long int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
Language: C++

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


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

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

int key(kong long int a,long long int b,long long int n){

  if(a - 1 <= n - b)
    return a;
  else if(a - 1 > n - b)
    return b;

}
 
int longint ni(long long int a,long long int b){
   long long int k=(max(a,b)-min(a,b))/2;
    return k;  
}

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

Compiler output:
a.cc:4:9: error: 'kong' was not declared in this scope; did you mean 'long'?
    4 | int key(kong long int a,long long int b,long long int n){
      |         ^~~~
      |         long
a.cc:4:25: error: expected primary-expression before 'long'
    4 | int key(kong long int a,long long int b,long long int n){
      |                         ^~~~
a.cc:4:41: error: expected primary-expression before 'long'
    4 | int key(kong long int a,long long int b,long long int n){
      |                                         ^~~~
a.cc:4:56: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | int key(kong long int a,long long int b,long long int n){
      |                                                        ^
a.cc:13:13: error: expected initializer before 'ni'
   13 | int longint ni(long long int a,long long int b){
      |             ^~
a.cc: In function 'int main()':
a.cc:28:25: error: 'key' cannot be used as a function
   28 |    long long int c = key(a,b,n);
      |                      ~~~^~~~~~~
a.cc:32:24: error: 'ni' was not declared in this scope; did you mean 'n'?
   32 |          cout << a-1 + ni(0,b-a+1);
      |                        ^~
      |                        n
a.cc:34:26: error: 'ni' was not declared in this scope; did you mean 'n'?
   34 |          cout << b-a+2 + ni(0,b-a+2);
      |                          ^~
      |                          n
a.cc:39:24: error: 'ni' was not declared in this scope; did you mean 'n'?
   39 |          cout << n-b + ni(a+n-b,0);
      |                        ^~
      |                        n
a.cc:41:27: error: 'ni' was not declared in this scope; did you mean 'n'?
   41 |           cout << n-b+2 + ni(a+n-b+1,0);
      |                           ^~
      |                           n
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	int N;
	int A, B;
	int M = 0;

	scanf_s("%d %d %d", &N, &A, &B);

	if (A % 2 == 0 && B % 2 == 0) {
		M = (B - A) / 2;
	}
	else if (A % 2 == 0 && B % 2 == 1) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 0) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 1) {
		M = (B - A) / 2;
	}
	printf("%d", M);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d %d %d", &N, &A, &B);
      |         ^~~~~~~
      |         scanf
Language: C++

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

long long int key(kong long int a,long long int b,long long int n){

  if(a - 1 <= n - b)
    return a;
  else if(a - 1 > n - b)
    return b;

}

long long int ni(long long int a,long long int b){
   long long int k=(max(a,b)-min(a,b))/2;
    return k;  
}

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

Compiler output:
a.cc:4:19: error: 'kong' was not declared in this scope; did you mean 'long'?
    4 | long long int key(kong long int a,long long int b,long long int n){
      |                   ^~~~
      |                   long
a.cc:4:35: error: expected primary-expression before 'long'
    4 | long long int key(kong long int a,long long int b,long long int n){
      |                                   ^~~~
a.cc:4:51: error: expected primary-expression before 'long'
    4 | long long int key(kong long int a,long long int b,long long int n){
      |                                                   ^~~~
a.cc:4:66: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | long long int key(kong long int a,long long int b,long long int n){
      |                                                                  ^
a.cc: In function 'int main()':
a.cc:28:25: error: 'key' cannot be used as a function
   28 |    long long int c = key(a,b,n);
      |                      ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>

unsigned long long getEdgeResult(unsigned long long N, unsigned long long A, unsigned long long B);

using namespace std;

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

  unsigned long long result;

  unsigned long long diff = B - A;
  if (diff % 2 == 0) {
    result = min(diff / 2, getEdgeResult(N, A, B));
  } else {
    result = getEdgeResult(N, A, B);
  }#include < bits / stdc++.h >

    unsigned long long
  getEdgeResult(unsigned long long
  N, unsigned long long
  A, unsigned long long
  B);

  using namespace std;

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

    unsigned long long result;

    unsigned long long diff = B - A;
    if (diff % 2 == 0) {
      result = min(diff / 2, getEdgeResult(N, A, B));
    } else {
      result = getEdgeResult(N, A, B);
    }

    cout << result << endl;

    return 0;
  }

  unsigned long long getEdgeResult(unsigned long long N, unsigned long long A, unsigned long long B) {
    unsigned long long result;
    unsigned long long distToEdge1A = A - 1;
    unsigned long long distToEdgeNB = N - B;

    if (distToEdge1A <= distToEdgeNB) {
      unsigned long long distToEdge1B = B - 1;
      result = distToEdge1B;
    } else {
      unsigned long long distToEdgeNA = N - A;
      result = distToEdgeNA;
    }
    return result;
  }


  cout << result << endl;

  return 0;
}

unsigned long long getEdgeResult(unsigned long long N, unsigned long long A, unsigned long long B) {
  return min(B - 1, N - A);
}


Compiler output:
a.cc:18:4: error: stray '#' in program
   18 |   }#include < bits / stdc++.h >
      |    ^
a.cc: In function 'int main()':
a.cc:18:5: error: 'include' was not declared in this scope
   18 |   }#include < bits / stdc++.h >
      |     ^~~~~~~
a.cc:18:15: error: 'bits' was not declared in this scope
   18 |   }#include < bits / stdc++.h >
      |               ^~~~
a.cc:18:22: error: 'stdc' was not declared in this scope; did you mean 'std'?
   18 |   }#include < bits / stdc++.h >
      |                      ^~~~
      |                      std
a.cc:20:5: error: expected primary-expression before 'unsigned'
   20 |     unsigned long long
      |     ^~~~~~~~
a.cc:28:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   28 |   int main() {
      |           ^~
a.cc:28:11: note: remove parentheses to default-initialize a variable
   28 |   int main() {
      |           ^~
      |           --
a.cc:28:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:28:14: error: a function-definition is not allowed here before '{' token
   28 |   int main() {
      |              ^
a.cc:46:102: error: a function-definition is not allowed here before '{' token
   46 |   unsigned long long getEdgeResult(unsigned long long N, unsigned long long A, unsigned long long B) {
      |                                                                                                      ^
Language: Java

import java.util.stream.LongStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

public class HelloWorld{

    public static void main(String args[]) throws Exception {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          String line = br.readLine();
          int N = Integer.parseInt(line);
          ArrayList<Integer> inputs = new ArrayList<Integer>();
          for (int i = 0; i < N; i++) {
              inputs.add(Integer.valueOf(br.readLine()));
          }
          ArrayList<BigInteger> outputs = new ArrayList<BigInteger>();
          for(Integer input : inputs){
              outputs.add(factorial(input));
          }
          for(BigInteger result: outputs){
              System.out.println(result);
          }
     }

     private static BigInteger factorial(Integer input) {
          if(input == 1) return BigInteger.ONE;
          return factorial(input - 1).multiply(new BigInteger(String.valueOf(input)));
     }
}

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

/*input

*/


//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define pb          push_back
#define pii         pair<ll int,ll int>
#define vpii        vector< pii >
#define vi          vector<ll int>
#define vs			vector< string >
#define vvi         vector< vector< ll > >
#define inf			(ll)1e18
#define all(it,a)   for(auto it=(a).begin();it!=(a).end();it++) 
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define repr(i,a,b) for(ll int i=a;i>b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define whatis(x)   cout << #x << " is " << x << "\n";
#define graph(n)    adj(n,vector< ll > () )
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


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

int main()
{
	auto start = chrono::high_resolution_clock::now();

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll test_cases=1;
	//cin>>test_cases;
	while(test_cases--)
		solve();

	auto stop = chrono::high_resolution_clock::now();
	auto duration = chrono::duration_cast<chrono::milliseconds>(stop-start);
	// cout<<"\nduration: "<<(double)duration.count()<<" milliseconds";
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:34:25: error: expected ';' before 'long'
   34 |         ll a,b;cin>>a>>b
      |                         ^
      |                         ;
a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |                 ans+=min(a-1,n-b);
      |                 ^~~
      |                 abs
a.cc:41:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |         else ans+=(b-a)/2;
      |              ^~~
      |              abs
a.cc:42:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |         cout<<ans<<"\n";
      |               ^~~
      |               abs
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	long int N;
	int A, B;
	int M = 0;

	scanf_s("%d%d%d", &N, &A, &B);

	if (A % 2 == 0 && B % 2 == 0) {
		M = (B - A) / 2;
	}
	else if (A % 2 == 0 && B % 2 == 1) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 0) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 1) {
		M = (B - A) / 2;
	}
	printf("%d", M);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d%d%d", &N, &A, &B);
      |         ^~~~~~~
      |         scanf
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'long'
    8 |     long long c=(b-a)/2;
      |     ^~~~
a.cc:12:17: error: 'c' was not declared in this scope
   12 |         cout << c << endl;
      |                 ^
Language: C++

#code
import math
n,a,b = input().split()
n=int(n)
a=int(a)
b=int(b)
if a==b:
    print(0)
else:

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


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #code
    1 | #code
      |  ^~~~
a.cc:2:1: error: 'import' does not name a type
    2 | import math
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
int main()  {
  long long n, a, b;
  cin >> n >> a >> b;
  cout << (b - a + 1) / 2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> n >> a >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout << (b - a + 1) / 2;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++


if __name__ == "__main__":
    n, a, b = input().split()
    
    n = int(n)
    a = int(a)
    b = int(b)
    num_round = 0
    num1 = 0

    if (abs(a - b) == 0):
        print(num_round)
    elif (abs(a - b) % 2 == 0):
        average = int((a + b) / 2)
        num_round = abs(a - average)
        print(num_round)
    else:
        num1 = n - b
        if (num1 < a):
            print(n - a)
        else:
            print(b - 1)a


Compiler output:
a.cc:2:1: error: expected unqualified-id before 'if'
    2 | if __name__ == "__main__":
      | ^~
Language: C++

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

ll MAX_N=100000000000000000-1;
int main(){
  ll n,a,b;
  ll ans;
  ll dif = MAXN;
  cin>>n>>a>>b;
  if(a<b)swap(a,b);
  ll d = a-b;
  if(d % 2 == 0){
      dif = (d/2);
  }else{
      ll aa,bb;
      ll difan = n-a;
      aa = n;
      bb = b+difan+1;
      ll dif2 =  (aa-bb)/2;
      difan +=dif2+1;

      ll aa2,bb2;
      ll difb0 = b;
      aa2 = a-b-1;
      ll dif3 = aa2/2 + difb0;
      difb0 += dif3+1;

      ans= min(difan,difb0);
   }
   ans = min(ans,dif);
 cout<< ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'MAXN' was not declared in this scope; did you mean 'MAX_N'?
    9 |   ll dif = MAXN;
      |            ^~~~
      |            MAX_N
Language: C++

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

ll MAX_N=10**18-1;
int main(){
  ll n,a,b;
  ll ans;
  ll dif = MAXN;
  cin>>n>>a>>b;
  if(a<b)swap(a,b);
  ll d = a-b;
  if(d % 2 == 0){
      dif = (d/2);
  }else{
      ll aa,bb;
      ll difan = n-a;
      aa = n;
      bb = b+difan+1;
      ll dif2 =  (aa-bb)/2;
      difan +=dif2+1;

      ll aa2,bb2;
      ll difb0 = b;
      aa2 = a-b-1;
      ll dif3 = aa2/2 + difb0;
      difb0 += dif3+1;

      ans= min(difan,difb0);
   }
   ans = min(ans,dif);
 cout<< ans<<endl;
}


Compiler output:
a.cc:5:13: error: invalid type argument of unary '*' (have 'int')
    5 | ll MAX_N=10**18-1;
      |             ^~~
a.cc: In function 'int main()':
a.cc:9:12: error: 'MAXN' was not declared in this scope; did you mean 'MAX_N'?
    9 |   ll dif = MAXN;
      |            ^~~~
      |            MAX_N
Language: C++

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


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

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	long int N;
	int A, B;
	int M = 0;

	scanf_s("%d %d %d", &N, &A, &B);

	if (A % 2 == 0 && B % 2 == 0) {
		M = (B - A) / 2;
	}
	else if (A % 2 == 0 && B % 2 == 1) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 0) {
		if (A < N - B) {
			M = N - B;
		}
		else {
			M = A;
		}
	}
	else if (A % 2 == 1 && B % 2 == 1) {
		M = (B - A) / 2;
	}
	printf("%d", M);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d %d %d", &N, &A, &B);
      |         ^~~~~~~
      |         scanf
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |         cout<a-b-1<<endl;
      |              ~~~~~^~~~~~
a.cc:37:19: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   37 |         cout<a-b-1<<endl;
      |              ~~~~~^~~~~~