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

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    string s;
    cin >> n >> s;
    int r=0,g=0,b=0;
    rep(i,n) {
        if(s[i] == 'R') r++;
        else if(s[i] == 'G') g++;
        else b++;
    }
    ll ans = r*g*b;
    rep(i,n-1) rep2(j,i+1,n) {
        if(s[i] == s[j]) continue;
        int k = 2*j-i;
        if(k < n && s[k] != s[i] && s[k] != s[j]) ans--;
    }
    cout << ans << endl;
}


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 lint = long long;

signed main(){
  lint N; cin >> N;
  string s; cin >> s;
  lint cg = 0, cr  =0, cb = 0;
  for(lint i = 0; i < N; i++){
    if(s[i] == 'R') cr++;
    if(s[i] == 'G') cg++;
    if(s[i] == 'B') cb++;
  }
  lint ans = cg * cr * cb;
  for(lint i = 1; i <= N/2; i++){
    for(lint j = 0; j < N; j++){
      lint x = j, y = j + i, z = j + 2*i;
      if(y >= N || z >= N) continue;
      else if(s[x] != s[y] && s[y] != s[z] && s[x] != s[z]) 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>
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define perm(c) sort(ALL(c));for(bool c##p=1;c##p;c##p=next_permutation(ALL(c)))
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MAX max<ll>
#define MIN min<ll>
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define drop(x) cout << (x) << '\n', exit(0)
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
typedef vector<ll> vec;
typedef vector<vector<ll>> vec2;
typedef vector<vector<vector<ll>>> vec3;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll devc(ll x, ll y) { return (x + y - 1) / y; }

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

    ll N;
    cin >> N;
    string S;
    cin >> S;
    ll r = 0, g = 0, b = 0;
    for(auto c : S){
        if(c == 'R') ++r;
        else if(c == 'G') ++g;
        else ++b;
    }

    ll ans = r * g * b;

    rep(i, N) rep(j, N) if(i < j){
        ll k = 2 * j - i;
        if(k < N) if(S[i] == 'R' and S[j] == 'G' and S[k] == 'B') --ans;
    }

    print(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 long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    string S;
    cin >> S;
    ll r = 0, g = 0, b = 0;
    REP(i, N) {
        if (S[i] == 'R')
            r++;
        else if (S[i] == 'G')
            g++;
        else
            b++;
    }

    ll ans = r * g * b;
    FOR(i, N, 2) {
        REP(j, i) {
            ll d = i - j;
            if (j - d >= 0) {
                if (S[i] != S[j] && S[j] != S[j - d] && S[i] != S[j - 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

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

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

	ll n;
	string s;
	cin >> n >> s;
	ll r = 0, g = 0, b = 0;
	for (ll i = 0; i < n; i++) {
		if (s[i] == 'R') r++;
		else if (s[i] == 'G') g++;
		else b++;
	}
	ll ans = r * g * b;
	for (ll i = 0; i < n - 2; i++) {
		for (ll j = i + 1; j < n - 1; j++) {
			ll k = 2 * j - i;
			if (k < n) {
				if (s[i] != s[j] && s[j] != s[k] && s[k] != s[i]) ans--;
			}
		}
	}
	cout << ans << endl;
}


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

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n;
    string s;
    cin >> n >> s;

    ll cntR = 0, cntG = 0, cntB = 0;
    rep(i, n) {
        if(s[i] == 'R') {
            cntR++;
        }
        if(s[i] == 'G') {
            cntG++;
        }
        if(s[i] == 'B') {
            cntB++;
        }
    }

    ll ans = cntR*cntG*cntB;
    exrep(i, 0, n-2) {
        exrep(j, i+1, n-1) {
            ll k = 2*j - i;
            if(n <= k) {
                continue;
            }
            if(s[i] != s[j] && s[j] != s[k] && s[k] != s[i]) {
                ans--;
            }
        }
    }
    
    out(ans);
    re0;
}

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>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(n) begin(n),end(n)
using ll = long long;
using P = pair<int,int>;

int main() {
    int n; cin >> n;
    string s; cin >> s;
  
    int r=0, g=0, b=0;
    rep(i,n) {
        if(s[i]=='R') r++;
        if(s[i]=='G') g++;
        if(s[i]=='B') b++;
    }  
    ll  ans = r*g*b;

    rep(i,n) {
        for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
            if(s[i]!=s[j] && s[i]!=s[k] && s[j]!=s[k]) ans--;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: expected unqualified-id before 'int'
   22 |         for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
      |                          ^~~
a.cc:22:25: error: expected ';' before 'int'
   22 |         for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
      |                         ^~~~
      |                         ;
a.cc:22:50: error: expected ')' before ';' token
   22 |         for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
      |            ~                                     ^
      |                                                  )
a.cc:22:53: error: 'j' was not declared in this scope
   22 |         for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
      |                                                     ^
a.cc:22:58: error: 'k' was not declared in this scope
   22 |         for(int j = i-1, int k = i+1; j>=0 && k<n;--j, ++k) {
      |                                                          ^
Language: C

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

int main() {
    int n; cin >> n;
    string s; cin >> s;
    ll  ans = 0;
    for(int i = 0; i <= n-3; ++i){
        for(int j = i+1; j <= n-2; ++j){
            for(int k = j+1; k <= n-1; ++k) {
                if(j-i == k-j) continue;
                if(s[i]==s[j] || s[i]==s[k] || s[j]==s[k]) continue;
                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<bits/stdc++.h>
using namespace std;
int main(){
    long long n, i, j, k, ans=0, r[10000]={0}, g[10000]={0}, b[10000]={0};
    string s;
    cin >> n >> s;
    for(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]++;
    }
    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if((s[i]=='R' && s[j]=='G') || (s[i]=='G' && s[j]=='R')) {
                ans+=b[n]-b[j+1];
                if(s[2*j-i]=='B') ans--;
            }
            else if((s[i]=='R' && s[j]=='B') || (s[i]=='B' && s[j]=='R')) {
                ans+=g[n]-g[j+1];
                if(s[2*j-i]=='G') ans--;
            }
            else if((s[i]=='G' && s[j]=='B') || (s[i]=='B' && s[j]=='G')) {
                ans+=r[n]-r[j+1];
                if(s[2*j-i]=='R') ans--;
            }
        }
    }
    cout << ans <<endl;
}

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 <iostream>
#include <string>
using namespace std;

unsigned int colors(char c) {
  switch (c) {
    case 'R': return 0x4;
    case 'G': return 0x2;
    case 'B': return 0x1;
  }
  return 0x0;
}

int main()
{
  int N;
  string S;
  cin >> N >> S;
  int rgb[3] = {0};
  for (int i = 0; i < N; i++) {
    switch (S[i]) {
      case 'R': rgb[0]++; break;
      case 'G': rgb[1]++; break;
      case 'B': rgb[2]++; break;
    }
  }
  long long ans = (long long)rgb[0]*rgb[1]*rgb[2];
  for (int space = 1; space < N; space++) {
    for (int i = 0; (i+space*2) < N; i++) {
      for (int j = i+space; j < N; j+=space) {
        for (int k = j+space; k < N; k+=space) {
          if ((colors(S[i])|colors(S[j])|colors(S[k])==0x7) {
            ans--;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:60: error: expected ')' before '{' token
   32 |           if ((colors(S[i])|colors(S[j])|colors(S[k])==0x7) {
      |              ~                                             ^~
      |                                                            )
a.cc:35:9: error: expected primary-expression before '}' token
   35 |         }
      |         ^
Language: C++

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

unsigned int colors(char c) {
  switch (c) {
    case 'R': return 0x4;
    case 'G': return 0x2;
    case 'B': return 0x1;
  }
  return 0x0;
}

int main()
{
  int N;
  string S;
  cin >> N >> S;
  int rgb[3] = {0};
  for (int i = 0; i < N; i++) {
    switch (S[i]) {
      case 'R': rgb[0]++; break;
      case 'G': rgb[1]++; break;
      case 'B': rgb[2]++; break;
    }
  }
  long long ans = (long long)rgb[0]*rgb[1]*rgb[2];

  for (int space = 1; space < N; space++) {
    for (int i = 0; (i+space*2) < N; i++) {
      for (int j = i+space; j < N; j+=space) {
        for (int k = j+space; k < N; k+=space) {
          if ((colors(S[i])|colors(S[j])|colors(S[k])==0x7) {
            ans--;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    ll count[3] = {};
    for(int i = 0;i < n;i++)
    {
        if(s[i] == 'R')
        {
            count[0]++;
        }
        else if(s[i] == 'G')
        {
            count[1]++;
        }
        else
        {
            count[2]++;
        }
    }
    ll ans = count[0] * count[1] * count[2];
    for(int i = 1;i + 1 < n;i++)
    {
        for(int j = 1;i + j < n && i - j >= 0;j++)
        {
            if(s[i] != s[i - j] && s[i] != s[i + j] && s[i - j] != s[i + j])
            {
                ans--;
            }
        }
    }
    cout << ans << "\n";

    return 0;
}

Compiler output:
main.c:2:10: 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;

int main(){
    int N;
    cin >> N;
    vector<char> S(N);
    long long count_R = 0, count_G = 0, count_B = 0;
    for (int i = 0; i < N; i++){
        cin >> S.at(i);
        if (S.at(i) == 'R') count_R ++;
        else if (S.at(i) == 'G') count_G ++;
        else if (S.at(i) == 'B') count_B ++;
    }
    long long ans;
    long long decount = 0;
    if (N > 2){
        for (int i = 0; i < N - 2; i++){
            for(int j = i + 1; j < N - 1; j++){
                if ((2 * j - i >= 0) && (2 * j - i < N) ){
                    //cout << "i " << i << " j " << j << " k " << 2*j - i << endl;
                    if ((S.at(i) != S.at(j)) && (S.at(i) != S.at(2 * j - i)) && (S.at(j) != S.at(2 * j - i))){
                        decount++;
                    }
                    else{
                        continue;
                    }
                }
                else{
                    continue;
                }
            }
        }
        ans = count_R * count_G * count_B - decount;
        //cout << count_R << " " << count_G << " " << count_B << " " << decount << endl;
    }
    else{
        ans = 0;
    }
    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(){
    int N;
    cin >> N;
    vector<char> S(N);
    long long count_R = 0, count_G = 0, count_B = 0;
    for (int i = 0; i < N; i++){
        cin >> S.at(i);
        if (S.at(i) == 'R') count_R ++;
        else if (S.at(i) == 'G') count_G ++;
        else if (S.at(i) == 'B') count_B ++;
    }
    long long ans;
    long long decount = 0;
    if (N > 2){
        for (int i = 0; i < N - 2; i++){
            for(int j = i + 1; j < N - 1; j++){
                if ((2 * j - i >= 0) && (2 * j - i < N) ){
                    //cout << "i " << i << " j " << j << " k " << 2*j - i << endl;
                    if ((S.at(i) != S.at(j)) && (S.at(i) != S.at(2 * j - i)) && (S.at(j) != S.at(2 * j - i))){
                        decount++;
                    }
                    else{
                        continue;
                    }
                }
                else{
                    continue;
                }
            }
        }
        ans = count_R * count_G * count_B - decount;
        //cout << count_R << " " << count_G << " " << count_B << " " << decount << endl;
    }
    else{
        ans = 0;
    }
    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(){
    int N;
    cin >> N;
    vector<char> S(N);
    long long count_R = 0, count_G = 0, count_B = 0;
    for (int i = 0; i < N; i++){
        cin >> S.at(i);
        if (S.at(i) == 'R') count_R ++;
        else if (S.at(i) == 'G') count_G ++;
        else if (S.at(i) == 'B') count_B ++;
    }
    long long ans;
    long long decount = 0;
    if (N > 2){
        for (int i = 0; i < N - 2; i++){
            for(int j = i + 1; j < N - 1; j++){
                if ((2 * j - i >= 0) && (2 * j - i < N) ){
                    //cout << "i " << i << " j " << j << " k " << 2*j - i << endl;
                    if ((S.at(i) != S.at(j)) && (S.at(i) != S.at(2 * j - i)) && (S.at(j) != S.at(2 * j - i))){
                        decount++;
                    }
                    else{
                        continue;
                    }
                }
                else{
                    continue;
                }
            }
        }
        ans = count_R * count_G * count_B - decount;
        //cout << count_R << " " << count_G << " " << count_B << " " << decount << endl;
    }
    else{
        ans = 0;
    }
    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, answer = 0;
    char S[4000];
    scanf("%d", &N);
    scanf("%s", S);
    answer = N*(N-1)*(N-2)/6;

    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] || (j-i) == (k-j))
                {
                    answer --;
                }
                
            }
            
        }
        
    }

    printf("%d", answer);
    
    return 0;

Compiler output:
main.c: In function 'main':
main.c:31:5: error: expected declaration or statement at end of input
   31 |     return 0;
      |     ^~~~~~
Language: C

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

int main() {
  int N; string S; cin >> N >> S;
  int r,g,b,rg,gb,br,rgb;
  r=g=b=rg=gb=br=rgb=0;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'R') { r++; rg += g; br += b; rgb += gb; }
    else if (S[i] == 'G') { g++; rg += r; gb += b; rgb += br; }
    else if (S[i] == 'B') { b++; gb += g; br += r; rgb += rg; }
  }
  for (int i = 0; i < N-2; i++) {
    for (int j = i+1; j < N-1; j++) {
      int k = 2 * j - i;
      if (k >= N) break;
      set<char> s;
      s.insert(S[i]);
      s.insert(S[j]);
      s.insert(S[k]);
      if (s.size() == 3) rgb--;
    }
  }
  cout << rgb << endl;
}


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

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;

#define int long long
#define FOR(a, b, c) for(int a = b, _c = c; a <= _c; ++a)
#define ROF(a, b, c) for(int a = b, _c = c; a >= _c; --a)
#define REP(a, b, c) for(int a = b, _c = c; a < _c; ++a)
#define VEC(a, b) for(auto &a : b)
#define ii pair <int, int>
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(), a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define sz(x) (int)(x.size())
#define bit(x, i) (x >> (i - 1) & 1ll)
#define onbit(x, i) (x | (1ll << (i - 1)))
#define offbit(x, i) (x & ~(1ll << (i - 1)))

template <class T> void Max(T &x, T y) { x = (x > y) ? x : y;}
template <class T> void Min(T &x, T y) { x = (x < y) ? x : y;}

#define debug(x) cerr << #x << '=' << x << '\n'
#define debugn(a, n) FOR(i, 1, n) cerr << a[i] << ' '
#define debugv(a) VEC(v, a) cerr << v << ' '

const int N = 4005;
int n;
string s;

main() {
  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  cin >> n >> s;
  s = ' ' + s;
  int x = 0, y = 0, z = 0;
  FOR(i, 1, n) {
    if(s[i] == 'R') x++;
    if(s[i] == 'G') y++;
    if(s[i] == 'B') z++;
  }
  int ans = x * y * z;
  FOR(i, 1, n) {
    FOR(j, i + 1, n) {
        int dis = j - i;
        int k = i + 2 * dis;
        if(k > n) continue;
        bool ok1 = 0, ok2 = 0, ok3 = 0;
        if(s[i] == 'R' || s[j] == 'R' || s[k] == 'R') ok1 = 1;
        if(s[i] == 'G' || s[j] == 'G' || s[k] == 'G') ok2 = 1;
        if(s[i] == 'B' || s[j] == 'B' || s[k] == 'B') ok3 = 1;
        ans -= (ok1 & ok2 & ok3);
    }
  }
  cout << ans << '\n';
}


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;
    char S[N];
    int r=0;int g=0;int b=0;
    for(int i=0;i<N;i++){
        cin >>S[i];
        if(S[i]=='R') r++;
        else if(S[i]=='G') g++;
        else if(S[i]=='B') b++;
    }
    long long  ans = r*g*b;
    for(int i=0;i<N-2;i++){
        for(int j=i+1;j<N-1;j++){
            if(j+j-i<N){
                if((S[j+j-i]!=S[j])&&(S[i]!=S[j])&&(S[i]!=S[j+j-i])) 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() {

int n;
int count=0;
cin >> n;
vector<char>s_list(n);
  
for (int a=0;a<n;a++){
  cin>>s_list.at(a);
}
  
vector<int>r_list(n,-1);
vector<int>g_list(n,-1);
vector<int>b_list(n,-1);
  
for (int i=0; i<n; i++){
  if (s_list.at(i)=='R'){
    r_list.at(i) = i;
  }else if (s_list.at(i)=='G'){
    g_list.at(i) = i;
  }else{
    b_list.at(i) = i;
  }
}

for (int pp=0; pp< r_list.size(); pp++ ){
  if (r_list.at(pp)==-1){
    continue;
  }
  for (int qq=0; qq< g_list.size(); qq++ ){
    if (g_list.at(qq)==-1){
      continue;
    }
    for (int rr=0; rr< b_list.size(); rr++ ){
      if (b_list.at(rr)==-1){
        continue;
      }else if (rr-pp!=pp-qq && rr-pp!=2*(qq-pp) && qq-pp!=2*(rr-pp)){
        count++;
      }
    }
  }  
}
cout << count << endl;

}


Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main() {
      | ~~~
Language: C

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

int main() {

int n;
int count=0;
cin >> n;
vector<char>s_list(n);
  
for (int a=0;a<n;a++){
  cin>>s_list.at(a);
}
  
vector<int>r_list(n,-1);
vector<int>g_list(n,-1);
vector<int>b_list(n,-1);
  
for (int i=0; i<n; i++){
  if (s_list.at(i)=='R'){
    r_list.at(i) = i;
  }else if (s_list.at(i)=='G'){
    g_list.at(i) = i;
  }else{
    b_list.at(i) = i;
  }
}

for (int pp=0; pp< r_list.size(); pp++ ){
  if (r_list.at(pp)==-1){
    continue;
  }
  for (int qq=0; qq< g_list.size(); qq++ ){
    if (g_list.at(qq)==-1){
      continue;
    }
    for (int rr=0; rr< b_list.size(); rr++ ){
      if (b_list.at(rr)==-1){
        continue;
      }else if (rr-pp!=pp-qq && rr-pp!=2*(qq-pp) && qq-pp!=2*(rr-pp)){
        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 <bits/stdc++.h>
using namespace std;

int main() {

int n;
int count=0;
cin >> n;
vector<char>s_list(n);
  
for (int a=0;a<n;a++){
  cin>>s_list.at(a);
}
  
vector<int>r_list(n,-1);
vector<int>g_list(n,-1);
vector<int>b_list(n,-1);
  
for (int i=0; i<n; i++){
  if (s_list.at(i)=='R'){
    r_list.at(i) = i;
  }else if (s_list.at(i)=='G'){
    g_list.at(i) = i;
  }else{
    b_list.at(i) = i;
  }
}

for (int pp=0; pp< r_list.size(); pp++ ){
  if (r_list.at(pp)==-1){
    continue;
  }
  for (int qq=0; qq< g_list.size(); qq++ ){
    if (g_list.at(qq)==-1){
      continue;
    }
    for (int rr=0; rr< b_list.size(); rr++ ){
      if (b_list.at(rr)==-1){
        continue;
      }else if (rr-pp!=pp-qq && rr-pp!=2*(qq-pp) && qq-pp!=2*(rr-pp)){
        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 <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<n;i++)
using namespace std;
using P = pair<int,int>;
using ll = long long;

//3つベクトルを作り、コンビネーションの要領で処理する
int main(){
  string s;
  int n;
  cin >> n;
  cin >> s;
  int ans=0;

  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      for(int k=j+1;k<n;k++){
        if(j-i != k-j && s[i] != s[j] &&
          s[i] != s[k] && s[k] != s[j]) 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 <bits/stdc++.h>
using namespace std;

#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for(int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;

const int maxn = 4e3 + 10;
const int inf = 0x3f3f3f3f;
const ll mod = 1e9 + 7;

char s[maxn];
int cnt[maxn][3];
int pos[26];
char st[] = {'R', 'G', 'B'};

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//  freopen(Task".inp", "r", stdin);
//  freopen(Task".out", "w", stdout);

  int n; cin >> n;
  cin >> s + 1;

  For (i, 0, 2){
    pos[st[i] -'A'] = i;
  }

  For(i, 1, n) For(j, 0, 2){
    cnt[i][j] = cnt[i-1][j];
    if (s[i] == st[j]) ++cnt[i][j];
  }
  int ans = 0;
  For(i, 1, n - 2) For (j, i + 1, n - 1){
    if (s[i] == s[j]) continue;
    int k = 3 - pos[s[i]-'A'] - pos[s[j]-'A'];
    ans += cnt[n][k] - cnt[j][k];
    int dif = j - i;
    if (j + dif <= n && pos[s[j+dif]-'A'] == k) --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>

using namespace std;

int main() {

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

	int r, g, b;
	r = 0;
	g = 0;
	b = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'R') { r++; }
		else if(s[i] == 'G') { g++; }
		else if(s[i] == 'B') { b++; }
	}

	long long total;
	total = long long(r * g * b);

	for (int i = 0; i < n-1; i++) {
		for (int j = i+1; j < n; j++) {
			if (j + j - i < n) {
				if (s[i] != s[j] && s[i] != s[j + j - i] && s[j] != s[j + j - i]) {
					total--;
				}
			}
		}
	}

	cout << total << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: expected primary-expression before 'long'
   23 |         total = long long(r * g * b);
      |                 ^~~~
Language: C

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

typedef long long int ll;
#define mamba() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
  mamba()
	ll n,i=0,j=0,cnt=0,k=0,l=0;cin>>n;string a;cin>>a;
  	for(i=0;a[i]!='\0';i++)
    {
    	if(a[i]=='R')
        {
          for(j=i+1;a[j]!='\0';j++)
          {
          	if(a[j]=='G')
            {
            	for(k=j+1;a[k]!='\0';k++)
                {
                	if(a[k]=='B'&&((j-i)!=(k-j)))
                      cnt++;
     
                }
            }
          }
        }
      	
    }
  cout<<cnt;
}

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;

int main() {

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

	int r, g, b;
	r = 0;
	g = 0;
	b = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'R') { r++; }
		else if(s[i] == 'G') { g++; }
		else if(s[i] == 'B') { b++; }
	}

	long long total;
	total = r * g*b;

	for (int i = 0; i < n-1; i++) {
		for (int j = i+1; j < n1; j++) {
			if (j + j - i < n) {
				if (s[i] != s[j] && s[i] != s[j + j - i] && s[j] != s[j + j - i]) {
					total--;
				}
			}
		}
	}

	cout << total << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:39: error: 'n1' was not declared in this scope; did you mean 'n'?
   26 |                 for (int j = i+1; j < n1; j++) {
      |                                       ^~
      |                                       n
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;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll N,r=0,b=0,g=0;
    string S;
    cin >> N >> S;
    
    for (int i=0; i<N; i++){
        if (S[i]=='R') r++;
        if (S[i]=='G') g++;
        if (S[i]=='B') b++;
    }
    
    ll mis=0;
    ll sum=r*g*b;
    for (int i=0; i<N; i++){
        for (int j=i+1; j<N; j++){
            int k=j+(j-i);
            if (k<N && S[i]!=S[j] && S[i]!=S[k] && S[j]!=S[k]) mis++;
        }
    }
    cout << sum-mis << 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 rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll N,r=0,b=0,g=0;
    string S;
    cin >> N >> S;
    
    for (int i=0; i<N; i++){
        if (S[i]=='R') r++;
        if (S[i]=='G') g++;
        if (S[i]=='B') b++;
    }
    
    ll mis=0;
    ll sum=r*g*b;
    for (int i=0; i<N; i++){
        for (int j=i+1; j<N; j++){
            if (j+(j-i) <N && j>i){
                if (S[i]!=S[j] && S[i]!=S[j+(j-i)] && S[j]!=S[j+(j-i)]) mis++;
            }
        }
    }
    cout << sum-mis << 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;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)
#define int long long

void main(){
    int N;
    int Red=0,Green=0,Blue=0;
    string S;
    cin>>N>>S;
    rep(i,N){
        if(S[i]=='R')Red++;
        else if(S[i]=='G')Green++;
        else if(S[i]=='B')Blue++;
    }
    ll sum=Red*Green*Blue;
    //cout<<sum<<endl;
    rep(i,2000){
        rep(j,N){
            if(j-i<0||i+j>=N)continue;
            if(S[j]!=S[j-i]&&S[j]!=S[j+i]&&S[j+i]!=S[j-i]){
                //cout<<j-i<<" "<<j<<" "<<j+i<<endl;
                sum--;
            }
        }
    }

    cout<<sum<<endl;

}

//a=97,z=122


Compiler output:
a.cc:31:1: error: '::main' must return 'int'
   31 | void main(){
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)
#define int long long

int main(){
    int N;
    int Red=0,Green=0,Blue=0;
    string S;
    cin>>N>>S;
    rep(i,N){
        if(S[i]=='R')Red++;
        else if(S[i]=='G')Green++;
        else if(S[i]=='B')Blue++;
    }
    ll sum=Red*Green*Blue;
    //cout<<sum<<endl;
    rep(i,2000){
        rep(j,N){
            if(j-i<0||i+j>=N)continue;
            if(S[j]!=S[j-i]&&S[j]!=S[j+i]&&S[j+i]!=S[j-i]){
                //cout<<j-i<<" "<<j<<" "<<j+i<<endl;
                sum--;
            }
        }
    }

    cout<<sum<<endl;

    return 0;
}

//a=97,z=122


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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)
#define int ll

int main(){
    int N;
    int Red=0,Green=0,Blue=0;
    string S;
    cin>>N>>S;
    rep(i,N){
        if(S[i]=='R')Red++;
        else if(S[i]=='G')Green++;
        else if(S[i]=='B')Blue++;
    }
    ll sum=Red*Green*Blue;
    //cout<<sum<<endl;
    rep(i,2000){
        rep(j,N){
            if(j-i<0||i+j>=N)continue;
            if(S[j]!=S[j-i]&&S[j]!=S[j+i]&&S[j+i]!=S[j-i]){
                //cout<<j-i<<" "<<j<<" "<<j+i<<endl;
                sum--;
            }
        }
    }

    cout<<sum<<endl;

    return 0;
}

//a=97,z=122


Compiler output:
a.cc:29:13: error: '::main' must return 'int'
   29 | #define int ll
      |             ^~
a.cc:31:1: note: in expansion of macro 'int'
   31 | int main(){
      | ^~~
Language: C

using System;
using static System.Console;
using System.Collections.Generic;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(ReadLine());
            char[] S = ReadLine().ToCharArray();
            var rgb = new Dictionary<char,long> { {'R',0},{'G',0 },{'B',0 }};
            int tmp = 0;

            for(long i = 0; i < N; i ++)
            {
                rgb[S[i]] += 1;

                for(long j = i + 1; j < N; j++)
                {
                    if(S[i] != S[j] && j * 2 - i < N)
                    {
                        if(S[j * 2 - i] != S[i] && S[j * 2 - i] != S[j])
                        {
                            tmp += 1;
                        }
                    }
                }
            }
            WriteLine(rgb['R'] * rgb['G'] * rgb['B'] - tmp);
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:6: error: expected ';' before 'static'
    2 | using static System.Console;
      |      ^~~~~~~
      |      ;
main.c:2:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using static System.Console;
      |                    ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Collections.Generic;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Collections.Generic;
      |             ^
main.c:5:1: error: unknown type name 'namespace'
    5 | namespace Main
      | ^~~~~~~~~
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    6 | {
      | ^
Language: C

using System;
using static System.Console;
using static System.Math;
using System.Linq;
using System.Collections.Generic;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(ReadLine());
            char[] S = ReadLine().ToCharArray();
            var rgb = new Dictionary<char,long> { {'R',0},{'G',0 },{'B',0 }};
            long tmp = 0;

            for(long i = 0; i < N; i ++)
            {
                rgb[S[i]] += 1;

                for(long j = i + 1; j < N; j++)
                {
                    if(j * 2 -i < N)
                    {
                        if (S[j * 2 - i] != S[i] && S[j * 2 - i] != S[j] && S[i] != S[j])
                        {
                            tmp += 1;
                        }
                    }
                }
            }
            WriteLine(rgb['R'] * rgb['G'] * rgb['B'] - tmp);
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:6: error: expected ';' before 'static'
    2 | using static System.Console;
      |      ^~~~~~~
      |      ;
main.c:2:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using static System.Console;
      |                    ^
main.c:3:6: error: expected ';' before 'static'
    3 | using static System.Math;
      |      ^~~~~~~
      |      ;
main.c:3:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using static System.Math;
      |                    ^
main.c:4:1: error: unknown type name 'using'
    4 | using System.Linq;
      | ^~~~~
main.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | using System.Linq;
      |             ^
main.c:5:1: error: unknown type name 'using'
    5 | using System.Collections.Generic;
      | ^~~~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | using System.Collections.Generic;
      |             ^
main.c:7:1: error: unknown type name 'namespace'
    7 | namespace Main
      | ^~~~~~~~~
main.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    8 | {
      | ^
Language: C

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

int main(){
  int N;
  cin >> N;
  vector<int>A(N);
  vector<int>count(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
    count.at(A.at(i)-1)++;
  }
  long long all=0;
  for(int i=0;i<N;i++){
    if(count.at(i)<2) continue;
    all+=count.at(i)*(count.at(i)-1)/2;
  }
  vector<long long>ans(N);
  for(int i=0;i<N;i++){
    ans.at(i)=all-(count.at(A.at(i)-1)-1);
    cout << ans.at(i) << endl;
  }
}


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<iostream>
#include<vector>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int>A(N);
  vector<int>count(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
    count.at(A.at(i)-1)++;
  }
  long long all=0;
  for(int i=0;i<N;i++){
    if(count.at(i)<2) continue;
    all+=count.at(i)*(count.at(i)-1)/2;
  }
  vector<long long>ans(N);
  for(int i=0;i<N;i++){
    ans.at(i)=all-(count.at(A.at(i)-1)-1);
    cout << ans.at(i) << endl;
  }
}


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

#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i++; i<N)
#define RVROOP(i, N) for(int i=N; i--; i>=0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;

/*DP使ったほうがよくない？？WOWWOW*/

int main(){
  int N; cin>>N;
  string S; cin>>S;
  int r, g, b;
  r=count(S.cbegin(), S.cend(), 'R');
  g=count(S.cbegin(), S.cend(), 'G');
  b=count(S.cbegin(), S.cend(),'B');
  ll ans=r*g*b;
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      if((S.at(i) != S.at(j)) && (2*j-i<N)){
        if((S.at(i) != S.at(2*j-i)) && (S.at(j) != S.at(2*j-i))){ 
          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

FS==FS=A{for(;$++i;)for(j=i;j>0;j-=2)$i==$j||$i$j~$(i/2+j/2)||s--;print s+gsub(/R/,E)*gsub(/G/,E)*gsub(/B/,E)}

Compiler output:
main.c:1:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
    1 | FS==FS=A{for(;$++i;)for(j=i;j>0;j-=2)$i==$j||$i$j~$(i/2+j/2)||s--;print s+gsub(/R/,E)*gsub(/G/,E)*gsub(/B/,E)}
      |   ^~
Language: C++

// using no_way as a way
// using no_limitation as a limitation

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = (1e-9);
typedef long long ll;
typedef unsigned long long ull;
#define flush fflush(stdout), cout.flush()
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
#define clr(v,line) memset(v,line,sizeof(v))
#define rep(i,n) for(int(i)=0;(i)<(int)(n);(i)++)
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define RT(x) return cout<<x, 0;
//#define lcm(a,b) (a*(b/__gcd(a,b)))
#define P 1000000007
#define endl '\n'
// const int dx[] = {1,-1,0,0,1,-1,1,-1};
// const int dy[] = {0,0,1,-1,1,-1,-1,1};
// const int dxhorse[] = {-2,-2,-1,-1,1,1,2,2};
// const int dyhorse[] = {1,-1,2,-2,2,-2,1,-1};
 
void file() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
void fast()
{
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL); cout.tie(NULL);
}


int main(int argc, char const *argv[])
{
    // file();
    // fast();
    
    int n; scanf("%d", &n);
    string s;
    getline(cin, s);
    ll ans = 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] and s[i]!=s[k] and s[j]!=s[k])
                {
                    ans+=j - i!=k - j;
                }
            }
        }
    }
    printf("%lld", ans);
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:8:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~