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

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;
    vector<lint> R(N + 1, 0), G(N + 1, 0), B(N + 1, 0);
    map<char, vector<lint>> mp;
    mp['R'] = vector<lint>(N + 1, 0);
    mp['G'] = vector<lint>(N + 1, 0);
    mp['B'] = vector<lint>(N + 1, 0);
    for (int i = N; 0 < i; i--) {
        // mp[S[i - 1]][i - 1] = mp[S[i - 1]][i] + 1;
        mp['R'][i - 1] = mp['R'][i];
        mp['G'][i - 1] = mp['G'][i];
        mp['B'][i - 1] = mp['B'][i];
        mp[S[i - 1]][i - 1]++;
    }
    // d(S);
    // dump(mp['R']);
    // dump(mp['G']);
    // dump(mp['B']);
    lint ans = 0;
    set<char> se{'R', 'G', 'B'};
    for (int i = 0; i <= N - 3; i++) {
        for (int j = i + 1; j <= N - 2; j++) {
            char c1 = S[i], c2 = S[j];
            int r = j - i;
            // dd(i, j);
            set<char> cp = se;
            if (cp.count(c1) == 1) { cp.erase(c1); }
            if (cp.count(c2) == 1) { cp.erase(c2); }
            if (cp.size() != 1) { continue; }
            char c3 = *cp.begin();
            ans += mp[c3][j + 1];
            if (S[j + r] == c3) ans--;
        }
    }
    // d(ans);
    cout << ans << endl;
    return 0;
}

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

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  ll N;cin>>N;
  string s; cin>>s;
  vector<ll> v(N);
  ll ans = 0;
  // 変換
  rep(i,N){
    if(s[i] =='R') v[i] = 0;
    else if(s[i] =='G') v[i] = 1;
    else v[i] = 2;
  }
// まずはcount
  ll a=0,b=0,c=0;
  rep(i,N){
    if(v[i]==0) a++;
    else if(v[i]==1) b++;
    else c++;
  }
  ans += a*b*c;

  rep(i,N){
    //空間
    rep(j,N){
      //始まり
      if(j+2*i >= N) continue;
      if(v[j] != v[j+i] and v[j+i] != v[j+2*i] and v[j] != v[j+2*i]){
        ans--;
      }
    }
  }

  cout<<ans<<endl;
}


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

#include<iostream>
#include<string>
using namespace std;
int main(){
  long long n,r = 0,g = 0,b = 0,x,y,z,ans = 0,i,j;string s;cin >> n >> s;
  for(i=0;i<n;i++){
    if(s[i]=='R') r++;
    else if(s[i]=='G') g++;
    else b++;
  }
  for(i=0;i<n;i++){
    if(s[i]=='R'){
      y = g;z = b;
      for(j=i+1;j<n;j++){
        if(s[i]=='G'){
          ans += z;y--;
        } else {
          ans += y;z--;
        }
      }
      r--;
    } else if(s[i]=='G'){
      x = r;z = b;
      for(j=i+1;j<n;j++){
        if(s[i]=='R'){
          ans += z;x--;
        } else {
          ans += x;z--;
        }
      }
      g--;
    } else {
      x = r;y = g;
      for(j=i+1;j<n;j++){
        if(s[i]=='R'){
          ans += y;x--;
        } else {
          ans += x;y--;
        }
      }
      b--;
    }
  }
  for(i=0;i<n;i++){
    for(j=1;i+j*2<n;j++){
      if(a[i] != a[i+j] && a[i+j] != a[i+j*2] && a[i+j*2] != a[i]) ans--;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:10: error: 'a' was not declared in this scope
   46 |       if(a[i] != a[i+j] && a[i+j] != a[i+j*2] && a[i+j*2] != a[i]) ans--;
      |          ^
Language: C

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

int main(){
    int n;
    string str;
    cin >> n >> str;
    int count = 0;
    
    for(int a=1; a<=n-2; a++){
      for(int b=a+1; b<=n-1; b++){
        for(int c=b+1; c<=n; c++){
          if(str.at(a-1) != str.at(b-1) && str.at(b-1) != str.at(c-1) && str.at(a-1) != str.at(c-1)){
            if(a - (2*b) + c != 0){
              count++;
            }
          }
        }
      }
    }
    cout << count << endl;
    return 0;
}

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

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

const int MOD=1000000007;
//~ const int MOD=998244353;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll sum[3][5000];

int id(char c){
	if(c=='R')return 0;
	if(c=='G')return 1;
	return 2;
}

int main(){
	int n;string s;cin>>n>>s;
	rep(i,n){
		if(s[i]=='R')sum[0][i]++;
		if(s[i]=='G')sum[1][i]++;
		if(s[i]=='B')sum[2][i]++;
	}
	rep(i,3){
		for(int j=n-2;j>=0;j--){
			sum[i][j]+=sum[i][j+1];
		}
	}
	ll ans=0;
	rep(a,n)for(int b=a+1;b+1<n;b++){
		if(s[a]==s[b])continue;
		int w=3-id(s[a])-id(s[b]);
		ll d=0;
		if(a+(b-a)*2<n){
			if(id(s[a+(b-a)*2])==w)d--;
		}
		d+=sum[w][b+1];
		ans+=d;
	}
	cout<<ans<<endl;
}

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

#include<bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
#define F first
#define S second
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long 
#define ld long double
#define pii pair <int ,int >
#define bug(x)  cout<<"passed "<<x<<endl;

long long const inf = 2e18, linf = 2e9, mod = 1e9+7;
int const mxn = 1e6 + 10 ;  ; 

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

long long ans , ans2 ; 
int R[mxn] , G[mxn] , B[mxn]  ; 
string  s; 
int main(){
	int n ; 
	cin>> n ; 
	cin>>s ; 
	s = "." + s ; 
	for (int i = 1; i <= n ; i++){
		R[i] = R[i-1] + (s[i]=='R') ; 
		G[i] = G[i-1] + (s[i]=='G') ; 
		B[i] = B[i-1] + (s[i]=='B') ; 
	}
	
	
	
	for (int i = 1 ; i <= n ; i++){
		if (s[i]=='R'){
			ans+=G[i] * (B[n] - B[i]) ; 
			ans+=B[i] * (G[n] - G[i]) ; 
		}
		if (s[i]=='G'){
			ans+=R[i] * (B[n] - B[i]) ; 
			ans+=B[i] * (R[n] - R[i]) ; 
		}
		if (s[i]=='B'){
			ans+=R[i] * (G[n] - G[i]) ; 
			ans+=G[i] * (R[n] - R[i]) ;
		}
	}
	for (int i = 1 ; i <=n ; i++){
		for (int j = i+1 ; j <=n ; j++){
			if ((j - i)%2==0){
				int b = (j+i) / 2; 
				if (s[i]!=s[j] and s[b]!=s[j] and s[b]!=s[i])
					ans2++ ;
			}
		}
	}
	//cout<<ans<<endl;
	cout<<ans - ans2  ; 

}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	int n;
	string s;
	cin >> n >> s;
	ll ans = 0;
	vector<ll> r(n), g(n), b(n);
	if(n <= 3) {
		cout << 0 << endl;
		return 0;
	}
	rep(i, n) {
		if(s[i] == 'R') r[i]++;
		if(s[i] == 'G') g[i]++;
		if(s[i] == 'B') b[i]++;
		if(i > 0) {
			r[i] += r[i-1];
			g[i] += g[i-1];
			b[i] += b[i-1];
		}
	}
	// rep(i, n) cout << r[i] << " ";
	// cout << endl;
	// rep(i, n) cout << g[i] << " ";
	// cout << endl;
	// rep(i, n) cout << b[i] << " ";
	// cout << endl;
	rep(i, n-2) {
		for(int j = i+1; j < n-1; j++) {
			if(s[i] == s[j]) continue;
			char now = ((s[i] == 'R' || s[j] == 'R') && (s[i] == 'G' || s[j] == 'G')) ? 'B' : ((s[i] == 'R' || s[j] == 'R') && (s[i] == 'B' || s[j] == 'B')) ? 'G' : 'R';
			int dif = j - i;
			if(now == 'R') {
				ans += r[n-1] - r[min(n-1,j+dif)];
				if(dif>1) ans += r[min(n-1,j+dif-1)] - r[j];
			}
			if(now == 'G') {
				ans += g[n-1] - g[min(n-1,j+dif)];
				if(dif>1) ans += g[min(n-1,j+dif-1)] - g[j];
			}
			if(now == 'B') {
				ans += b[n-1] - b[min(n-1,j+dif)];
				if(dif>1) ans += b[min(n-1,j+dif-1)] - b[j];
			}
		}
	}
	
	cout << ans << endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define f first
#define s second
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define fast 
#define f first
#define s second
#define endl "\n"
#define pie 3.1415926535

int main(){
    int n;
    cin >>n;
    string s;
    cin >> s;
  
    long long sum = 0;
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if(s[i] != s[j] && s[j]!= s[k] && s[i]!=s[k] && (j-i)!=(k-j))
                    sum++;
            }
        }
    }
    cout << sum<<endl;
    return 0;
    
}






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

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yosiiii
 */


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

class DRGBTriplets {
public:
	void solve(std::istream& in, std::ostream& out) {
        int n;
        in >> n;
        string s;
        in >> s;
        vector<int> r(n,0),g(n,0),b(n,0);
        rep(i,n){
            if(s[i]=='R') {
                r[i]++;
            }
            if(s[i]=='G') {
                g[i]++;
            }
            if(s[i]=='B') {
                b[i]++;
            }
        }
        rep(i,n-1){
            r[i+1]+=r[i];
            g[i+1]+=g[i];
            b[i+1]+=b[i];
        }
        ll cnt = 0L;
        for(int j=1;j<n-1;j++){
            if(s[j]=='R'){
                cnt+=g[j]*(b.back()-b[j])+b[j]*(g.back()-g[j]);
            }
            if(s[j]=='G'){
                cnt+=b[j]*(r.back()-r[j])+r[j]*(b.back()-b[j]);
            }
            if(s[j]=='B'){
                cnt+=r[j]*(g.back()-g[j])+g[j]*(r.back()-r[j]);
            }
            int t = min(n-j-1,j);
            for(int i=1;i<=t;i++){
                if(s[j]!=s[j-i]&&s[j]!=s[j+i]&&s[j-i]!=s[j+i]){
                    cnt--;
                }
            }
        }
        out << cnt << endl;
	}
};


int main() {
	DRGBTriplets solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

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

int main() {
  int N, i, j, k, result;
  string S;
  cin >> N >> S;
  if (N == 1 || N == 2) {
    cout << '0' << endl;
  }
  result = 0;
  for (i = 0; i < N - 2; i++) {
    for (j = i + 1; j < N - 1; j++) {
      for (k = j + 1; k < N; k++) {
        if (j - i != k - j) {
          if (S[i] != S[j] && S[j] != S[k] && S[k] != S[i]) {
            result++;
          }
        }
      }
    }
  }
  cout << result << endl;
}

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

#include <bits/stdc++.h>
#define int long long
#define all(c) (c).begin(),(c).end()
#define pii pair<long long,long long>
#define endl '\n'

using namespace std;

signed main(){
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector <char> A(n,'a');
    for(int i=0;i<n;i++){
        cin >> A[i];
    }
    int ans=0;
    for(int i=0;i<n-2;i++){
        //if(A[i]=='R'){
            for(int j=i+1;j<n-1;j++){
                //if(A[j]=='G'){
                    for(int k=j+1;k<n;k++){
                        //if(A[k]=='B'){
                            if(k-j==j-i){
                                
                            }
                            else if(A[i]==A[j] || A[i]==A[k] || A[j]==A[k]){
                                
                            }
                            else ans++;
                        //}
                    }
                //}
            }
        //}
    }
    cout << ans;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) begin(x), end(x)
using namespace std;
typedef long long ll;
typedef pair <int,int> P;

int rgb[3][4005];

int main(){
  int n;
  string s;
  cin>>n>>s;
  rep(i,n){
    rep(j,3) rgb[j][i+1]+=rgb[j][i];
    if(s[i]=='R') rgb[0][i+1]++;
    else if(s[i]=='G') rgb[1][i+1]++;
    else rgb[2][i+1]++;
  }
  ll ans=0;
  string t="RGB";
  rep(i,n) rep(j,i){
    if(s[i]==t[0]&&s[j]==t[1]){
      int k=2*j-i;
      ans+=rgb[2][j];
      if(k>=0&&s[k]==t[2]) ans--;
    }
    if(s[i]==t[0]&&s[j]==t[2]){
      int k=2*j-i;
      ans+=rgb[1][j];
      if(k>=0&&s[k]==t[1]) ans--;
    }
    if(s[i]==t[1]&&s[j]==t[2]){
      int k=2*j-i;
      ans+=rgb[0][j];
      if(k>=0&&s[k]==t[0]) ans--;
    }
    if(s[i]==t[1]&&s[j]==t[0]){
      int k=2*j-i;
      ans+=rgb[2][j];
      if(k>=0&&s[k]==t[2]) ans--;
    }
    if(s[i]==t[2]&&s[j]==t[0]){
      int k=2*j-i;
      ans+=rgb[1][j];
      if(k>=0&&s[k]==t[1]) ans--;
    }
    if(s[i]==t[2]&&s[j]==t[1]){
      int k=2*j-i;
      ans+=rgb[0][j];
      if(k>=0&&s[k]==t[0]) ans--;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

//agrawal117
//chahatagrawal117
#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
typedef long long int ll;
using namespace std;
#define MAX 100005
vector<ll> v[4];
int idx(char a, char b)
{
    if(b=='R') swap(a,b);
    if(a=='R' && b=='G') return 3;
    if(a=='R' && b=='B') return 2;
    else return 1;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n; cin>>n;
    string s; cin>>s;
    
    for(int i=0;i<s.size();i++){
        if(s[i]=='R') v[1].push_back(i);
        else if(s[i]=='G') v[2].push_back(i);
        else v[3].push_back(i);
    }
    ll ans=0;
    for(int j=1;j<s.size()-1;j++){
        for(int i=0;i<j;i++){
            if(s[j]!=s[i]){
                int kk=idx(s[i],s[j]);
                int k=lower_bound(v[kk].begin(),v[kk].end(),j)-v[kk].begin();
                ans+=(v[kk].size()-k);
                 k=lower_bound(v[kk].begin(),v[kk].end(),2*j -i)-v[kk].begin();
                 if(v[kk][k]==(2*j)-i) ans--;
            }
        }
    }
    cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << #x << ": " << x << endl;
#else
    #define debug(x)
#endif

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll N;
    string S;
    cin >> N >> S;

    vll vr, vg, vb;
    rep(i, N) {
        if(S[i] == 'R') vr.push_back(i);
        if(S[i] == 'G') vg.push_back(i);
        if(S[i] == 'B') vb.push_back(i);
    }


    ll ans = 0;
    for(ll j = 1; j < N-1; j++) {
        if(S[j] == 'R') {
            ll left = vg.end() - lower_bound(vg.begin(), vg.end(), j);
            ll right = lower_bound(vb.begin(), vb.end(), j) - vb.begin();
            ans += left * right;
            left = vb.end() - lower_bound(vb.begin(), vb.end(), j);
            right = lower_bound(vg.begin(), vg.end(), j) - vg.begin();
            ans += left * right;
        }
        if(S[j] == 'G') {
            ll left = vr.end() - lower_bound(vr.begin(), vr.end(), j);
            ll right = lower_bound(vb.begin(), vb.end(), j) - vb.begin();
            ans += left * right;
            left = vb.end() - lower_bound(vb.begin(), vb.end(), j);
            right = lower_bound(vr.begin(), vr.end(), j) - vr.begin();
            ans += left * right;
        }
        if(S[j] == 'B') {
            ll left = vg.end() - lower_bound(vg.begin(), vg.end(), j);
            ll right = lower_bound(vr.begin(), vr.end(), j) - vr.begin();
            ans += left * right;
            left = vr.end() - lower_bound(vr.begin(), vr.end(), j);
            right = lower_bound(vg.begin(), vg.end(), j) - vg.begin();
            ans += left * right;
        }

        for(ll len = 1; j + len <= N-1; len++) {
            if(j - len < 0) continue;
            if(S[j-len] != S[j] && S[j-len] != S[j+len] && S[j] != S[j+len]) ans--;
        }
    }    
    cout << ans << endl;
}


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

def main():
    N = int(input())
    S = input()

    c = 0

    for i in range(N):
        for j in range(i, N):
            for k in range(j, N):
                if j - i != k - j and S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                    c += 1

    print(c)


if __name__ == '__main__':
    main()


Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def main():
      | ^~~
main.c: In function 'main':
main.c:1:11: error: expected declaration specifiers before ':' token
    1 | def main():
      |           ^
main.c:16:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   16 | if __name__ == '__main__':
      |                ^~~~~~~~~~
Language: C

#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 4010
using namespace std;
ll n,dp[N][4][4],ans=0;//'R'->0 'G'->1 'B'->2
vector<ll> v;
int main(){
	ll i,j,k,l;
	char c;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>c;
		if(c=='R')
		{
			v.push_back(0);
		}
		else if(c=='G')
		{
			v.push_back(1);
		}
		else
		{
			v.push_back(2);
		}
	}
	memset(dp,0,sizeof(dp));
	for(i=0;i<n;i++)
	{
		dp[i][v[i]][1]++;
		for(j=0;j<i;j++)
		{
			if(v[j]==v[i])
			{
				continue;
			}
			k=3;
			l=j-(i-j);
			if(l<0)
			{
				dp[i][v[j]][k]+=dp[j][0][k-1]+dp[j][1][k-1]+dp[j][2][k-1];
			}
			else if(v[l]==v[j]||v[l]==v[i])
			{
				dp[i][v[j]][k]+=dp[j][0][k-1]+dp[j][1][k-1]+dp[j][2][k-1];
			}
			else
			{
				dp[i][v[j]][k]+=dp[j][0][k-1]+dp[j][1][k-1]+dp[j][2][k-1]-1;
			}
			dp[i][v[j]][k]-=dp[j][v[i]][k-1];
			k=2;
			dp[i][v[j]][k]+=dp[j][v[j]][k-1];
		}
	}
	for(i=0;i<n;i++)
	{
		ans+=dp[i][0][3]+dp[i][1][3]+dp[i][2][3];
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi =vector<vi>;

int counter(vector<string>A,char x){
  int count = 0;
  for(int i=0;i<A.size();i++) if(A[i]==x) count++;
  return count;
}
int main(){
  int n;
  vector<pair<strung,int>>S(n+1);
  for(int i=1;i<=n;i++){
    cin >> S[i].first;
    S[i].second = i
  }
  int p=counter(S,'R');
  int q=counter(S,'G');
  int r=counter(S,'B');
  int ans = p*q*r;
  for(int i=1;i<=p;i++){
    for(int j=p+1;j<=q;j++){
      for(int k=q+1;k<=r;k++){
        if(j-i==k-j) ans--;
      }
    }
  }
  
  cout << ans << endl;
}
  
  

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

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

int main(void) {
    int N;
    cin >> N;
    string S;
    cin >> S;
    if (N < 3) {
        printf("0\n");
        return 0;
    }
    int same = 0;
    for (int l = 3; l <= N; l += 2) {
        same += (N - l + 1);
    }
    int sameS = 0, sameSsame = 0;
    for (int i = 0; i < N - 2; i++) {
        for (int j = i + 1; j < N - 1; j++) {
            for (int k = j + 1; k < N; k++) {
                if (S[i] == S[k] || S[i] == S[j] || S[j] == S[k]) {
                    ++sameS;
                    if (j - i == k - j) {
                        ++sameSsame;
                    }
                }
            }
        }
    }
    int ans = N * (N - 1) * (N - 2) / 6;
    ans = ans - same - sameS + sameSsame;
    printf("%d\n", ans);
    return 0;
}


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

#include<bits/stdc++.h> 

using namespace std;

typedef short sho;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
typedef string str; 
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll; 
typedef pair<ld,ld> pld;
 
typedef vector<int> vi; 
typedef vector<ll> vl; 
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pld> vpd;

#define LOCAL
#define MP make_pair 
#define FF first
#define SS second
#define sz(x) (int)x.size()
#define begin(x) (x).begin() 
#define end(x) (x).end()
#define rbegin(x) (x).rbegin()
#define rend(x) (x).rend()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define PF push_front 
#define PB push_back
#define PP push
#define lb lower_bound 
#define ub upper_bound
#define lowbit(x) x&(-x)
#define testbit(x,i) x&(1<<i)

inline void checkmin(int &x,int y){x=min(x,y);}
inline void checkmax(int &x,int y){x=max(x,y);}

int n;
str s;

int type[4010];
vi pos[3];
ll ans = 0;

int main() 
{
	#ifndef LOCAL
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /* start code */
    cin>>n>>s;
    for(int i = 0; i < n; i++)
    {
    	if(s[i] == 'R') pos[0].PB(i);
    	else if(s[i] == 'G') pos[1].PB(i);
    	else pos[2].PB(i);
	}
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'R') type[i] = 0;
		else if(s[i] == 'G') type[i] = 1;
		else type[i] = 2; 
	}
	for(int i = 0; i < n; i++) for(int k = i + 2; k < n; k++)
	{
		if(type[i] == type[k]) continue; 
		int type_j = 3 - type[i] - type[k];
		int low_pos = lower_bound(all(pos[type_j]), i) - begin(pos[type_j]);
		int high_pos = lower_bound(all(pos[type_j]), k) - begin(pos[type_j]);
		if(high_pos)
		{
			ans += high_pos - low_pos;
			if((k - i) % 2 == 0 && type[(k + i) / 2] == type_j) ans--;
		}
	}
	cout<<ans<<endl;
    /* end code */
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
// Welcome to my source code!

int main() {
    int n;
    string s;
    cin >> n >> s;
    int R[n + 1], G[n + 1], B[n + 1];
    R[0] = G[0] = B[0] = 0;
    for (int i = 1; i <= n; i++) {
        R[i] = R[i - 1];
        G[i] = G[i - 1];
        B[i] = B[i - 1];
        if (s[i - 1] == 'R') R[i]++;
        else if (s[i - 1] == 'G') G[i]++;
        else B[i]++;
    }
    ll ans = 0;
    for (int i = 0; i < n - 2; i++) {
        for (int j = i + 1; j < n - 1; j++) {
            if (s[i] == s[j]) continue;
            bool r = false, g = false, b = false;
            if (s[i] == 'R' || s[j] == 'R') r = true;
            if (s[i] == 'G' || s[j] == 'G') g = true;
            if (s[i] == 'B' || s[j] == 'B') b = true;
            if (!r) {
                int t = j - i;
                ans += R[n];
                if (1 <= j + t + 1 && j + t + 1 <= n) {
                    ans -= R[j + t + 1];
                    ans += R[j + t + 1] - (R[j + t + 1] - R[j + t]);
                }
                ans -= R[j + 1];
            } else if (!g) {
                int t = j - i;
                ans += G[n];
                if (1 <= j + t + 1 && j + t + 1 <= n) {
                    ans -= G[j + t + 1];
                    ans += G[j + t + 1] - (G[j + t + 1] - G[j + t]);
                }
                ans -= G[j + 1];
            } else {
                int t = j - i;
                ans += B[n];
                if (1 <= j + t + 1 && j + t + 1 <= n) {
                    ans -= B[j + t + 1];
                    ans += B[j + t + 1] - (B[j + t + 1] - B[j + t]);
                }
                ans -= B[j + 1];
            }
        }
    }
    cout << ans << endl;
}

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

#include<stdio.h>

int main(void){
	int n,r=0,g=0,b=0;
	char s[4000];
	int sum,dis=0;
	scanf("%d",&n);
	scanf("%s",s);
	for(int i=0;i<n;i++){
		if(s[i]==R){
			r+=1;
		}else if(s[i]==G){
			g+=1;
		}else{
			b+=1;
		}
	}
	sum=r*g*b;
	for(int i=0;i<n-2;i++){
		for(int j=i+1;j<n-1;j++){
			if(s[i]!=s[j]){
				if(2*j-1<n&&s[2*j-1]!=s[j]&&s[2*j-i]!=s[i]){
					dim+=1;
				}
			}
		}
	}
	printf("%d",sum-dis);
}

Compiler output:
main.c: In function 'main':
main.c:10:26: error: 'R' undeclared (first use in this function)
   10 |                 if(s[i]==R){
      |                          ^
main.c:10:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:32: error: 'G' undeclared (first use in this function)
   12 |                 }else if(s[i]==G){
      |                                ^
main.c:23:41: error: 'dim' undeclared (first use in this function); did you mean 'dis'?
   23 |                                         dim+=1;
      |                                         ^~~
      |                                         dis
Language: C++

#include <iostream>
#include <vector>
#include <boost/integer/common_factor_rt.hpp> // gcd, lcm
using namespace std;
int main() {
  int N;
  cin >> N;
  string S[N];
  for(int i=0;i<N;i++){
    cin >> S[i];
  }
  int total = 0;
  for(int i=1;i<=N;i++){
    for(int j=1;j<=N;j++){
      for(int k=1;k<=N;k++){
        if((j-i) != (k-i)){
          if((S[i-1]!= S[j-1]) && (S[i-1]!=S[k-1]) && (S[j-1]) != S[k-1]){
            total++;
        }
      }
    }
  }
  cout << total << endl;
  return 0;
}

Compiler output:
a.cc:3:10: fatal error: boost/integer/common_factor_rt.hpp: No such file or directory
    3 | #include <boost/integer/common_factor_rt.hpp> // gcd, lcm
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

//def
#define debug(x) cout << #x << ": " << x << '\n'
#define out(x) cout << x << '\n'
#define repeat(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define revrepeat(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define foreach(e, v) for (auto &e : v)
#define all(x) (x).begin(), (x).end()
#define CYES cout << "Yes" << endl
#define CNO cout << "No" << endl
#define SPC(x) cout << fixed << setprecision(x)
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;
typedef vector<vector<ll>> vll;
typedef pair<int, int> P;
constexpr int MOD = 1e9 + 7;
constexpr int INF = __INT_MAX__;               // 2^31 - 1
constexpr long long INFLL = __LONG_LONG_MAX__; // 2^61 - 1
constexpr int MAX_N = 1e5 + 5;
constexpr double PI = acos(-1);

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

    int n;
    string s;
    cin >> n >> s;
    vector<int> cnt_r, cnt_g, cnt_b;
    rep(i, n) {
        if (s[i] == 'R') cnt_r.push_back(i);
        if (s[i] == 'G') cnt_g.push_back(i);
        if (s[i] == 'B') cnt_b.push_back(i);
    }

    ll ans = cnt_r.size() * cnt_g.size() * cnt_b.size();

    rep(i, cnt_r.size()) {
        rep(j, cnt_g.size()) {
            int r = cnt_r[i];
            int g = cnt_g[j];
            int diff = max(r, g) - min(r, g);
            if (diff % 2 == 0) {
                if (find(all(cnt_b), diff / 2 + min(r, g)) != cnt_b.end()) ans--;
            }
            if (find(all(cnt_b), diff + max(r, g)) != cnt_b.end()) ans--;
            if (find(all(cnt_b), min(r, g) - diff) != cnt_b.end()) ans--;
        }
    }

    out(ans);

    return 0;
}


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

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

using namespace std;
#define inputInt(a) int a; cin >> a; 
#define inputInt2(a,b) int a; int b; cin >> a >> b; 
#define inputInt3(a,b,c) int a; int b; int c; cin >> a >> b >> c;
#define inputLong(a) long a;cin >> a; 
#define inputIntArray(a,N) int a[N];for(int i=0;i<N;i++){cin >> a[i];}
#define inputLongArray(a,N) long a[N];for(int i=0;i<N;i++){cin >> a[i];}
#define inputIntArray2(a,b,N) int a[N]; int b[N]; for(int i=0;i<N;i++){cin >> a[i] >> b[i];}
#define output(answer) cout << answer << endl;
#define fN(i,N)    for(int i=0; i<N; i++)
#define fSE(i,s,e) for(int i=s; i<=e; i++)
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i,N) for(int i=0; i<N; i++)
#define cinv(v,N) vector<int> v(N); for(int i=0; i<N; i++){ cin >> v[i]; }
#define mt make_tuple
#define vll vector<long long int>
#define vvll vector<vector<long long int>>
#define all(v) (v).begin(),(v).end()
const ll MOD2 = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main()
{
  //input
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll N; string S;
  cin >> N; cin >> S;
  
  ll red=0, green=0, blue=0;
  for(int i=0; i<N; i++){
    if(S[i]=='R'){
      red ++; 
    }else if(S[i]=='G'){
      green ++; 
    }else{
      blue ++; 
    }
  }
  
  //main
  ll ans = red*green*blue;
  //cout << ans << endl;
  for(int i=0; i<N; i++){
    if(S[i]=='G'){
      for(int j=0; j<N; j++){
        if(S[j]=='B'){
          if(i>j){
            if((i-j-1)%2==1 && S[(i+j)/2]=='R'){
              ans -= 1; 
            }
            if(0<=2*j-i && 2*j-i<=N-1 && S[2*j-i]=='R'){
              ans -= 1; 
            }
            if(0<=2*i-j && 2*i-j<=N-1 && S[2*i-j]=='R'){
              ans -= 1;
            }
          }else if(i<j){
            if((j-i-1)%2==1 && S[(i+j)/2]=='R'){
              ans -= 1; 
            }
            if(0<=2*i-j && 2*i-j<=N-1 && S[2*i-j]=='R'){
              ans -= 1; 
            }
            if(0<=2*j-i && 2*j-i<=N-1 && S[2*j-i]=='R'){
              ans -= 1;
            }
          }
        }
      }
    }
  }
  
  // output
  cout << ans << endl;

  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++);
#define ll long long
int main(){
	ll n,count=0;
	string s;
	cin >> n >> s;
	vector<int> r;
	vector<int> g;
	vector<int> b;
	for(int i=0;i<n;i++){
		if(s[i]=='R')r.push_back(i);
		else if(s[i]=='G')g.push_back(i);
		else if(s[i]=='B')b.push_back(i);
	}
	for(int i:r){
		for(int j:g){
			for(int k:b){
				if(i<j&&j<k&&k-j!=j-i)count++;
			}
		}
	}
	cout << count << endl;
}


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

#include <iostream>
#include <string>

using namespace std;

int main(){
	string x;
	long long cnt;
	cin >> x;
	cnt = 0;
	for (int i = 0; i < x.length; i++)
	{
		for (int j = 0; j < x.length; j++)
		{
			for (int k = 0; k < x.length; k++)
			{
				if(2 * (j + 1) == i + k + 2 );
					continue;
				if(x[i] != x[j] && x[j] != x[k] && x[k] != x[j])
					cnt++;
				
			}		
		}
	}
	cout << cnt << endl;
	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |         for (int i = 0; i < x.length; i++)
      |                             ~~^~~~~~
      |                                     ()
a.cc:13:39: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 |                 for (int j = 0; j < x.length; j++)
      |                                     ~~^~~~~~
      |                                             ()
a.cc:15:47: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   15 |                         for (int k = 0; k < x.length; k++)
      |                                             ~~^~~~~~
      |                                                     ()
Language: C

#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    string s;
    int n;
    cin >> n >> s;
    for (int i = 0; i < n; ++i)
    {
        if (s[i] == 'R')
            s[i] = '0';
        if (s[i] == 'G')
            s[i] = '1';
        if (s[i] == 'B')
            s[i] = '2';
    }
    ll odp = 0;
    vector< vector<ll> > il(n, vector<int>(3, 0));
    ++il[n - 1][s[n - 1] - '0'];
    for (int i = n - 2; i >= 0; --i)
    {
        il[i][0] = il[i + 1][0];
        il[i][1] = il[i + 1][1];
        il[i][2] = il[i + 1][2];
        ++il[i][s[i] - '0'];
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j < n - 1; ++j)
        {
            if (s[i] == s[j])
                continue;
            int r = 3 - (s[i] - '0') - (s[j] - '0');
            odp += il[j + 1][r];
            if (j + (j - i) < n && s[j + (j - i)] - '0' == r)
                --odp;
        }
    }
    cout << odp;
    return 0;
}


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

#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pllll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  ll n;
  cin >> n;
  // ll n, m;
  // cin >> n >> m;
  // ll n, m, k;
  // cin >> n >> m >> k;
  string s;
  cin >> s;
  fi(0, n - 2)
    fj(i + 1, n - 1) {
      if(s[i] == s[j]) continue;
      string x = "RGB";
      x.erase(remove(x.begin(), x.end(), s[i]), x.end());
      x.erase(remove(x.begin(), x.end(), s[j]), x.end());
      int cnt = count(s.begin() + j + 1, s.end(), x[0]);
      if(s[j + j - i] == x[0])
        cnt--;
      ans += cnt;
    }
  // string x = "RGB";
  // x.erase(remove(x.begin(), x.end(), 'R'), x.end());
  // cout << x;
  cout << ans << endl;
  return 0;
}



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

Given is an integer sequence 
A
1
,
.
.
.
,
A
N
 of length 
N
.

We will choose exactly 
⌊
N
2
⌋
 elements from this sequence so that no two adjacent elements are chosen.

Find the maximum possible sum of the chosen elements.

Here 
⌊
x
⌋
 denotes the greatest integer not greater than 
x
.

Compiler output:
a.cc:16:1: error: extended character ⌊ is not valid in an identifier
   16 | ⌊
      | ^
a.cc:19:1: error: extended character ⌋ is not valid in an identifier
   19 | ⌋
      | ^
a.cc:25:1: error: extended character ⌊ is not valid in an identifier
   25 | ⌊
      | ^
a.cc:27:1: error: extended character ⌋ is not valid in an identifier
   27 | ⌋
      | ^
a.cc:1:1: error: 'Given' does not name a type
    1 | Given is an integer sequence
      | ^~~~~
Language: C


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define sz(a)       (ll)(a.size())
#define cr(P)       cout<<P<<"\n";return;
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)
using namespace std;


const ll N   =  500005;
const ll mod = 1e9 + 7;

ll f(vector<ll> a,vector<ll> b,vector<ll> c){
	ll ans =0,x;
	for(auto i : a){
		for(auto j : b){
			if(j> i){
				//cout << i << " "<<j <<" "<< 2 * j - i<<"\n";
				x = c.size() - (upper_bound(c.begin(), c.end(),j) -c.begin());
			if(x>0 and binary_search(c.begin(), c.end(),2*j-i)){
				ans +=x-1;
			}
			else ans+=x;
			}
		}
	}
	return ans;
}

void solve(){
vector<ll>v[3];

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
 	string s;
 	cin>>s;
 	for (ll i = 0; i < n; ++i){
 			
 		if(s[i]=='R')
 			v[0].pb(i+1);
 		else if(s[i]=='G')
 			v[1].pb(i+1);
 		else v[2].pb(i+1);
 	}

 	ans+=f(v[1],v[2],v[0]) + f(v[1],v[0],v[2]) + f(v[0],v[2],v[1])+ f(v[0],v[1],v[2])
 	 + f(v[2],v[1],v[0]) + f(v[2],v[0],v[1]) ;
 	c(ans);
}

signed main(){
     
  ios_base::sync_with_stdio(false);   
  cin.tie(NULL);
  //int T;cin >> T;while (T--)
  solve();
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)


int main(){
  int  n;
  cin >> n ;
  vector<char> s(n);
 rep(i,n) cin >> s.at(i);
  ll sum=0;
  rep(i,n-2){
    for(int j=i+1;j<n-1;j++){
      for(int k=j+1;k<n;k++){
        if(s.at(i)=='R' && s.at(j)=='G' && s.at(k)=='B'){
          if(k-j!=j-i)sum++;
        }
        if(s.at(i)=='R' && s.at(j)=='B' && s.at(k)=='G'){
          if(k-j!=j-i)sum++;
        }
        if(s.at(i)=='G' && s.at(j)=='R' && s.at(k)=='B'){
          if(k-j!=j-i)sum++;
        }
        if(s.at(i)=='G' && s.at(j)=='B' && s.at(k)=='R'){
          if(k-j!=j-i)sum++;
        }
        if(s.at(i)=='B' && s.at(j)=='G' && s.at(k)=='R'){
          if(k-j!=j-i)sum++;
        }
        if(s.at(i)=='B' && s.at(j)=='R' && s.at(k)=='G'){
          if(k-j!=j-i)sum++;
        }
      }
    }
  }
   cout << sum << endl;
            
          
   
}
  

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

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

int main() {
  int n; cin >> n;
  string s; cin >> s;
  long long tmp = 0;
  for(int i = 0; i < n - 2; i++){
    for(int j = i + 1; j < n -1; j++){
      if(s.at(i) != s.at(j)){
        if(s.at(j) != s.at(2 * j - i)){
          if(s.at(i) != s.at(2 * j - i)) tmp++;
        }
      }
    }
  }
  int r=0, g=0, b=0;
  for(int i = 0; i < n; i++){
    if(s.at(i) == 'R'){
      r++;
    }else if(s.at(i) == 'G'){
      g++;
    }else{
      b++;
    }
  }
  long long out = r * g * b;
  cout << out - tmp;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n;
	string s;
	cin >> n >> s;
	ll sum=0;
	for(int i=0;i<n){
		for(int j=i+1;j<n;j++){
			if(s[j]==s[i]) continue;
			for(int k=j+1;k<n;k++){
				if(k-j==j-i) continue;
				if(s[k]==s[i]||s[k]==s[j]) continue;
				sum++;
			}
		}
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before ')' token
    9 |         for(int i=0;i<n){
      |                        ^
      |                        ;
Language: C

//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

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

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


// CHECK THE LIMITS
typedef long long ll;

const int MOD = 1000000007;
const ll INFLL = 1e18;
const int INF = 1e9;
const int NMAX = 1000001;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 

int col[4005][3];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

	int n;
	string s;
	cin >> n >> s;

	vector<int> r(n),g(n),b(n);
	for(int i = 0; i< n; ++i)
	{
		if(i)
		{
			col[i][0] = col[i-1][0];
			col[i][1] = col[i-1][1];
			col[i][2] = col[i-1][2];
		}
		if(s[i] == 'R')
			col[i][0]++;
		else if(s[i] == 'G')
		{
			col[i][1]++;
		}
		else
		{
			col[i][2]++;
		}
	}

	int sum = 0;
	for(int i = 0; i< n; ++i)
	{
		for(int j = i+1; j< n; ++j)
		{
			if(s[i] != s[j])
			{
				if('R' != s[i] && 'R' != s[j])
				{
					sum+= col[n-1][0] - col[j][0];
					if(j + (j-i) < n && s[j + (j-i)] == 'R')
						sum--;
				}
				if('G' != s[i] && 'G' != s[j])
				{
					sum+= col[n-1][1] - col[j][1];
					if(j + (j-i) < n && s[j + (j-i)] == 'G')
						sum--;
				} 
				if('B' != s[i] && 'B' != s[j])
				{
					sum+= col[n-1][2] - col[j][2];
					if(j + (j-i) < n && s[j + (j-i)] == 'B')
						sum--;
				} 
			}
		}
	}
	cout << sum;

    return 0;
}

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

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

ll gcd(ll a, ll b) {
	if (a < b) swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}

int main()
{
    int k;cin>>k;
    ll ans=0;
    repd(i,1,k+1){
        repd(j,1,k+1){
            repd(l,1,k+1){
                int tmp = gcd(j,l);
                if(tmp == 1)ans++;
                else ans += gcd(i,tmp)
            }
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:39: error: expected ';' before '}' token
   22 |                 else ans += gcd(i,tmp)
      |                                       ^
      |                                       ;
   23 |             }
      |             ~