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

#include <iostream>
#include <string>

using namespace std;

#ifdef DEBUG_MODE
#define DBG(n) n;
#else
#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define MOD 1000000007

typedef long long ll;

long long mod_div(long long a, long long b) {
	if (a % b == 0)return a / b;
	long long tmp = MOD - 2, c = b, ret = 1;
	while (tmp > 0) {
		if (tmp & 1) {
			ret *= c; ret %= MOD;
		}
		c *= c; c %= MOD; tmp >>= 1;
	}
	return a*ret%MOD;
}

char str[100011];
ll dp[4][100011];

int main() {

	scanf("%s", str);

	ll tmp = 1;
	ll cou = 0;
	REP(i, strlen(str)) {
		if (str[i] == '?')cou++;
	}
	REP(i, cou) {
		tmp *= 3;
		tmp %= MOD;
	}

	dp[0][0] = tmp;
	REP(i, strlen(str)) {
		REP(j, 4) {
			if (dp[j][i]) {
				if (j < 3) {
					if (str[i] == 'A' + j) {
						dp[j + 1][i + 1] += dp[j][i];
						dp[j + 1][i + 1] %= MOD;
					}
					else if (str[i] == '?') {
						dp[j + 1][i + 1] += mod_div(dp[j][i], 3);
						dp[j + 1][i + 1] %= MOD;
					}
				}
				dp[j][i + 1] += dp[j][i];
				dp[j][i + 1] %= MOD;
			}
		}
	}

	cout << dp[3][strlen(str)] << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:16: error: 'strlen' was not declared in this scope
   46 |         REP(i, strlen(str)) {
      |                ^~~~~~
a.cc:11:42: note: in definition of macro 'REP'
   11 | #define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
      |                                          ^
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:55:16: error: 'strlen' was not declared in this scope
   55 |         REP(i, strlen(str)) {
      |                ^~~~~~
a.cc:11:42: note: in definition of macro 'REP'
   11 | #define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
      |                                          ^
a.cc:55:16: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   55 |         REP(i, strlen(str)) {
      |                ^~~~~~
a.cc:11:42: note: in definition of macro 'REP'
   11 | #define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
      |                                          ^
a.cc:74:23: error: 'strlen' was not declared in this scope
   74 |         cout << dp[3][strlen(str)] << endl;
      |                       ^~~~~~
a.cc:74:23: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  string s;
  cin >> s;
  int a[s.size()+1]=0, c[s.size()+1]=0, q[s.size()+1]=0;
  long long ans0=0, ans1=0, ans2=0, ans3=0, ans=0;
  long long power=1;
  
  for(int i=0; i<s.size(); ++i){
    a[i+1] += a[i]+((s[i] == 'A')?1:0);
    c[i+1] += c[i]+((s[i] == 'C')?1:0);
    q[i+1] += q[i]+((s[i] == 'C')?1:0);
  }
  
  for(int i=0; i<q[s.size()]-3; ++i)
    power = power*3%1000000007;
  
  for(int i=0; i<s.size(); ++i){
    if(s[i] == 'B'){
      ans0 += a[i]*(c[s.size()]-c[i+1]);
      ans1 += q[i]*(c[s.size()]-c[i+1]) + a[i]*(q[s.size()]-q[i+1]);
      ans2 += q[i]*(q[s.size()]-q[i+1]);
    }
    if(s[i] == '?'){
      ans1 += a[i]*(c[s.size()]-c[i+1]);
      ans2 += q[i]*(c[s.size()]-c[i+1]) + a[i]*(q[s.size()]-q[i+1]);
      ans3 += q[i]*(q[s.size()]-q[i+1]);
    }
  }
  ans0 %= 1000000007;
  ans1 %= 1000000007;
  ans2 %= 1000000007;
  ans3 %= 1000000007;
  ans = (power*27%1000000007*ans0 + power*9%1000000007*ans1 + power*3*ans2 power*ans3)%(power*27)%1000000007;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: array must be initialized with a brace-enclosed initializer
   10 |   int a[s.size()+1]=0, c[s.size()+1]=0, q[s.size()+1]=0;
      |                     ^
a.cc:10:38: error: array must be initialized with a brace-enclosed initializer
   10 |   int a[s.size()+1]=0, c[s.size()+1]=0, q[s.size()+1]=0;
      |                                      ^
a.cc:10:55: error: array must be initialized with a brace-enclosed initializer
   10 |   int a[s.size()+1]=0, c[s.size()+1]=0, q[s.size()+1]=0;
      |                                                       ^
a.cc:39:75: error: expected ')' before 'power'
   39 |   ans = (power*27%1000000007*ans0 + power*9%1000000007*ans1 + power*3*ans2 power*ans3)%(power*27)%1000000007;
      |         ~                                                                 ^~~~~~
      |                                                                           )
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

using ll = long long;

ll mod = 1000000007;

int main(int argc, char const *argv[]) {
	string str;
	std::cin >> str;
	int q = 0;

	// ? の数を数える
	for (size_t i = 0; i < str.size(); i++) {
		if (str[i] == '?') {
			q++;
		}
	}


	//3^qを計算しておく
	std::vector<ll> calc3q(str.size()+2);
	calc3q[0] = 1;
	for (size_t i = 1; i < calc3q.size(); i++) {
		calc3q[i] = (calc3q[i-1] * 3) % mod;
	}


	// left : [number of a, number of ?]pairのvector
	// right: [number of c, number of ?]pairのvector
	std::vector<std::vector<ll>> left(str.size(),std::vector<ll> (2,0)),right(str.size(),std::vector<ll> (2,0));
	for (size_t i = 1; i < str.size(); i++) {
		if (str[i-1] == 'A') {
			left[i][0] = left[i-1][0] + 1;
			left[i][1] = left[i-1][1];
		}
		else if (str[i-1] == '?') {
			left[i][0] = left[i-1][0];
			left[i][1] = left[i-1][1] + 1;
		}
		else {
			left[i][0] = left[i-1][0];
			left[i][1] = left[i-1][1];
		}
	}
	for (int i = str.size()-2; i > -1; i--) {
		if (str[i+1] == 'C') {
			right[i][0] = right[i+1][0] + 1;
			right[i][1] = right[i+1][1];
		}
		else if (str[i+1] == '?') {
			right[i][0] = right[i+1][0];
			right[i][1] = right[i+1][1] + 1;
		}
		else {
			right[i][0] = right[i+1][0];
			right[i][1] = right[i+1][1];
		}
	}
/*
	for (size_t i = 0; i < right.size(); i++) {
		std::cout << right[i][0] << ' ';
	}
	std::cout << '\n';
	for (size_t i = 0; i < right.size(); i++) {
		std::cout << right[i][1] << ' ';
	}
	std::cout << '\n';
	for (size_t i = 0; i < left.size(); i++) {
		std::cout << left[i][0] << ' ';
	}
	std::cout << '\n';
	for (size_t i = 0; i < left.size(); i++) {
		std::cout << left[i][1] << ' ';
	}
	std::cout << '\n';
*/

	ll ans = 0;
	for (size_t i = 1; i < str.size()-1; i++) {
		if (str[i] != 'B' && str[i] != '?') {
			continue;
		}
		if (str[i] == 'B') {
			// A B Cの場合
			ans = (ans + (((left[i][0] * right[i][0])%mod) * calc3q[q]) % mod) % mll
			// ? B Cの場合
			ans = (ans + (((left[i][1] * right[i][0])%mod) * calc3q[q-1]) % mod) % mod;
			// A B ?の場合
			ans = (ans + (((left[i][0] * right[i][1])%mod) * calc3q[q-1]) % mod) % mod;
			// ? B ?の場合
			ans = (ans + (((left[i][1] * right[i][1])%mod) * calc3q[q-2]) % mod) % mod;
		}
		if (str[i] == '?') {
			// A ? Cの場合
			ans = (ans + (((left[i][0] * right[i][0])%mod) * calc3q[q-1]) % mod) % mod;
			// ? ? Cの場合
			ans = (ans + (((left[i][1] * right[i][0])%mod) * calc3q[q-2]) % mod) % mod;
			// A ? ?の場合
			ans = (ans + (((left[i][0] * right[i][1])%mod) * calc3q[q-2]) % mod) % mod;
			// ? ? ?の場合
			ans = (ans + (((left[i][1] * right[i][1])%mod) * calc3q[q-3]) % mod) % mod;
		}
	}

	std::cout << ans << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:90:94: error: 'mll' was not declared in this scope; did you mean 'll'?
   90 |                         ans = (ans + (((left[i][0] * right[i][0])%mod) * calc3q[q]) % mod) % mll
      |                                                                                              ^~~
      |                                                                                              ll
Language: C++

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

const long long md = 1e9 + 7;

long long power(long long b, long long exp) {
  long long res = 1;

  while (exp > 0)
  {
    // If y is odd, multiply x with result
    if (exp & 1) {
      res = res * b;
    }

    // n must be even now
    exp = exp >> 1; // exp = exp/2
    b = b * b;  // Change x to x^2
  }
  return res;
}

void solve() {
  string s;
  cin >> s;
  int N = s.size();

  vector<vector<long long>> dpv(N + 1, vector<long long>(3, 0));
  int num_question_marks = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (s[i] == 'A') {
      dpv[i][2] = dpv[i + 1][2] + dpv[i + 1][1];
      dpv[i][1] = dpv[i + 1][1];
      dpv[i][0] = dpv[i + 1][0];
    } else if (s[i] == 'B') {
      dpv[i][2] = dpv[i + 1][2];
      dpv[i][1] = dpv[i + 1][1] + dpv[i + 1][0];
      dpv[i][0] = dpv[i + 1][0];
    } else if (s[i] == 'C') {
      dpv[i][2] = dpv[i + 1][2];
      dpv[i][1] = dpv[i + 1][1];
      // TODO: Change this to be modulo compatible.
      dpv[i][0] = dpv[i + 1][0] + power(3, num_question_marks);
    } else if (s[i] == '?') {
      dpv[i][2] = dpv[i + 1][2] + dpv[i + 1][1] + 2 * dpv[i + 1][2];
      dpv[i][1] = dpv[i + 1][1] + dpv[i + 1][0] + 2 * dpv[i + 1][1];
      dpv[i][0] = 3 * dpv[i + 1][0] + power(3, num_question_marks);
      ++num_question_marks;
    } else {
      assert(false);
    }
    dpv[i][2] %= md;
    dpv[i][1] %= md;
    dpv[i][0] %= md;
  }
  cout << dpv[0][2] << endl;
}


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

#include <iostream>
#include <string>
using namespace std;
#define l_ength size
#define MOD (ll)(1e9+7)

int main(void){
int n,i,j;
ll dp[3][123456];
fill(dp[0],dp[3],0ll);
string s;
cin>>s;
n=s.l_ength();
for(i=0;i<n;++i){
for(j=0;j<3;++j){
dp[j][i+i] = dp[j][i];
if(s[i]=='a'+j||s[i]=='?'){
dp[j][i+1] += (j)?dp[j-1][i-1]:1ll;
dp[j][i+1]%=MOD;
}
}
}
cout<<dp[2][n]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'll' was not declared in this scope
    9 | ll dp[3][123456];
      | ^~
a.cc:10:6: error: 'dp' was not declared in this scope
   10 | fill(dp[0],dp[3],0ll);
      |      ^~
Language: C++

//D
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace boost_multiprecision = boost::multiprecision;
#define LL long long
#define CINT boost_multiprecision::cpp_int
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while (true)

const int MOD = 1000000007;
string S;
int dp[100000][3][28];
CINT all0 = 1;
CINT all1 = 1;
CINT all2 = 1;
CINT all3 = 1;

int solve(int now, int next, int three){
    if(dp[now][next][three] != -1) return dp[now][next][three];
    int re = 0;
    for(int i=now; i<S.size(); i++){
        if(S[i] == '?') three++;
        if(next == 0 && (S[i] == 'A' || S[i] == '?')){
            re += solve(i+1,1,three);
            re %= MOD;
        }
        if(next == 1 && (S[i] == 'B' || S[i] == '?')){
            re += solve(i+1,2,three);
            re %= MOD;
        }
        if(next == 2 && (S[i] == 'C' || S[i] == '?')){
            if(three == 0) re += (int)all0;
            if(three == 1) re += (int)all1;
            if(three == 2) re += (int)all2;
            if(three == 3) re += (int)all3;
            re %= MOD;
        }
        if(S[i] == '?') three--;
    }
    re %= MOD;
    dp[now][next][three] = re;
    return re;
}

int main(){
    
    cin >> S;
    int c = 0;
    for(int i=0; i<S.size(); i++){
        for(int j=0; j<28; j++){
            dp[i][0][j] = -1;
            dp[i][1][j] = -1;
            dp[i][2][j] = -1;
        }
        if(S[i] == '?'){
            all *= 3;
            if(c > 0) all1 *= 3;
            if(c > 1)all2 *= 3;
            if(c > 2)all3 *= 3;
            c++;
            all0 %= MOD;
            all1 %= MOD;
            all2 %= MOD;
            all3 %= MOD;
        }
    }

    cout << solve(0,0,0) % MOD << endl;;

    
    return 0;
}

Compiler output:
a.cc:19:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   19 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

//D
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace boost_multiprecision = boost::multiprecision;
#define LL long long
#define CINT boost_multiprecision::cpp_int
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while (true)

const int MOD = 1000000007;
string S;
int dp[100000][3][28];
CINT all0 = 1;
CINT all1 = 1;
CINT all2 = 1;
CINT all3 = 1;

int solve(int now, int next, int three){
    if(dp[now][next][three] != -1) return dp[now][next][three];
    int re = 0;
    for(int i=now; i<S.size(); i++){
        if(S[i] == '?') three++;
        if(next == 0 && (S[i] == 'A' || S[i] == '?')){
            re += solve(i+1,1,three);
            re %= MOD;
        }
        if(next == 1 && (S[i] == 'B' || S[i] == '?')){
            re += solve(i+1,2,three);
            re %= MOD;
        }
        if(next == 2 && (S[i] == 'C' || S[i] == '?')){
            if(three == 0) re += (int)all;
            if(three == 1) re += (int)all1;
            if(three == 2) re += (int)all2;
            if(three == 3) re += (int)all3;
            re %= MOD;
        }
        if(S[i] == '?') three--;
    }
    re %= MOD;
    dp[now][next][three] = re;
    return re;
}

int main(){
    
    cin >> S;
    int c = 0;
    for(int i=0; i<S.size(); i++){
        for(int j=0; j<28; j++){
            dp[i][0][j] = -1;
            dp[i][1][j] = -1;
            dp[i][2][j] = -1;
        }
        if(S[i] == '?'){
            all *= 3;
            if(c > 0) all1 *= 3;
            if(c > 1)all2 *= 3;
            if(c > 2)all3 *= 3;
            c++;
            all %= MOD;
            all1 %= MOD;
            all2 %= MOD;
            all3 %= MOD;
        }
    }

    cout << solve(0,0,0) % MOD << endl;;

    
    return 0;
}

Compiler output:
a.cc:19:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   19 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define N 100
#define Q 1000000007

int a[N],q[N],ab[N],abc[N];

int main(void){
  char s[N];
  
  cin >> s;
  q[0] = 1;
  for (int i=1; s[i-1]; i++){
    switch(s[i-1]){
    case '?':
      q[i] = (q[i-1]*3) % Q;
      a[i] = (a[i-1]*3 + q[i-1]) % Q;
      ab[i] = (a[i-1] + ab[i-1]*3) % Q;
      abc[i] = (ab[i-1] + abc[i-1]*3) % Q;
      break;
    case 'A':
      q[i] = q[i-1];
      a[i] = (a[i-1] + 1) % Q;
      ab[i] = ab[i-1];
      abc[i] = abc[i-1];
      break;
    case 'B':
      q[i] = q[i-1];
      a[i] = a[i-1];
      ab[i] = (ab[i-1] + a[i-1]) % Q;
      abc[i] = abc[i-1];
    case 'C':
      q[i] = q[i-1];
      a[i] = a[i-1];
      ab[i] = ab[i-1];
      abc[i] = (abc[i-1] + ab[i-1]) % Q;
      break;
    default:
    }
  }
  cout << abc[strlen(s)] << endl;
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: ctsring: No such file or directory
    2 | #include <ctsring>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
using namespace std;
const int P = 1000000007;

long long pow3(int n){
    long long p = 1;
    for(int i = 0; i < n; i ++) (p *= 3) %= P;
    return p;
}

int main(void){
    string s;
    cin >> s;
    int len = s.size();
    long long dp[100002][3] = {{0}};  // 欲しいのは dp[0][0]
    long long cntHatena[100001] = {0}, po[100001] = {0};
    
    po[len] = 1;
    for(int i = len-1; i >= 0; i --){
        po[i] = (((s[i] == '?') ? 3 : 1) * po[i+1]) %= P;
    }
    char al[3] = {'A', 'B', 'C'};
    
    for(int i = len-1; i >= 0; i --){
        if(s[i] == 'C'){
            dp[i][2] = dp[i+1][2] + po[i+1];
        }
        else if(s[i] == '?'){
            dp[i][2] = 3 * dp[i+1][2] + po[i+1];
        }
        else{
            dp[i][2] = dp[i+1][2];
        }
        dp[i][2] %= P;
    }
    
    for(int j = 1; j >= 0; j --){
        for(int i = len-1; i >= 0; i --){
            if(s[i] == al[j]){
                dp[i][j] = (dp[i+1][j+1] + dp[i+1][j]) % P;
            }
            else if(s[i] == '?'){
                dp[i][j] = (dp[i+1][j+1] + 3 * dp[i+1][j]) % P;
            }
            else{
                dp[i][j] = dp[i+1][j];
            }
        }
    }
    printf("%lld\n", dp[0][0]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:42: error: lvalue required as left operand of assignment
   21 |         po[i] = (((s[i] == '?') ? 3 : 1) * po[i+1]) %= P;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include<stdlib.h>
#include <math.h>
using namespace std;
int main() {
    string T;
    long a,b,c;
    a = 0;
     b = 0;
     c = 0;
    cin >> T;
    for(int i = T.length()-1;i>=0;i--){
        if(T[i]=='C'){
            c++;
        }
        if(T[i]=='B'){
            b+=c;
        }
        if(T[i]=='A'){
            a+=b;
        }
        if(T[i]=='?'){
            a+=b;
            b+=c;
            c++;

        }
        if(a>1000000007){
            a -=1000000007;
        }
        cout << a;
        return 0;
    }

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

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

int main(){
	char s[10001];	int q=0;
	scanf("%s",s);
	int i;
	for(i=0;s[i]!='\0';i++) {
		if(s[i]=='?') q++;
	}
	
	int j,k,ac,bc,cc;
	unsigned long long sum=0;
	for(i=0;s[i]!='\0';i++) {
		if(s[i]=='?') ac=1;
		if(s[i]=='A'||s[i]=='?') {
			for(j=i+1;s[j]!='\0';j++) {
				bc=ac;
				if(s[j]=='?') bc++;
				if(s[j]=='B'||s[j]=='?') {
					for(k=j+1;s[k]!='\0';k++) {
						cc=bc;
						if(s[k]=='?') cc++;
						if(s[k]=='C'||s[k]=='?') {
							sum+=pow(3,q-cc);
							sum%=1000000007llu;
						}
					}
				}
			}
		}
		ac=0;
	}
	
	printf("%llu",ans);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:23: error: 'ans' undeclared (first use in this function)
   35 |         printf("%llu",ans);
      |                       ^~~
main.c:35:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
int main(){
	string s;
	cin >> s;
	int n = s.size();
	int a[n];
	for (int i = 0; i < n; i++){
		if (s[i] == 'A'){
			a[i] = 0;
		}else if (s[i] == 'B'){
			a[i] = 1;
		}else if (s[i] == 'C'){
			a[i] = 2;
		}else{
			a[i] = 3;
		}
	}
	int before[n][4][4], after[n][4][4];	//how many [j]s before or after [i] in kth position
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 4; j++){
			for (int k = 0; k < 4; k++){
				before[i][j][k] = 0;
				after[i][j][k] = 0;
			}
		}
	}
	for (int i = 0; i < 4; i++){
		for (int j = 0; j < 4; j++){
			int count = 0;
			for (int k = 0; k < n; k++){
				if (a[k] == i){
					before[k][i][j] = count;
				}else if (a[k] == j){
					count++;
				}
			}
			count = 0;
			for (int k = n - 1; k >= 0; k--){
				if (a[k] == i){
					after[k][i][j] = count;
				}else if (a[k] == j){
					count++;
				}
			}
		}
	}
	long long int ans = 0;
	//count ABC, ?BC, AB?, ?B?
	for (int i = 0; i < n; i++){
		if (a[i] == 1){
			ans += (before[i][1][0] + before[i][1][3]) * (after[i][1][2] + after[i][1][3]);
			ans %= 1000000007;
		}
	}
	//count ??C
	for (int i = 0; i < n; i++){
		if (a[i] == 2){
			ans += before[i][2][3] * (before[i][2][3] - 1) / 2;
			ans %= 1000000007;
		}
	}
	//count A??
	for (int i = 0; i < n; i++){
		if (a[i] == 0){
			ans += after[i][0][3] * (after[i][0][3] - 1) / 2;
			ans %= 1000000007;
		}
	}
	//count A?C
	for (int i = 0; i < n; i++){
		if (a[i] == 3){
			ans += before[i][3][0] * after[i][3][2]
			ans %= 1000000007;
		}
	}
	//count ???
	int num = 0;
	for (int i = 0; i < n; i++){
		if (a[i] == 3){
			num++;
		}
	}
	ans += num * (num - 1) * (num - 2) / 6;
	ans %= 1000000007;
	printf("%lld\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:64: error: expected ';' before 'ans'
   75 |                         ans += before[i][3][0] * after[i][3][2]
      |                                                                ^
      |                                                                ;
   76 |                         ans %= 1000000007;
      |                         ~~~
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		long div = 1000000007;
		int n = s.length();
		int[] a = new int[n];
		boolean[] b = new boolean[n];
		int[] c = new int[n];
		int[] q = new int[n];
		char ch = s.charAt(0);
		if(ch=='A') a[0]++;
		else if(ch=='B') b[0] = true;
		else if(ch=='C') c[0]++;
		else q[0]++;
		for(int i=1;i<n;i++) {
			ch = s.charAt(i);
			a[i] = a[i-1];
			c[i] = c[i-1];
			q[i] = q[i-1];
			if(ch=='A') a[i]++;
			else if(ch=='B') b[i] = true;
			else if(ch=='C') c[i]++;
			else {
				b[i] = true;
				q[i]++;
			}
		}
		long[] threePow = new long[n];
		threePow[0] = 0;
		threePow[1] = 1;
		for(int i=2;i<n;i++) {
			threePow[i] = (threePow[i-1]*3)%div;
		}
		
		long ans = 0;
		for(int i=1;i<n-1;i++) {
			if(b[i]) {
				ans += (((threePow[q[i-1]+1]*a[i-1]+threePow[q[i-1]]*q[i-1]))%div * (threePow[q[n-1]-q[i]+1]*(c[n-1]-c[i])+threePow[q[n-1]-q[i]]*(q[n-1]-q[i]))%div)%div;
			}
			if(ans=>div) ans %= div;
		}
		
		System.out.println(ans);
	}

}


Compiler output:
Main.java:44: error: illegal start of expression
			if(ans=>div) ans %= div;
			       ^
1 error
Language: C++

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

int main(){
  string s;
  cin>>s;
  int l=s.length();
  int A=0,B=0,C=0,Q=0;
  for(int i=0;i<l;i++){
    if(s[i]=='A'){
      A++;
    }
    if(s[i]=='B'){
      B++;
    }
    if(s[i]=='C'){
      C++;
    }
    if(s[i]=='?'){
      Q++;
    }
  }
  int a[l],b[l],c[l],q[l];
  a[0]=0;
  b[0]=0;
  c[0]=0;
  q[0]=0;
  int ans=0;
  for(int i=0;i<l-1;i++){
    if(s[i]=='A'){
      q[i+1]=q[i];
      a[i+1]=a[i]+1;
      b[i+1]=b[i];
      c[i+1]=c[i];
    }else if(s[i]=='C'){
      q[i+1]=q[i];
      a[i+1]=a[i];
      b[i+1]=b[i];
      c[i+1]=c[i]+1;
    }else if(s[i]=='?'){
      q[i+1]=q[i]+1;
      a[i+1]=a[i];
      b[i+1]=b[i];
      c[i+1]=c[i];
      ans+=(a[i]+q[i])*(C-c[i]+Q-q[i]-1);
    }else{
      q[i+1]=q[i];
      a[i+1]=a[i];
      b[i+1]=b[i]+1;
      c[i+1]=c[i];
      ans+=(a[i]+q[i])*(C+Q-c[i]-q[i]);
    }
    if(ans>=pow(10,9)+7){
      ans=ans%(pow(10,9)+7);
    }
  }
  cout<<ans<<endl;
}
      
      
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:56:14: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   56 |       ans=ans%(pow(10,9)+7);
      |           ~~~^~~~~~~~~~~~~~
      |           |             |
      |           int           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

a = 0
ab = 0
abc = 0
r = 1

s = input()

for c in s:
    if c == "A":
        a += r
    elif c == "B":
        ab += a
    elif c == "C":
        abc += ab
    else:
        abc = abc * 3 + ab
        ab = ab * 3 + a
        a = a * 3 + r
        r *= 3

print(abc % 1_000_000_007)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a = 0
      | ^
Language: Java

mport java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a2 = sc.nextInt();
		int a3 = sc.nextInt();
		sc.close();

		int min = Math.min(Math.min(a1, a2), a3);
		int max = Math.max(Math.max(a1, a2), a3);
		System.out.println(max - min);
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  vector<int> a(3);
  cin>>a[0]>>a[1]>>a[2];
  sort(a.begin(),a.end());
  cout<<a[2]-a[0]<<endl;
  return 0;
}

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

#include<stdio.h>

int main(void){
  int number[2];
  scanf("%d %d %d",&number[0],&number[1],&number[2]);
  
  for (i=0; i<3; ++i) {
    for (j=i+1; j<3; ++j) {
      if (number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
  
  printf("%d\n",number[2]-number[0]);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:8: error: 'i' undeclared (first use in this function)
    7 |   for (i=0; i<3; ++i) {
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:10: error: 'j' undeclared (first use in this function)
    8 |     for (j=i+1; j<3; ++j) {
      |          ^
main.c:10:9: error: 'tmp' undeclared (first use in this function)
   10 |         tmp =  number[i];
      |         ^~~
Language: C++

int main() {
  vector<int> a(3);
  rep(i, 3) cin >> a[i];
  sort(ALL(a));
  cout << a[2] - a[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'vector' was not declared in this scope
    2 |   vector<int> a(3);
      |   ^~~~~~
a.cc:2:10: error: expected primary-expression before 'int'
    2 |   vector<int> a(3);
      |          ^~~
a.cc:3:7: error: 'i' was not declared in this scope
    3 |   rep(i, 3) cin >> a[i];
      |       ^
a.cc:3:3: error: 'rep' was not declared in this scope
    3 |   rep(i, 3) cin >> a[i];
      |   ^~~
a.cc:4:12: error: 'a' was not declared in this scope
    4 |   sort(ALL(a));
      |            ^
a.cc:4:8: error: 'ALL' was not declared in this scope
    4 |   sort(ALL(a));
      |        ^~~
a.cc:4:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    4 |   sort(ALL(a));
      |   ^~~~
      |   short
a.cc:5:3: error: 'cout' was not declared in this scope
    5 |   cout << a[2] - a[0] << endl;
      |   ^~~~
a.cc:5:26: error: 'endl' was not declared in this scope
    5 |   cout << a[2] - a[0] << endl;
      |                          ^~~~
Language: C

#include <stdio.h>
int main(void)
{
    int N;
    scanf("%d", &N);

    int numbers[N];
    for(int i=0; i<N; i++){
        scanf("%d", &numbers[i]);
    }

    // 入力した値の最小公倍数を求めるプログラムを作成
    int count = 1;
    int amari[N];
    int sum_amari;
    int saisyou_koubaisuu;
    while(1){
        sum_amari = 0;
        for(int i=0; i<N; i++){
            //amari[i] = count%numbers[i];
            //sum_amari += amari[i];
            sum_amari += count%numbers[i]
        }
        if(sum_amari == 0){
            saisyou_koubaisuu = count;
            break;
        }
        count++;
    }
    // printf("saisyou_koubaisuu = %d\n", saisyou_koubaisuu);

    int f;
    int ans = -1;
    for(int i=0; i<saisyou_koubaisuu; i++){
        f = 0;
        for(int j=0; j<N; j++){
            f += i%numbers[j];
        }
        if(ans < f){
            ans = f;
        }
        // printf("%d %d\n", i, f);
    }

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

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:42: error: expected ';' before '}' token
   22 |             sum_amari += count%numbers[i]
      |                                          ^
      |                                          ;
   23 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a[3],i;
  for(i=0;i<3;i++){
    cin>>a[i];
  }
  int b[3];
  
  for(i=0;i<2;i++){
    if(a[i]>=a[i+1]){
      b[i]=a[i];
    }
  }
  cout<<b[1]-b[0]+b[2]-b[1];
  return 0;
}
  
  
  
  
  return 0;
}

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

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

int main(){
  vector<int> ans(3);
  for(int i=0;i<3;i++)cin >> ans.at(i);
  sort(ans.begin(),ans.end());
  int ae =0
  ae += ans.at(2) - ans.at(0) 
  cout << ae;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'ae'
   11 |   ae += ans.at(2) - ans.at(0)
      |   ^~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rrep(i, n, g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define len(x) (int)(x).size()
#define dup(x, y) (((x) + (y)-1) / (y))
#define pb push_back
#define Field(T) vector<vector<T>>
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<int>vec(3);
  cin>>vec.at(0)>>vec.at(1)>>vec.at(2);
  sort(vec.begin(),vec.end());
  cout<<vec.(2)-vec.(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected unqualified-id before '(' token
    7 |   cout<<vec.(2)-vec.(0)<<endl;
      |             ^
a.cc:7:21: error: expected unqualified-id before '(' token
    7 |   cout<<vec.(2)-vec.(0)<<endl;
      |                     ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a,b,c,max=0;min=100;
  cin >> a >> b >> c;
  if(a>max) max=a;
  if(b>max) max=b;
  if(c>max) max=c;
  if(a<min) min=a;
  if(b<min) min=b;
  if(c<min) min=c;
  cout << max-min;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: overloaded function with no contextual type information
    5 |   int a,b,c,max=0;min=100;
      |                       ^~~
a.cc:10:7: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   10 |   if(a<min) min=a;
      |      ~^~~~
a.cc:10:17: error: overloaded function with no contextual type information
   10 |   if(a<min) min=a;
      |                 ^
a.cc:11:7: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   11 |   if(b<min) min=b;
      |      ~^~~~
a.cc:11:17: error: overloaded function with no contextual type information
   11 |   if(b<min) min=b;
      |                 ^
a.cc:12:7: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   12 |   if(c<min) min=c;
      |      ~^~~~
a.cc:12:17: error: overloaded function with no contextual type information
   12 |   if(c<min) min=c;
      |                 ^
a.cc:13:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   13 |   cout << max-min;
      |           ~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  cout<<max(a,b,c)-min(a,b,c)<<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:6:12:   required from here
    6 |   cout<<max(a,b,c)-min(a,b,c)<<endl;
      |         ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:6:23:   required from here
    6 |   cout<<max(a,b,c)-min(a,b,c)<<endl;
      |                    ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int x=max(a,b,c);
	int y=min(a,b,c);
	cout<<x-y;
}

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:9:11:   required from here
    9 |         int x=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))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:10:11:   required from here
   10 |         int y=min(a,b,c);
      |               ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int x=max(a,b,c);
	int y=min(a,b,c);
	cout<<x-y;
}

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:11:   required from here
    8 |         int x=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))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:11:   required from here
    9 |         int y=min(a,b,c);
      |               ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main() {
  int a[3];
  cin >> a.at(0) >> a.at(1) >> a.at(2) ;
  sort ( a.begin() , a.end() ) ;
  cout << a.at(2)-a.at(0) << endl;
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
    6 |   cin >> a.at(0) >> a.at(1) >> a.at(2) ;
      |            ^~
a.cc:6:23: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
    6 |   cin >> a.at(0) >> a.at(1) >> a.at(2) ;
      |                       ^~
a.cc:6:34: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
    6 |   cin >> a.at(0) >> a.at(1) >> a.at(2) ;
      |                                  ^~
a.cc:7:12: error: request for member 'begin' in 'a', which is of non-class type 'int [3]'
    7 |   sort ( a.begin() , a.end() ) ;
      |            ^~~~~
a.cc:7:24: error: request for member 'end' in 'a', which is of non-class type 'int [3]'
    7 |   sort ( a.begin() , a.end() ) ;
      |                        ^~~
a.cc:8:13: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
    8 |   cout << a.at(2)-a.at(0) << endl;
      |             ^~
a.cc:8:21: error: request for member 'at' in 'a', which is of non-class type 'int [3]'
    8 |   cout << a.at(2)-a.at(0) << endl;
      |                     ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a[3];
  for(int i=0;i<3;i++)
  {
  cin>>a[i];
  }
  max=a[0];
  min=a[0];
  for(int i=0;i<3;i++)
  {
     if(a[i]>max)
       max=a[i];
    if(a[i]<min)
      min=a[i];
  }
  cout<<max-min;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: overloaded function with no contextual type information
   10 |   max=a[0];
      |          ^
a.cc:11:10: error: overloaded function with no contextual type information
   11 |   min=a[0];
      |          ^
a.cc:14:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   14 |      if(a[i]>max)
      |         ~~~~^~~~
a.cc:15:15: error: overloaded function with no contextual type information
   15 |        max=a[i];
      |               ^
a.cc:16:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   16 |     if(a[i]<min)
      |        ~~~~^~~~
a.cc:17:14: error: overloaded function with no contextual type information
   17 |       min=a[i];
      |              ^
a.cc:19:12: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   19 |   cout<<max-min;
      |         ~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  vector<ll> A(3);
  for(ll i=0;i<3;i++) {
cin>>A[i];
  }
  sort(all(A));
  cout<<vec[2]-vec[0]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'vec' was not declared in this scope
   12 |   cout<<vec[2]-vec[0]<<endl;
      |         ^~~
Language: C++

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

typedef long long ll;
#define pii pair<int ,int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005
int a[5];

int main()
{
    _FastIO;
  	cin >> a[0] >> a[1] >> a[2];
  	sort(a , a + 3);
  	int ans = min(a[1] - a[0] , a[2] - a[1]);
  cout << ans < <endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected primary-expression before '<' token
   16 |   cout << ans < <endl;
      |                 ^
Language: C++

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

int main() {
  vector<int>vec(3);
  for(int i=0; i<3; i++){
    cin >> vec.at(i)
    }
    sort(vec.begin(), vec.end());
  cout << vec.at(2)+vec.at(0) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before '}' token
    7 |     cin >> vec.at(i)
      |                     ^
      |                     ;
    8 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<int> v(3);
  cin >> v.at(0) >> v.at(1) >> v.at(2);
  sort(v.began(),v.end());
  cout << v.at(2)-v.at(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'class std::vector<int>' has no member named 'began'; did you mean 'begin'?
    6 |   sort(v.began(),v.end());
      |          ^~~~~
      |          begin
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int a;
    int b;
    int c;
    int notthemaxes;
    int not;
    cin >> a >> b >> c;
    if (a >= b){
        if(a >= c){
            a = 0;
            if (b - c < 0){
                not = (b - c) * -1;
            }else{
                not = b - c;
            }
            notthemaxes = b + not;
        }else{
            c = 0;
            if (a - b < 0){
                not = (a - b) * -1;
            }else{
                not = a - b;
            }
            notthemaxes = a + not;
        }
    }else if (b >= c){
        b = 0;
        if (a - c < 0){
                not = (a - c) * -1;
            }else{
                not = a - c;
            }
            notthemaxes = a + not;
    }else{
        c = 0;
        if (a - b < 0){
                not = (a - b) * -1;
            }else{
                not = a - b;
            }
            notthemaxes = a + not;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected unqualified-id before 'not' token
   11 |     int not;
      |         ^~~
a.cc:17:21: error: expected primary-expression before '=' token
   17 |                 not = (b - c) * -1;
      |                     ^
a.cc:19:21: error: expected primary-expression before '=' token
   19 |                 not = b - c;
      |                     ^
a.cc:21:34: error: expected primary-expression before ';' token
   21 |             notthemaxes = b + not;
      |                                  ^
a.cc:25:21: error: expected primary-expression before '=' token
   25 |                 not = (a - b) * -1;
      |                     ^
a.cc:27:21: error: expected primary-expression before '=' token
   27 |                 not = a - b;
      |                     ^
a.cc:29:34: error: expected primary-expression before ';' token
   29 |             notthemaxes = a + not;
      |                                  ^
a.cc:34:21: error: expected primary-expression before '=' token
   34 |                 not = (a - c) * -1;
      |                     ^
a.cc:36:21: error: expected primary-expression before '=' token
   36 |                 not = a - c;
      |                     ^
a.cc:38:34: error: expected primary-expression before ';' token
   38 |             notthemaxes = a + not;
      |                                  ^
a.cc:42:21: error: expected primary-expression before '=' token
   42 |                 not = (a - b) * -1;
      |                     ^
a.cc:44:21: error: expected primary-expression before '=' token
   44 |                 not = a - b;
      |                     ^
a.cc:46:34: error: expected primary-expression before ';' token
   46 |             notthemaxes = a + not;
      |                                  ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
  int A[3];
  cin >> A[0] >> A[1] >> A[2];
  vector <int> a(3);
  a[0] = abs(A[0]-A[1]);
  a[1] = abs(A[0]-A[2]);
  a[2] = abs(A[1]-A[2]);
  sort(a.begin(), a.end());
  sout << a[0]+a[1] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'sout' was not declared in this scope; did you mean 'stdout'?
   15 |   sout << a[0]+a[1] << endl;
      |   ^~~~
      |   stdout
Language: C++

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

int main(){
 int N;
  cin >> N;
  vector<int> v(3);
  
  for(int i = 0; i < 3; i++){
    int x;
    cin >> x;
    v[i] = x;
  }
  int sum = 0;
  sort(v.begin(),v.end());
  for(int i = 1; i < n; i++){
    int t = abs(v[i] - v[i - 1]);
    sum += t;
  }
  cout << sum;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'n' was not declared in this scope
   16 |   for(int i = 1; i < n; i++){
      |                      ^
Language: C++

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

int main(){
 int N;
  cin >> N;
  vector<int> v(3);
  
  for(int i = 0; i < 3; i++){
    int x;
    cin >> x;
    v[i] = x;
  }
  int sum = 0;
  sort(v.begin(),v.end());
  for(int i = 1; i < n; i++){
    int t = abs(v[i] - v[i - 1]);
    sum += t;
  }
  cout << sum;
}
    

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

import java.util.Map;
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	static int[] C;
	static int[][] A;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int[] a=new int[3];
	    a[0]=gi();
	    a[1]=gi();
	    a[2]=gi();
	    Arrays.parallelSort(a);
        System.out.println(a[2]-a[0]);
//        if (a<b) {
//        	System.out.print(Math.max(b-a-w, 0));
//        }else {
//        	System.out.print(Math.max(a-b-w, 0));
//        }


	}
	
	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
	    Arrays.parallelSort(a);
	    ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ')' before 'a'
   10 |   reverse(a.begin()a.end());
      |          ~         ^
      |                    )
a.cc:10:10: error: no matching function for call to 'reverse(std::vector<int>::iterator)'
   10 |   reverse(a.begin()a.end());
      |   ~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1083:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)'
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note:   candidate expects 3 arguments, 1 provided