criyle/codenet-compile-errors huggingface dataset:
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:5:23: error: expected unqualified-id before ',' token
    5 |     int A, B, C, X, Y,, ans; cin >> A >> B >> C;
      |                       ^
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))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
#define mp  std::make_pair
#define ll long long int
#define abs(n) ((n>0)?(n):((n)*(-1)))
#define CEIL(a,b) (((a) + ((b)-1)) / (b))
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
#define VREP_ll(v) for(std::vector<ll>::iterator itr = (v).begin(); itr != (v).end();itr++)
#define VREP_int(v) for(std::vector<int>::iterator itr = (v).begin(); itr != (v).end();itr++)
#define VALL(v) ((v).begin(),(v).end())
#define errln(v) cerr << (v) << endl;
#define println(v) cout << (v) << endl;

int dp[100][100][100];
#define UNDEF -1

int rec(int a,int b,int c){
	if(dp[a][b][c] != -1) return dp[a][b][c];

	int ret=1000000;

	if(a>=2 && rec(a-2,b,c) != -1) ret = min(ret,rec(a-2,b,c)+1);
	if(b>=2 && rec(a,b-2,c) != -1) ret = min(ret,rec(a,b-2,c)+1);
	if(c>=2 && rec(a,b,c-2) != -1) ret = min(ret,rec(a,b,c-2)+1);
	if(b>=1 && c >= 1 && rec(a,b-1,c-1) != -1) ret = min(ret,rec(a,b-1,c-1)+1);
	if(c>=1 && a >= 1 && rec(a-1,b,c-1) != -1) ret = min(ret,rec(a-1,b,c-1)+1);
	if(a>=1 && b >= 1 && rec(a-1,b-1,c) != -1) ret = min(ret,rec(a-1,b-1,c)+1);



	return dp[a][b][c]=ret;
}

int main(int argc, const char * argv[]) {
	int a,b,c;

	cin >> a >> b >> c;

	memset(dp,-1,sizeof dp);
	dp[a][b][c] = 0;
	for(int i = max(max(a,b),c);i <= 100; i++){
		if(rec(i,i,i) != 1000000){
			println((i*3-a-b-c)/2);
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:44:9: error: 'memset' was not declared in this scope
   44 |         memset(dp,-1,sizeof dp);
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <algorithm>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
using namespace std;

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

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

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

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

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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> x(3);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> x(3);
      |            ^~~
a.cc:9:16: error: 'x' was not declared in this scope
    9 |         cin >> x.at(i);
      |                ^
a.cc:11:10: error: 'x' was not declared in this scope
   11 |     sort(x.begin(),x.end());
      |          ^
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(x.begin(),x.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main(void) {
    // insert code here...
    int count = 0;
    int num[3];
    for(int i = 0; i < 3; i++){
        cin >> num[i];
    }
    
    sort(num, num + 3);
//    for(int i = 0; i < 3; i++){
//        cout << num[i] << endl;
//    }
    
    int a, b;
    
    a = num[2] - num[1];
    while(a > 0){
        num[0]++;
        num[1]++;
        a--;
        count++;
    }
    
    b = num[2] - num[0];
    
    while(b > 0){
        num[0]+=2;
        b-=2;
        count++;
    }
    
    if(b<0){
        count++;
    }
    
    cout << count << endl;
    
    return 0;
}


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

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

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

  int max = max(a, max(b, c));

  for(int i = max; i < 51; ++i) {
    int diff = i * 3 - a - b - c;
    if(diff % 2 == 0) {
      cout << diff / 2;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'max' cannot be used as a function
    9 |   int max = max(a, max(b, c));
      |                    ~~~^~~~~~
a.cc:9:29: error: 'max' cannot be used as a function
    9 |   int max = max(a, max(b, c));
      |                             ^
Language: C++

#include"pch.h"
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const int inf = 1000000007;
int a[3];
signed main() {
	cin >> a[0] >> a[1] >> a[2];
	int wa = a[0] + a[1] + a[2];
	sort(a, a + 3);
	int s, d, f, g;
	if ((a[2] * 3) % 2 == wa % 2) {
		s = (a[2] - a[1]) / 2;
		d = (a[2] - a[1]) % 2;
		f = (a[2] - a[0]) / 2;
		g = (a[2] - a[0]) % 2;
		cout << s + f + max(d,g) << endl;
	}
	else {
		s = (a[2]+1 - a[1]) / 2;
		d = (a[2]+1 - a[1]) % 2;
		f = (a[2]+1 - a[0]) / 2;
		g = (a[2] - a[0]) % 2;
		cout << s + f + max(d, g) << endl;
	}
}


Compiler output:
a.cc:1:9: fatal error: pch.h: No such file or directory
    1 | #include"pch.h"
      |         ^~~~~~~
compilation terminated.
Language: C++

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

int main(){
    int ans=0,D;
    vector<int> a(3);
    for (int i=0; i<3; i++){
        cin >> a.at(i); 
    }
    if(a.at(1)<a.at(2)){
        D=a.at(1);
        a.at(1)=a.at(2);
        a.at(2)=D;
    }
    if(a.at(0)<a.at(1)){
        D=a.at(0);
        a.at(0)=a.at(1);
        a.at(1)=D;
    }
    if((a.at(1)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
    else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:52: error: expected ';' before 'cout'
   23 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                                    ^
      |                                                    ;
   24 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main(){
    int ans=0,D;
    vector<int> a(3);
    for (int i=0; i<3; i++){
        cin >> a.at(i); 
    }
    if(a.at(1)<a.at(2)){
        D=a.at(1);
        a.at(1)=a.at(2);
        a.at(2)=D;
    }
    if(a.at(0)<a.at(1)){
        D=a.at(0);
        a.at(0)=a.at(1);
        a.at(1)=D;
    }
    if((a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
    else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:52: error: expected ';' before 'cout'
   23 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                                    ^
      |                                                    ;
   24 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main(){
    int ans=0,D;
    vector<int> a(3);
    for (int i=0; i<3; i++){
        cin >> a.at(i); 
    }
    if(a.at(1)<a.at(2)){
        D=a.at(1);
        a.at(1)=a.at(2);
        a.at(2)=D;
    }
    if(a.at(0)<a.at(1)){
        D=a.at(0);
        a.at(0)=a.at(1);
        a.at(1)=D;
    }
    if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
    else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: expected primary-expression before '%' token
   22 |     if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
      |                        ^
a.cc:23:52: error: expected ';' before 'cout'
   23 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                                    ^
      |                                                    ;
   24 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main(){
    int ans=0,D;
    vector<int> a(3);
    for (int i=0; i<3; i++){
        cin >> a.at(i); 
    }
    if(a.at(1)<a.at(2)){
        D=a.at(1);
        a.at(1)=a.at(2);
        a.at(2)=D
    }
    if(a.at(0)<a.at(1)){
        D=a.at(0);
        a.at(0)=a.at(1);
        a.at(1)=D
    }
    if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
    else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before '}' token
   15 |         a.at(2)=D
      |                  ^
      |                  ;
   16 |     }
      |     ~             
a.cc:20:18: error: expected ';' before '}' token
   20 |         a.at(1)=D
      |                  ^
      |                  ;
   21 |     }
      |     ~             
a.cc:22:24: error: expected primary-expression before '%' token
   22 |     if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
      |                        ^
a.cc:23:52: error: expected ';' before 'cout'
   23 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                                    ^
      |                                                    ;
   24 |     cout << ans << endl;
      |     ~~~~
Language: C++

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

int main(){
    int a[3],ans;
    for (int i=0; i<3; ++i) cin >> a[i];
    ans=0;
    sort (a,a+3,greater<int>());
    if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
    else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   11 |     if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
      |          ^~
a.cc:11:18: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   11 |     if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
      |                  ^~
a.cc:11:24: error: expected primary-expression before '%' token
   11 |     if(a.at(0)-a.at(2))%2==0)  ans=a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2;
      |                        ^
a.cc:12:17: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   12 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                 ^~
a.cc:12:25: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   12 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                         ^~
a.cc:12:34: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   12 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                  ^~
a.cc:12:42: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
   12 |     else ans= a.at(0)-a.at(1)+(a.at(1)-a.at(2))/2+2
      |                                          ^~
Language: C++

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int max_n = max(a, b, c);
  int sum = a + b + c;
  int x = (max_n - a) + (max_n - b) + (max_n - c);
  if (x % 2 == 0) {
    cout << x / 2 << endl;
  } else {
    cout << x / 2 + 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:18:   required from here
    8 |   int max_n = 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 <cstdlib>
#include <cstdio>

using namespace std;

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

  sort(x, x + 3);
  int da, db;
  da = x[2] - x[0];
  db = x[2] - x[1];
  int res;
  if (da % 2 == 0 and db % 2 == 0) {
    res = da / 2 + db / 2;
  } else if (da % 2 == 1 and db % 2 == 1) {
    res = 1 + (da - 1) / 2 + (db - 1) / 2;
  } else if (da % 2 == 0 and db % 2 == 1) {
    res = 1 + da / 2 + (db + 1) / 2;
  } else if (da % 2 == 1 and db % 2 == 0) {
    res = 1 + (da + 1) / 2 + db / 2;
  }
  cout << res << endl;
  return EXIT_SUCCESS;
}



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

#include <bits/stdc++.h>

#define REP(i, s,  n) for(int i = s;i < (n);i++)
#define VSORT(v) sort(v.begin(), v.end());
#define int64 long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

signed main(){
	cin >> A >> B >> C;

	int t = A + B + C;
	int m = max(A, max(B, C));
	if((t % 2) != (m % 2)) {
		m = m + 1;
	}
	int ans = (m * 3 - t) / 2;

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'A' was not declared in this scope
   11 |         cin >> A >> B >> C;
      |                ^
a.cc:11:21: error: 'B' was not declared in this scope
   11 |         cin >> A >> B >> C;
      |                     ^
a.cc:11:26: error: 'C' was not declared in this scope
   11 |         cin >> A >> B >> C;
      |                          ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

using namespace std;

int main()
{
  int v[3];
  int A, B, C;
  cin >> v[0] >> v[1] >> v[2];
  
  sort(&v[0], v[3]);

  int increment=0;
  int a = v[2] - v[0];
  int count = a / 2;
  if(a%2 == 1) ++increment;
  a = v[2] - v[1];
  count += a / 2;
  if(a%2 == 1) ++increment;
  
  if(increment == 1) {
    count += 2;
  } else if(increment == 2) {
    count += 1;
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: no matching function for call to 'sort(int*, int&)'
   16 |   sort(&v[0], v[3]);
      |   ~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:16:7: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   16 |   sort(&v[0], v[3]);
      |   ~~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

using namespace std;

int main()
{
  int v[3];
  int A, B, C;
  cin >> v[0] >> v[1] >> v[2];
  
  sort(v, v[3]);

  int increment=0;
  int a = v[2] - v[0];
  int count = a / 2;
  if(a%2 == 1) ++increment;
  a = v[2] - v[1];
  count += a / 2;
  if(a%2 == 1) ++increment;
  
  if(increment == 1) {
    count += 2;
  } else if(increment == 2) {
    count += 1;
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: no matching function for call to 'sort(int [3], int&)'
   16 |   sort(v, v[3]);
      |   ~~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:16:7: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   16 |   sort(v, v[3]);
      |   ~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main() {
    int A,B,C;
    cin >> A >> B >> C;
    int ma,mid,mi;
    ma=max(A,max(B,C));
    mi=min(A,min(B,C));
    mid=A+B+C-ma-mi;

    if((ma-mi)%2==(ma-mid)%2){
        cout << (2*ma-mid-mi)/2 << endl;
        return 0;
    }else {
        cout << (2*ma-mid-mi+3)/2 << endl;
        return 0;
    }
}

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<iostream>
#include<vector>

using namespace std;

int main(void){
  vector<int> a(3);
  cin>>a[0]>>a[1]>>a[2];
  sort(a.begin(),a.end());
  int ans=0;
  while(a[1]!=a[2]){
    a[0]++;
    a[1]++;
    ans++;
  }
  int dis;
  if (a[0]!=a[1]){
    dis=a[2]-a[0];
    if (dis%2==0){
      ans+=dis/2;
    }
    else {
      ans+=1+dis/2;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

#include<iostream>
#include<vector>

int main(void){
  vector<int> a(3);
  cin>>a[0]>>a[1]>>a[2];
  sort(a.begin(),a.end());
  int ans=0;
  while(a[1]!=a[2]){
    a[0]++;
    a[1]++;
    ans++;
  }
  int dis;
  if (a[0]!=a[1]){
    dis=a[2]-a[0];
    if (dis%2==0){
      ans+=dis/2;
    }
    else {
      ans+=1+dis/2;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> a(3);
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> a(3);
      |          ^~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>a[0]>>a[1]>>a[2];
      |   ^~~
      |   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:8: error: 'a' was not declared in this scope
    6 |   cin>>a[0]>>a[1]>>a[2];
      |        ^
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>

int main(void){
  vector<int> a(3);
  cin>>a[0]>>a[1]>>a[2];
  sort(a.begin(),a.end());
  int ans=0;
  while(a[1]!=a[2]){
    a[0]++;
    a[1]++;
    ans++;
  }
  int dis;
  if (a[0]!=a[1]){
    dis=a[2]-a[0];
    if (dis%2==0){
      ans+=dis/2;
    }
    else {
      ans+=1+dis/2;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> a(3);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> a(3);
      |          ^~~
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a[0]>>a[1]>>a[2];
      |   ^~~
      |   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:8: error: 'a' was not declared in this scope
    5 |   cin>>a[0]>>a[1]>>a[2];
      |        ^
a.cc:6:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    6 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In lambda function:
a.cc:7:20: error: expected '{' before ')' token
    7 |   int M=max([A,B,C]);
      |                    ^
a.cc: In function 'int main()':
a.cc:7:12: error: no matching function for call to 'max(main()::<lambda()>)'
    7 |   int M=max([A,B,C]);
      |         ~~~^~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:7:12: note:   'main()::<lambda()>' is not derived from 'std::initializer_list<_Tp>'
    7 |   int M=max([A,B,C]);
      |         ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c;
  cin >>a>>b>>c;
  int m=max({a,b,c});
  int a=m*3-a-b-c;
  int ans;
  if(a%2 == 1){
    ans = (a+3)/2;
  }
  else ans = a/2;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int a'
    8 |   int a=m*3-a-b-c;
      |       ^
a.cc:5:7: note: 'int a' previously declared here
    5 |   int a,b,c;
      |       ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

int main()
{
    int a[3],sum,ans;
  REP(i,3)
    cin>>a[i];
  sort(a.a+3);
  sum=a[2]*3;
  if(sum%2==1)sum+=3;
  
  ans=(sum-a[0]-a[1]-a[2])/2;
  
  
    cout << ans << endl;

    return 0;
}

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

#include <stdio.h>
#include <cstdio>
#include <vector>
#include <iostream>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	cnt = 0;
	while(a[0] != a[1] && a[1] != a[2] && a[2] != a[0]){
		VSORT(a);
		if((a[0] + 2) <= a[2]) a[0] += 2;
		else{
			a[0] += 1;
			a[1] += 1;
		}
		cnt += 1;
	}
	cout << cnt << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   22 |         cnt = 0;
      |         ^~~
      |         int
a.cc:10:18: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 | #define VSORT(v) sort(v.begin(), v.end());
      |                  ^~~~
a.cc:24:17: note: in expansion of macro 'VSORT'
   24 |                 VSORT(a);
      |                 ^~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
//絶対値
int abs(int x) {
				return max(x,-x);
}

int main() {
  int a,b,c;
  cin>>a>>b>>c;
  int cnt=0;
	while(max(abs(a-b),max(abs(b-c),abs(c-a))) >2) {
	  if(a<=b && a<=c) a+=2;
	  else if(b<=a && b<=c) b+=2;
	  else c+=2;
			  cnt++;
	}
	int cntp=0;
	int dif = max(abs(a-b),max(abs(b-c),abs(c-a)));
	int min = min(a,min(b,c));
	int cntm=0;
	if (a==min) cntm++;
	if (b==min) cntm++;
	if (c==min) cntm++;
	
	
	if (dif==0) cntp=0;
	else if(dif==1) {
	  if (cntm == 1) cntp=2;
	  if (cntm ==2) cntp=1;
			}
	else {
	  if (a!=b&&b!=c&&c!=a) cntp=3;
	  else if (cntm==2) cntp=2;
	  else cntp=1;
  }
  cout <<cnt+cntp;
}

	
			  
			  
			  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: 'min' cannot be used as a function
   21 |         int min = min(a,min(b,c));
      |                         ~~~^~~~~
a.cc:21:33: error: 'min' cannot be used as a function
   21 |         int min = min(a,min(b,c));
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  int ans=0;
  while(a[0]!=a[1] && a[0] != a[2] && a[1] != a[2])){
    VSORT(a);
    if(a[0] + 2 <= a[2]) a[0] += 2;
    else{
      a[0]+=1;
      a[1]+=1;
    }
    ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:52: error: expected primary-expression before ')' token
   26 |   while(a[0]!=a[1] && a[0] != a[2] && a[1] != a[2])){
      |                                                    ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  int ans=0;
  while(a[0]!=a[1] && a[0] != a[2] && a[1] != a[2])){
    VSORT(a);
    if(a[0] + 2 <= a[2]) a[0] += 2;
    else{
      a[0]++;
      a[1]++;
    }
    ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:52: error: expected primary-expression before ')' token
   26 |   while(a[0]!=a[1] && a[0] != a[2] && a[1] != a[2])){
      |                                                    ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  int ans=0;
  while(!(a==b==c)){
    VSORT(a);
    if(a[0] + 2 <= a[2]) a[0] += 2;
    else{
      a[0]++;
      a[1]++;
    }
    ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'b' was not declared in this scope
   26 |   while(!(a==b==c)){
      |              ^
a.cc:26:17: error: 'c' was not declared in this scope
   26 |   while(!(a==b==c)){
      |                 ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int x[3], ans = 0;

    cin >> x[0] >> x[1] >> x[2];

    sort(x, x+3);

    if((x[2] - x[0]) % 2 == 0 && (x[2] - x[1]) % 2 == 1){
        ++x[2]; ++x[0];
        ++ans;
    }
    else if((x[2] - x[0]) % 2 == 1 && (x[2] - x[1]) % 2 == 0){
        ++x[2]; ++x[1];
        ++ans;
    }
    else if((x[2] - x[0]) % 2 == 1 && (x[2] - x[1]) % 2 == 1){
        ++x[1]; ++x[0];
        ++ans;
    }

    cout << (x[2] - x[0]) / 2 + (x[2] - x[1]) / 2  + ans << endl;
}


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

#include <iostream>
using namespace std;

int main() {
    int A[3];
    cin >> A[0] >> A[1] >> A[2];

    int num=0;
    while (A[0] != A[1] || A[1] != A[2]) {
        sort(A, A+3);
 
         // 最小値の＋2
        // 同じ値が2つできれば値の組に＋1
        if (A[0] == A[1]) {
            A[0]++;
            A[1]++;
        } else {
            A[0] += 2;
        }
        num++;
    }
    cout << num << endl;
}

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

#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

//AtCoderC++.cpp

using namespace std;


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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: expected ';' before '{' token
   21 |         if (Rest % 2 != 0)Max++{
      |                                ^
      |                                ;
Language: C++

#include <iostream>
using namespace std;

int main() {
        int n[3];
        int ans=0;
        cin>>n[0]>>n[1]>>n[2];
        sort(n,n+3);
        ans+=(n[2]-n[1])/2+(n[2]-n[0])/2;
        n[0]+=((n[2]-n[0])/2)*2;
        n[1]+=((n[2]-n[1])/2)*2;
        if(n[0]!=n[2]&&n[1]!=n[2]) ans++;
        else if(n[0]!=n[2]||n[1]!=n[2]) ans+=2;
        cout<<ans<<endl;
        return 0;
}

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

nt main()
{
    int a,b,c,flag=0;
    scanf("%d %d %d",&a,&b,&c);
    while(1)
    {
        if(a<b && c<b || a==c && a!=b && b!=c && a<b && c<b)
        {
            a=a+1;
            c=c+1;
            flag++;
        }
        else if(a<c && b<c || a==b && a!=c && b!=c && a<c && b<c)
        {
            a=a+1;
            b=b+1;
            flag++;
        }
        else if(b<a && c<a || b==c && b!=a && c!=a && b<a && c<a)
        {
            b=b+1;
            c=c+1;
            flag++;
        }
        if(a<b && a<c)
        {
            a=a+2;
            flag++;
        }
        else if(b<a && b<c)
        {
           b=b+2;
           flag++;
        }
        else if(c<a && c<b)
        {
            c=c+2;
            flag++;
        }
        if(a==b && b==c && c==a)
        {
            break;
        }
    }
    printf("%d",flag);

    return 0;
}

Compiler output:
main.c:1:1: error: unknown type name 'nt'; did you mean 'int'?
    1 | nt main()
      | ^~
      | int
main.c: In function 'main':
main.c:4:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     scanf("%d %d %d",&a,&b,&c);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | nt main()
main.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     scanf("%d %d %d",&a,&b,&c);
      |     ^~~~~
main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:45:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   45 |     printf("%d",flag);
      |     ^~~~~~
main.c:45:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:45:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:45:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

nt main()
{
    int a,b,c,flag=0;
    scanf("%d %d %d",&a,&b,&c);
    while(1)
    {
        if(a<b && c<b || a==c && a!=b && b!=c && a<b && c<b)
        {
            a=a+1;
            c=c+1;
            flag++;
        }
        else if(a<c && b<c || a==b && a!=c && b!=c && a<c && b<c)
        {
            a=a+1;
            b=b+1;
            flag++;
        }
        else if(b<a && c<a || b==c && b!=a && c!=a && b<a && c<a)
        {
            b=b+1;
            c=c+1;
            flag++;
        }
        if(a<b && a<c)
        {
            a=a+2;
            flag++;
        }
        else if(b<a && b<c)
        {
           b=b+2;
           flag++;
        }
        else if(c<a && c<b)
        {
            c=c+2;
            flag++;
        }
        if(a==b && b==c && c==a)
        {
            break;
        }
    }
    printf("%d",flag);

    return 0;
}

Compiler output:
a.cc:1:1: error: 'nt' does not name a type; did you mean 'int'?
    1 | nt main()
      | ^~
      | int
Language: C++

#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    int mx = max({a,b,c});
    cout << ceil((3 * mx - a - b - c) / 2 ) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'ceil' was not declared in this scope
   15 |     cout << ceil((3 * mx - a - b - c) / 2 ) << endl;
      |             ^~~~
Language: C++

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

int main(){
  int a[3];
  int ans = 0;
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  int ans = abc[2] - abc[1];
  if ((a[2] - a[0] - ans) % 2 == 0)
    ans +=(a[2] - a[0] - ans) / 2;
  else
    ans +=(a[2] - a[0] - ans) / 2 + 2;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int ans'
   10 |   int ans = abc[2] - abc[1];
      |       ^~~
a.cc:7:7: note: 'int ans' previously declared here
    7 |   int ans = 0;
      |       ^~~
a.cc:10:13: error: 'abc' was not declared in this scope; did you mean 'abs'?
   10 |   int ans = abc[2] - abc[1];
      |             ^~~
      |             abs
Language: C++

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

int main(){
  int a[3];
  int ans = 0;
  cin>>a[0]>>a[1]>>a[2];

  sort(a,a+3);
  ans+=a[2]-a[1];
  if((a[2]-a[0]-ans)%2!=0)ans+=(a[0]+ans)/2+2;
  ans+=a[0]+ans)/2;
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before ')' token
   13 |   ans+=a[0]+ans)/2;
      |                ^
      |                ;
Language: C++

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

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

Compiler output:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
int main(void) {
    int i;
    vector<int> a;
    for(i=0; i<3; i++) {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    sort(a.begin(), a.end());
    int cnt=0;
    for(i=0; i<2; i++) {
        while(a[i]+2<=a[2]) {
            a[i]+=2;
            cnt++;
        }
    }
    
    if(a[0]==a[1]&&a[1]==a[2]);
    else if(a[0]==a[1])
        cnt++;
    else if(a[0]==a[2] || a[1]==a[2])
        cnt+=2;
    cout << cnt << endl;
}


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

#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



class	RevealTriangle {
public:
	vector <string> calcTriangle(vector <string>a) {
		
	//	vector<string>ans = a;
		//while (1) {
			
			for (int i = a.size() - 1; i >= 0; i--) {
				while (1) {bool f = 1;
					for (int j = 0; j < a[i].size(); j++) {
						if (a[i][j] != '?')continue;
						f = 0;
						if (a[i][j + 1] != '?'&&a[i + 1][j] != '?') {
							a[i][j] = a[i + 1][j] - a[i][j + 1] + '0';
							if (a[i][j] < '0')a[i][j] += 10;
						}
						/*
						if (a[i - 1][j + 1] != '?'&&a[i - 1][j] != '?') {
							a[i][j] = a[i - 1][j + 1] + a[i - 1][j] + '0';
							if (a[i][j] > '9')a[i][j] -= 10;
						}
						*/
					}
					for (int j = a[i].size()-1; j >=0; j--) {
						if (a[i][j] != '?')continue;
						f = 0;
						if (a[i][j - 1] != '?'&&a[i + 1][j-1] != '?') {
							a[i][j] = a[i + 1][j-1] - a[i][j - 1] + '0';
							if (a[i][j] < '0')a[i][j] += 10;
						}
					}

					if (f)break;
				}
			}
			
	//	}
		
		return a;
	}


}; 

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