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

#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>A(N);
  for(int i=0;i<3;i++)
    cin>>A.at(i);
  sort(A.begin(),A.end());
  int x=A.at(2)-A.at(0);
  if(x%2==0)
    cout<<x/2<<endl;
  else
    cout<<(x/2)+2<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'N' was not declared in this scope
    4 | vector<int>A(N);
      |              ^
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  vector<int> a(3);
  for(int i=0;i<3;i++){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  if((a[2]-a[1])%2==0%%(a[2]-a[0])%2==0){
    cout << (2*a[2]-a[1]-a[0])/2 << endl;
  }
  else if((a[2]-a[1])%2==1&&(a[2]-a[0])%2==1){
    cout << (2*a[2]-a[1]-a[0])/2 << endl;
  }
  else
    cout << (2*a[2]-a[0]-a[1]+1)/2+1 << endl;
}

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

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int sum=A+B+C,large=max({A,B,C}),small=min({A,B,C}),middle=sum-large-small;
  int cnt=0;
  if((large*2-middle-small)%2==0) {
    cout << (3*large-sum)/2 << endl;
  }
  else {
    cout << 3*(large+1)-middle-small)/2 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: expected ';' before ')' token
   13 |     cout << 3*(large+1)-middle-small)/2 << endl;
      |                                     ^
      |                                     ;
Language: C++

#include<bits/stdc++.h>                          
using namespace std;
int a,b,c,ans,x,y,s;
int main(){
	cin>>a>>b>>c;
	x=min(a,min(b,c))
	s=max(a,max(b,c));
	y=a+b+c-x-s;
	ans+=s-y;
	x+=y;
	ans+=(s-x+1)/2;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected ';' before 's'
    6 |         x=min(a,min(b,c))
      |                          ^
      |                          ;
    7 |         s=max(a,max(b,c));
      |         ~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
ll a[1000000+9]= {0};
using namespace std;
int main ()
{
    ll i,j,p;
    for(i=0; i<3; i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a,a+3);
    s = 2*a[2];
    s-=a[0];
    s-=a[1];
    if (s%2==0)
    {
        p=0;
    }
    else
    {
        p=2;
    }
    p+=(s/2);
    cout<<p<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 's' was not declared in this scope
   11 |         s+=a[i];
      |         ^
a.cc:14:5: error: 's' was not declared in this scope
   14 |     s = 2*a[2];
      |     ^
Language: C++

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

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  int D = max(A,max(B,C));
  int E = 3 * D - A - B - C;
  cout << (E % 2 == 0 && E / 2 : (E + 3) / 2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: expected ')' before ':' token
    9 |   cout << (E % 2 == 0 && E / 2 : (E + 3) / 2) << endl;
      |           ~                   ^~
      |                               )
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  int A, B, C; cin >> A >> B >> C;
  int D = max(A, B, C);

  if ((A + B + C) % 2 == 1) {
    if (D % 2 == 1) {
      cout << (D*3 - A - B - C) / 2 << endl;
    } else {
      cout << ((D+1)*3 - A - B - C) / 2 << endl;
    }
  } else {
    if (D % 2 == 0) {
      cout << (D*3 - A - B - C) / 2 << endl;
    } else {
      cout << ((D+1)*3 - A - B - C) / 2 << endl;
    }
  }

  return 0;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:14:   required from here
    7 |   int D = max(A, B, C);
      |           ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define ll long long 
int main()

{
	int a[5];
	scanf("%d %d %d",&a[0],&a[1],&a[2]);
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<i;j++)
		{
			if(a[i]>a[j])
				swap(a[i],a[j]);
		}
	}
	if(a[0]==a[1]&&a[0]==a[2])
		puts("0");
	else
	{
		int cnt=0;
		int x=a[0]-a[1];
		int y=a[0]-a[2];
		while(x!=0)
		{
			if(x>=2)
			{
				cnt++;
				x=x-2;
			}
			else if(y!=0)
			{
				x--;
				y--;
				cnt++;
			}
			else
				break;
		}
		while(y!=0)
		{
			if(y>=2)
			{
				cnt++;
				y=y-2;
			}
			else
				break;
		}
		if((x==0&&y==1)||(x==1&&y==0))
			cnt=cnt+2;
		printf("%d\n",cnt);
	return 0;
}


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

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int X;
  X = max(max(A, B), C);
  if ((3 * X - A - B - C) % 2 == 0) {
    cout << (3 * X - A - B - C) / 2 << endl;
  }
  else {
    cout << (3 * X + 3 - A - B - C) / 2 << endl;
  }
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> A >> B >> C;
      |   ^~~
a.cc:8:11: error: 'max' was not declared in this scope
    8 |   X = max(max(A, B), C);
      |           ^~~
a.cc:8:7: error: 'max' was not declared in this scope
    8 |   X = max(max(A, B), C);
      |       ^~~
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << (3 * X - A - B - C) / 2 << endl;
      |     ^~~~
a.cc:10:40: error: 'endl' was not declared in this scope
   10 |     cout << (3 * X - A - B - C) / 2 << endl;
      |                                        ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << (3 * X + 3 - A - B - C) / 2 << endl;
      |     ^~~~
a.cc:13:44: error: 'endl' was not declared in this scope
   13 |     cout << (3 * X + 3 - A - B - C) / 2 << endl;
      |                                            ^~~~
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() {
	int a, b, c;
	cin >> a >> b >> c;
	int big = max{ (a,b,c) };
	int as = big - a;
	int bs = big - b;
	int cs = big - c;
	if (a == big) {
		if (bs % 2 == cs % 2) {
			int bigger = max(bs, cs);
			int smaller = min(bs, cs);
			int ans = smaller + (bigger - smaller) / 2;
			cout << ans << endl;
		}
		else {
			int bigger = max(bs, cs);
			int smaller = min(bs, cs);
			int ans = smaller + (bigger - smaller) / 2 + 2;
			cout << ans << endl;
		}
	}
	if (b == big) {
		if (as % 2 == cs % 2) {
			int bigger = max(as, cs);
			int smaller = min(as, cs);
			int ans = smaller + (bigger - smaller) / 2;
			cout << ans << endl;
		}
		else {
			int bigger = max(as, cs);
			int smaller = min(as, cs);
			int ans = smaller + (bigger - smaller) / 2 + 2;
			cout << ans << endl;
		}
	}
	if (c == big) {
		if (bs % 2 == as % 2) {
			int bigger = max(bs, as);
			int smaller = min(bs, as);
			int ans = smaller + (bigger - smaller) / 2;
			cout << ans << endl;
		}
		else {
			int bigger = max(bs, as);
			int smaller = min(bs, as);
			int ans = smaller + (bigger - smaller) / 2 + 2;
			cout << ans << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
   12 |         int big = max{ (a,b,c) };
      |                   ^~~
Language: C

#include<stdio.h>
#include<string.h>


int main(){
  int a,b,c,max;
  scanf("%d %d %d",&a,&b,&c);
  
  if(a>=b && a>=c){
    max = a;
    mx = b;
    my = c;
    k=(a-b)+(a-c);
  }
  else if(b>=a && b>=c){
    max = b;
    mx = a;
    my =c;
    k=(b-a)+(b-c);
  }
  else{
    max = c;
    mx = a;
    my = b;
    k=(c-a)+(c-b);
  }
  
  if(k%2 == 0){
    ans = k/2;
    printf("%d",ans);
    return 0;
  }
  
  else{
    while(max == mx || max == my){
      mx = mx + 1;
      my = my + 1;
      ans = ans + 1;
    }
    
    while(max>mx+2){
      mx = mx + 2;
      ans = ans + 1;
    }
    
    while(max>my+2){
      my = my + 2;
      ans = ans + 1;
    } 
  }
    printf("%d",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:5: error: 'mx' undeclared (first use in this function); did you mean 'max'?
   11 |     mx = b;
      |     ^~
      |     max
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: 'my' undeclared (first use in this function)
   12 |     my = c;
      |     ^~
main.c:13:5: error: 'k' undeclared (first use in this function)
   13 |     k=(a-b)+(a-c);
      |     ^
main.c:29:5: error: 'ans' undeclared (first use in this function)
   29 |     ans = k/2;
      |     ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;

//ここから書き始める

int main()
{
	cout << setprecision(10);
	vector<int> a(3);
	rep(i,3) cin >> a[i];
	SORT(a);
	ll ans1 = 0;
	int judge = 0;
	if(a[2] - a[1] == 1) judge = 1;
	if(a[1]-a[0]==1 && ){
		a[1]++;
		a[2]++;
	}
	ans += (a[1] - a[0])/2;
	ans += a[2]-a[1];
	cout << ans - judge  << endl;
}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:17:32: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:18:30: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: In function 'int main()':
a.cc:33:28: error: expected primary-expression before ')' token
   33 |         if(a[1]-a[0]==1 && ){
      |                            ^
a.cc:37:9: error: 'ans' was not declared in this scope; did you mean 'ans1'?
   37 |         ans += (a[1] - a[0])/2;
      |         ^~~
      |         ans1
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int cnt;
  vector<int> v(3);
  rep(i,3) cin>>v[i];
  sort(v.begin(),v.end());
  cnt=v[2]*2-v[0]-v[1];
  if(cnt%2==0) cout<<cnt/2<<endl;
  else cout<<cnt/2+2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,3) cin>>v[i];
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,3) cin>>v[i];
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int cnt;
  vector<int> v(3);
  rep(i,3) cin>>v[i];
  sort(v.begin(),v.end());
  count=v[2]*2-v[0]-v[1];
  if(cnt%2==0) cout<<cnt/2<<endl;
  else cout<<cnt/2+2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,3) cin>>v[i];
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,3) cin>>v[i];
      |   ^~~
a.cc:8:24: error: overloaded function with no contextual type information
    8 |   count=v[2]*2-v[0]-v[1];
      |                        ^
Language: Java

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

int main() {
  vector<int> vec(3);
  for(int i = 0; i < 3; i++){
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  int count = 0;
  count = vec[2] - vec[1];
  vec[1] = vec[2];
  vec[0] += count;
  if((vec[1] - vec[0]) % 2 == 0){
    count += (vec[1] - vec[0])/2;
    cout << count <<endl;
  }
  else{
    count += (vec[1] - vec[0])/2 +2;
    cout << count <<endl;
  }
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:7: error: not a statement
    cin >> vec[i];
        ^
Main.java:17: error: not a statement
    cout << count <<endl;
                  ^
Main.java:21: error: not a statement
    cout << count <<endl;
                  ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: ';' expected
  vector<int> vec(3);
                 ^
7 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
  public static void main(String args[]){
  int vec[] = new int[3];
  Scanner scan = new Scanner(System.in);
  vec[0] = scan.nextInt();
  vec[1] = scan.nextInt();
  vec[2] = scan.nextInt();
  scan.close();
  Arrays.sort(vec, Collections.reverseOrder());
  int count = 0;
  count = vec[0] - vec[1];
  vec[1] = vec[0];
  vec[2] += count;
  if((vec[1] - vec[2]) % 2 == 0){
    count += (vec[1] - vec[2])/2;
    System.out.println(count);
  }
  else{
    count += (vec[1] - vec[2])/2 +2;
    System.out.println(count);
  }
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
  Arrays.sort(vec, Collections.reverseOrder());
                   ^
  symbol:   variable Collections
  location: class Main
1 error
Language: Java

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

int main() {
  vector<int> vec(3);
  for(int i = 0; i < 3; i++){
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  int count = 0;
  count = vec[0] - vec[1];
  vec[1] = vec[0];
  vec[2] += count;
  if((vec[1] - vec[2]) % 2 == 0){
    count += (vec[1] - vec[2])/2;
    cout << count <<endl;
  }
  else{
    count += (vec[1] - vec[2])/2 +2;
    cout << count <<endl;
  }
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:7: error: not a statement
    cin >> vec[i];
        ^
Main.java:17: error: not a statement
    cout << count <<endl;
                  ^
Main.java:21: error: not a statement
    cout << count <<endl;
                  ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: ';' expected
  vector<int> vec(3);
                 ^
7 errors
Language: C++

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

int main(){
  int a,b,c;cin >> a >> b >> c;
  int ma = max({a,b,c}),sum = a+b+c;
  if((3*ma-sum)%2)==0) cout << (3*ma-sum)/2 << endl;
  else cout << ((3*ma-sum)/2)+2 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: expected primary-expression before '==' token
   17 |   if((3*ma-sum)%2)==0) cout << (3*ma-sum)/2 << endl;
      |                   ^~
Language: C++

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

int main(){
    int a,b,c; cin>>a>>b>>c;

    int ma = max(a,b),sum = a+b+c;

    ma = max(ma,c);

    int mi = min(a,c);

    mi = min(c,mi); 

    if( (3*ma - sum) % 2 == 0) cout<<( (3*ma-sum)/2 )<<endl;

    else cout<<(3*ma-sum - mi)<<endl;

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

int main(){
    int a,b,c; cin>>a>>b>>c;

    int ma = max(a,b),sum = a+b+c;

    ma = max(ma,c);

    int mi = min(a,c);

    mi = min(c,mi); 

    if( (3*ma - sum) % 2 == 0) cout<<( (3*ma-sum)/2 )<<endl;

    else cout<<(3*ma-sum - mi)<<endl;

    return 0;
}

Compiler output:
a.cc:20:2: error: stray '#' in program
   20 | }#include <bits/stdc++.h>
      |  ^
a.cc:20:3: error: 'include' does not name a type
   20 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

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

int main() {
  vector<int> a(3);
  cin >> a.at(0) >> a.at(1) >> a.at(2);
  sort<a.begin(),a.end());
  int ans=0,k=0;
  ans += (a.at(2)-a.at(1))/2;
  a.at(1) += ans*2;
  if(a.at(2)-a.at(1) == 1){
    ans++;
    a.at(1)++;
    a.at(0)++;
  }
  if((a.at(2) - a.at(0))%2 == 0){
    ans += (a.at(2)-a.at(0))/2;
  }
  else {
    ans += (a.at(2) -a.at(0)+1)/2 +1;
  }
  
  cout << ans << endl;
  
  return 0;
}

    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
    7 |   sort<a.begin(),a.end());
      |        ~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:873:7: note: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]' declared here
  873 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:7:23: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
    7 |   sort<a.begin(),a.end());
      |                  ~~~~~^~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]' declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:7:3: error: parse error in template argument list
    7 |   sort<a.begin(),a.end());
      |   ^~~~~~~~~~~~~~~~~~~~~~
a.cc:7:25: error: expected ';' before ')' token
    7 |   sort<a.begin(),a.end());
      |                         ^
      |                         ;
a.cc:7:3: error: statement cannot resolve address of overloaded function
    7 |   sort<a.begin(),a.end());
      |   ^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std; // consider removing this line in serious projects
 
int main() {
	int a, b, c,P, l;
      cin>>a>>b>>c;
   if(a! =b || c! =b) 
{
a++;
c++;
l++;

} 
if(a==b && c! =b) 
{
c=c+2;
l++;
} 
if(c==b && a! =b) 
{
a=a+2;
l++;
}
     p=l;
cout<<p<<endl;
	}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected ')' before '!' token
    7 |    if(a! =b || c! =b)
      |      ~ ^
      |        )
a.cc:14:13: error: expected ')' before '!' token
   14 | if(a==b && c! =b)
      |   ~         ^
      |             )
a.cc:19:13: error: expected ')' before '!' token
   19 | if(c==b && a! =b)
      |   ~         ^
      |             )
a.cc:24:6: error: 'p' was not declared in this scope
   24 |      p=l;
      |      ^
Language: C++

#include <bits/stdc++. h>
using namespace std; // consider removing this line in serious projects
 
int main() {
	int a, b, c,p;
      cin>>a>>b>>c;
     p=b-a+b-(c+b-a) ;
cout<<p<<endl;
	}
	

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

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    int max = max(A,max(B,C));
    int sum = A + B + C;

    if(sum % 2 != max % 2){
        max++;
    }
cout << (3*max - sum)/2 << endl; 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: 'max' cannot be used as a function
    7 |     int max = max(A,max(B,C));
      |                     ~~~^~~~~
a.cc:7:29: error: 'max' cannot be used as a function
    7 |     int max = max(A,max(B,C));
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
typedef long long int Int;
#define INF 999999999
using ll = long long;
using VI = vector<int>;
int main(){
  int a,b,c;
  cin >> a >> b >> c;
  ll ans = 0;
  while(!(a==b&&b==c||ans%2==1){
    ans+=1;
    if(a<=b&&a<=c) a+=1;
    else if(b<=a&&b<=c) b+=1;
    else c+=1;
  }
  ans/=2;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before '{' token
   14 |   while(!(a==b&&b==c||ans%2==1){
      |        ~                       ^
      |                                )
Language: C++


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	vector<int> a(3);
	
	for (int i = 0; i < 3; i++) {
		cin >> a[i];
	}

	int ans = INF;

	bool f = true;

	for (int i = 0; i < 3; i++) {
		int x = a[i] % 2;
		int y = a[0] % 2;

		if (x != y) {
			f = false;
		}
	}

	if (f) {
		sort(a.begin(), a.end());
		int tmp = 0;
		for (int i = 0; i < 3; i++) {
			tmp += (a[2] - a[i]) / 2;
		}

		cout << tmp << endl;
		return 0;
	}

	int ans = INF;
	for (int i = 0; i < 3; i++) {
		for (int j = i+1; j < 3; j++) {
			int tmp = 1;
			vector<int> b;
			b = a;

			b[i]++;
			b[j]++;

			sort(b.begin(), b.end());
			bool f = true;
			for (int i = 0; i < 3; i++) {
				
				if ((b[2] % 2) != b[i] % 2) {
					f = false;
				}
				tmp += (b[2] - b[i]) / 2;

			}

			if (f) {
				ans = min(ans, tmp);
			}
			
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:102:13: error: redeclaration of 'int ans'
  102 |         int ans = INF;
      |             ^~~
a.cc:78:13: note: 'int ans' previously declared here
   78 |         int ans = INF;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int A, B, C;
    cin >> A >> B >> C;
    P = max({A, B, C});
    R = min({A, B, C});
    Q = A + B + C - P - R;
    
    if(Q%2==R%2) cout << (2*P-Q-R)/2 << endl;
    else {
        P++;
        Q++;
        cout << (2*P-Q-R)/2 + 1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'P' was not declared in this scope
    6 |     P = max({A, B, C});
      |     ^
a.cc:7:5: error: 'R' was not declared in this scope
    7 |     R = min({A, B, C});
      |     ^
a.cc:8:5: error: 'Q' was not declared in this scope
    8 |     Q = A + B + C - P - R;
      |     ^
Language: C++

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

int main(){
  int x[3];
  cin>>x[0] >>x[1] >>x[2];
  sort(x.begin(),x.end());
  int dif = 2*x[2]-x[0]-x[1];
  cout<<(dif%2==0 ? dif/2 : dif/2+3)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: request for member 'begin' in 'x', which is of non-class type 'int [3]'
    7 |   sort(x.begin(),x.end());
      |          ^~~~~
a.cc:7:20: error: request for member 'end' in 'x', which is of non-class type 'int [3]'
    7 |   sort(x.begin(),x.end());
      |                    ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int ans = 0;
  vector<int> V(3);
  for(int i = 0; i < 3; i++)cin >> V[i];
  sort(V.begin(), V.end());
  ans = (V[2] - V[1]) / 2 + (V[2] - V[0]) /2;
  V[1] += ((V[2] - V[1]) / 2) * 2;
  V[0] += ((V[2] - V[0]) / 2) * 2;
  if(V[1] == V[0] && V[2] == V[1]) cout << ans;
  else{
    if(V[2] != V[1] && V[2] != V[0]) cout << ans + 1;
    else cout << ans + 2;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(V.begin(), V.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans;
    
    int m = max(a, b, c);
    if(m % 2 == (a+b+c) % 2) {
        ans = (3*m - (a+b+c))/2;
    }
    else {
        ans = (3*(m+1) - (a+b+c))/2;
    }

    cout << ans;

    cout << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:16:16:   required from here
   16 |     int m = max(a, b, c);
      |             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans;
    
    int m = max(a, b, c);
    if(m % 2 == (a+b+c)) {
        ans = (3*m - (a+b+c))/2;
    }
    else {
        ans = (3*(m+1) - (a+b+c))/2;
    }

    cout << ans;

    cout << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:16:16:   required from here
   16 |     int m = max(a, b, c);
      |             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll a,b,c;
  	ci(a>>b>>c);
  // aに合わせる
  ll ans1=0;
  ll B=abs(a-b);
  ll C=abs(a-c);
  if(B%2==1){
    ans1+=(B-1)/2+1;
  }
  else{
    ans1+=B/2;
  }
  if(C%2==1){
	ans1+=(C-1)/2+1;
  }
  else{
    ans1+=C/2;
  }
  
  // bに合わせる
  ll ans2=0;
  ll AA=abs(a-b);
  ll CC=abs(b-c);
  if(AA%2==1){
    ans2+=(AA-1)/2+1;
  }
  else{
    ans2+=AA/2;
  }
  if(CC%2==1){
	ans2+=(CC-1)/2+1;
  }
  else{
    ans2+=CC/2;
  }
  
  // cに合わせる
  ll ans3=0;
  ll BBB=abs(c-b);
  ll AAA=abs(a-c);
  if(BBB%2==1){
    ans3+=(BBB-1)/2+1;
  }
  else{
    ans3+=BBB/2;
  }
  if(AAA%2==1){
	ans3+=(AAA-1)/2+1;
  }
  else{
    ans3+=AAA/2;
  }
  
  co(min({ans1,ans2,ans3})
     }

Compiler output:
a.cc:134:7: error: unterminated argument list invoking macro "co"
  134 |      }
      |       ^
a.cc: In function 'int main()':
a.cc:133:3: error: 'co' was not declared in this scope
  133 |   co(min({ans1,ans2,ans3})
      |   ^~
a.cc:133:5: error: expected '}' at end of input
  133 |   co(min({ans1,ans2,ans3})
      |     ^
a.cc:79:15: note: to match this '{'
   79 | signed main() {
      |               ^
Language: C++

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

vector<int>num(3)

int main() {
    cin >> num[0] >> num[1] >> num[2];
    sort(num.begin(), num.end());
    int res = 0;
    res += num[2] - num[1];
    num[0] += res; num[1] += res;
    if (num[0] % 2) res += num[0]/2+1;
    else res += num[0]/2;
    cout << res << endl;
}

Compiler output:
a.cc:6:1: error: expected ',' or ';' before 'int'
    6 | int main() {
      | ^~~
Language: C++

A, B, C = sorted(map(int, input().split()))
ans = C - B
A += C - B
if (C - A) % 2 == 0:
  ans += (C - A) // 2
else:
  ans += (C - A) // 2 + 2
print(ans)

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

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

int c(const void* a, const void* b) {
	return *(int*)a - *(int*)b;
}

int main() {
	int a[3];
	for (i = 0; i < 3; i++) scanf("%d", &a[i]);
	qsort(a, 3, sizeof(int), c);
	printf("%d", (2 * a[2] - a[1] - a[0] + 1) / 2 + (a[0] + a[1]) % 2);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: 'i' undeclared (first use in this function)
   12 |         for (i = 0; i < 3; i++) scanf("%d", &a[i]);
      |              ^
main.c:12:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int[] num = r.ii(),
        even = new int[3];
        Arrays.sort(num);
        for(int i = 0; i < 3; i++)
            if(num[i]%2 == 0)
                even[i] = 1;

        int total = even[0] + even[1] + even[2],
        ans = 0;
        if(total%3 > 0){
            ans++;
            for(int i = 0; i < 3; i++)
                if(even[i] == total%2)
                    num[i]--;
        }
        ans += num[2] - (num[0]+num[1])/2;
        print(ans);
    }

    static void print(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }

        String s() throws IOException{
            return readLine();
        }

        String[] ss() throws IOException{
            return s().split(" ");
        }

        int Int(String s){
            return Integer.parseInt(s);
        }

        int i() throws IOException{
            return Int(s());
        }

        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main{
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main{
      |              ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define MOD 1000000007

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}

//typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
//#define int long long

int a,b,c;

signed main()
{
   cin>>a>>b>>c;

    int s = a+b+c;
    int m= max({a,b,c});
    int m3 = m*3;

    int M;

    if((s%2) == (m3%2){
        M=m;
    }
    else{
        M=m+1;
    }

    int ans = 3*M-(a+b+c);
    ans/=2;

    cout <<ans<<endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:23: error: expected ';' before '{' token
   45 |     if((s%2) == (m3%2){
      |                       ^
      |                       ;
a.cc:48:5: error: expected primary-expression before 'else'
   48 |     else{
      |     ^~~~
a.cc:47:6: error: expected ')' before 'else'
   47 |     }
      |      ^
      |      )
   48 |     else{
      |     ~~~~
a.cc:45:7: note: to match this '('
   45 |     if((s%2) == (m3%2){
      |       ^
a.cc:53:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   53 |     ans/=2;
      |     ^~~
      |     abs
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}
int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    if(C > B) swap(C,B);
    if(B > A) swap(A,B);
    int N = A-B + A-C;
    //cout << N << endl;
    if(N%2) cout << (N+3)/2;
    else cout << N+/2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: expected primary-expression before '/' token
   31 |     else cout << N+/2;
      |                    ^
Language: C++

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

int main() {
  int d[3];
  cin >> d[0] >> d[1] >> d[2];
  sort(d, d+3);
  int t = d[1] - d[0];
  cout << d[2]-d[1]+t/2+(t%2)*2 << endl;
  return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before '}' token
   11 |   return 0
      |           ^
      |           ;
   12 | }
      | ~
Language: C++

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

int main() {
  int d[3];
  cin >> d[0] >> d[1] >> d[2];
  sort(d, d+3);
  int t = d[1] - d[0];
  cout << d[2]-d[1]+t/2+(d%2)*2 << endl;
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: invalid operands of types 'int [3]' and 'int' to binary 'operator%'
   10 |   cout << d[2]-d[1]+t/2+(d%2)*2 << endl;
      |                          ~^~
      |                          | |
      |                          | int
      |                          int [3]
a.cc:11:11: error: expected ';' before '}' token
   11 |   return 0
      |           ^
      |           ;
   12 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    int V[3];cin>>V[0]>>V[1]>>V[2];
    sort(V.begin(),V.end());
    int x=V[1]-V[0];
    if(x%2==0)cout<<x/2+V[2]-V[1]<<endl;
    else cout<<(x+3)/2+V[2]-V[1]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: request for member 'begin' in 'V', which is of non-class type 'int [3]'
    6 |     sort(V.begin(),V.end());
      |            ^~~~~
a.cc:6:22: error: request for member 'end' in 'V', which is of non-class type 'int [3]'
    6 |     sort(V.begin(),V.end());
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
#define HAIRETU(N,A) for(int i=0;i<N;i++) cin >>A[i]
using namespace std;

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    
    int sum = A + B + C;
    int cnt = 0;
    
    int M = max(A, B, C);
    
    if (sum % 2 == M % 2) {
        cnt = (3 * M - sum) / 2;
    } else cnt = (3 * (M + 1) - sum) / 2;
    
    
    cout << cnt << endl;
    // 下一桁は最後の一文字が表す数
//    cout << (a & b & 1 ? "Odd" : "Even") << endl;
    return 0;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:12:16:   required from here
   12 |     int M = max(A, B, C);
      |             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a[] = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
            total += a[i];
        }
        Arrays.sort(a);
        if(a[2]*3 % 2 == (a[2]-a[0]+a[2]-a[1])%2){
            System.out.println((a[2]-a[0]+a[2]-a[1])/2);
        }else{
            System.out.println((a[2]+1-a[0]+a[2]+1-a[1]-1)/2); 
        }
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
            total += a[i];
            ^
  symbol:   variable total
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<int> num(3);
  for(int i=0;i<3;i++){
    cin>>num.at(i);
  }
  sort(num.begin(),num.end());
  int count=0;
  if(num.at(0)==num.at(1)　&& num.at(1)==num.at(2)){
    count =0;
  }
  else if(num.at(0)==num.at(1) && num.at(1) < num.at(2) ){
    while(num.at(1) < num.at(2) ){
      num.at(1) ++;
      count ++;
    }
  }
  else if(num.at(2)==num.at(1) && num.at(0) < num.at(1)){
    if(num.at(2) %2 == num.at(0)%2){
      while(num.at(0) < num.at(2)){
        num.at(0) += 2;
        count ++;
      }
    }
    else{
      while(num.at(0) < num.at(2) ){
        num.at(0) += 2;
        count++;  
      }
      count ++;
    }
    
  }
  else{
    while(num.at(1) < num.at(2)){
      num.at(0)++;
      num.at(1)++;
      count++;
    }
    if(num.at(0) < num.at(1)){
      if(num.at(2) %2 == num.at(0)%2){
        while(num.at(0) < num.at(2)){
          num.at(0) += 2;
          count ++;
        }
      }
      else{
        while(num.at(0) < num.at(2) ){
          num.at(0) += 2;
          count++;  
        }
        count ++;
      }
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc:11:26: error: extended character 　 is not valid in an identifier
   11 |   if(num.at(0)==num.at(1)　&& num.at(1)==num.at(2)){
      |                          ^
a.cc: In function 'int main()':
a.cc:11:26: error: expected ')' before '\U00003000'
   11 |   if(num.at(0)==num.at(1)　&& num.at(1)==num.at(2)){
      |     ~                    ^~
      |                          )
Language: C++

#include <iostream>
#include<array>
using namespace std;
int main() {
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	int max = 0;
	if (3*a[2] % 2 == (a[0]+a[1]+a[2])%2) {
		 max = a[2];
	}
	else {
		max = a[2] + 1;
	}
	int ans = 0;
	for (int i = 0; i < 3; i++) {
		ans += max - a[i];
	}
	cout << ans/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |         sort(a, a + 3);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  int N = a + b + c;
  int minans = 10000;
  int ans = 10000;
  for(int i = 1; i <= 150; i++){
    int oddcounter = 0;
    if(i % 3 == 0 && N % 2 == i/3 % 2 && i / 3 >= max(a,max(b,c))){
      vector<int> d(3);
      d[0] = a - i/3;
      d[1] = b - i/3;
      d[2] = c - i/3;
      for(int j = 0; j < 3; j++){
        if(devidual % 2 == 1) oddcounter++;
      }
      if(oddcounter == 0){
        ans = d[0]/2 + d[1]/2 + d[2] /2;
      }else if(oddcounter == 1){
        continue;
      }else if(oddcounter == 2){
        ans = 1 + d[0] % 2 == 0 ? d[0] / 2 : (d[0] - 1) / 2 + d[1] % 2 == 0 ? d[1] / 2 : (d[1] - 1) / 2 + d[2] % 2 == 0 ? d[2] / 2 : (d[2] - 1) / 2;
      }else if(oddcounter == 3){
        continue;
      }
    }
    if(ans <= mixans) mixans = ans;
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'devidual' was not declared in this scope
   22 |         if(devidual % 2 == 1) oddcounter++;
      |            ^~~~~~~~
a.cc:34:15: error: 'mixans' was not declared in this scope; did you mean 'minans'?
   34 |     if(ans <= mixans) mixans = ans;
      |               ^~~~~~
      |               minans
Language: C++

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int sum=a+b+c;
  int n=max({a,b,c});
  if(n%2==sum%2){
    int goal=3*n;
  }
  else{
    int goal=3*n+3;
  }
  cout << (goal-a-b-c)/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'goal' was not declared in this scope
   16 |   cout << (goal-a-b-c)/2 << endl;
      |            ^~~~
Language: C++

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

int main(){
    int A, B, C, X, Y, ans; cin >> A >> B >> C;

    X=A+B+C;
    Y=max(A, B);
    Y=max(Y, C)
    if (X%2 == 1 ) {
        if (Y%2 == 1) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }
    else {
        if (Y%2 == 0) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before 'if'
    9 |     Y=max(Y, C)
      |                ^
      |                ;
   10 |     if (X%2 == 1 ) {
      |     ~~          
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else {
      |     ^~~~
Language: C++

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

int main(){
    int A, B, C, X, Y, ans; cin >> A >> B >> C;

    X=A+B+C;
    Y=max(A, B, C);
    if (X%2 == 1 ) {
        if (Y%2 == 1) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }
    else {
        if (Y%2 == 0) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:10:   required from here
    8 |     Y=max(A, B, C);
      |       ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main(){
    int A, B, C, X, Y, ans; cin >> A >> B >> C;

    X=A+B+C;
    Y=max(A, B, C);
    if (X%2 == 1 ) {
        if (Y%2 == 1) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }
    else {
        if (Y%2 == 0) cout << (3*Y-X)/2 << endl;
        else cout << (3*Y+3-X)/2 << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: expected '}' at end of input
   16 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:10:   required from here
    8 |     Y=max(A, B, C);
      |       ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~