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

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

int main() {
  int n, i, j, k;
  long long ans = 0;
  vector<long long> c(5);
  string s;
  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'M')
      c[0]++;
    if (s[0] == 'A')
      c[1]++;
    if (s[0] == 'R')
      c[2]++;
    if (s[0] == 'C')
      c[3]++;
    if (s[0] == 'H')
      c[4]++;
  }

  for (i = 0; i < 5; i++) {
    for (j = i + 1; j < 5; j++) {
      for (k = j + 1; k < 5; k++) {
        ans += c[i] * c[j] * c[k];
      }
    }
    cout << ans << "\n";
    return 0;
  }

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

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

int main() {
  int n, i, j, k;
  long long ans = 0;
  vector<int> c(5);
  string s;
  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'M')
      c[0]++;
    if (s[0] == 'A')
      c[1]++;
    if (s[0] == 'R')
      c[2]++;
    if (s[0] == 'C')
      c[3]++;
    if (s[0] == 'H')
      c[4]++;
  }

  for (i = 0; i < 5; i++) {
    for (j = i; j < 5; j++) {
      for (k = j; k < 5; k++) {
        if (i == j || j == k || k == i) {
          continue;
        } else {
          ans += c[i] * c[j] * c[k];
          a++;
        }
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:11: error: 'a' was not declared in this scope
   34 |           a++;
      |           ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <cstring>
#include <vector>

using namespace std;

#define REP(a, i, n) for (int i = a; i <= n; ++i)

int main() {
    int N;
    scanf("%d", &N);

    vector<string> v;
    REP(1, i, N) {
        string str;
        cin >> str;
        v.push_back(str);
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());

    int M, A, R, C, H;
    M = A = R = C = H = 0;
    vector<string>::iterator it;
    for (it = v.begin(); it != v.end(); ++it) {
        if ((*it)[0] == 'M') M++;
        else if ((*it)[0] == 'A') A++;
        else if ((*it)[0] == 'R') R++;
        else if ((*it)[0] == 'C') C++;
        else if ((*it)[0] == 'H') H++;
        else {}
    }

    long ans = M * A * (R + C + H) +
               A * R * (C + H) +
               M * R * (C + H) +
               (A + M + R) * C * H;

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

    return 0;
}


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

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<bitset>
#include<queue>
#include<set>
#include<map>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define ROF(i,b,a) for (int i=(b);i>(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,n-1,-1)

typedef int i32;
typedef long long int i64;
typedef unsigned long long int ui64;
typedef float f32;
typedef double f64;
typedef long double f128;
typedef pair<int,int> Pi;

constexpr int INF = 1e9 + 7;
constexpr int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main() {
   int N; cin>>N;
   int cnt[5]; REP(i,5) cnt[i]=0;
   string S;
   char[5] = {'M','A','R','C','H'};
   REP(i,N) {
       cin>>S;
       REP(i,5) if (S[0]==char[i]) cnt[i]++;
   }
   i64 ans = 0;
   ans = cnt[0]*cnt[1]*cnt[2] + cnt[0]*cnt[1]*cnt[3] + cnt[0]*cnt[1]*cnt[4] + cnt[0]*cnt[2]*cnt[3] + cnt[0]*cnt[2]*cnt[4] + cnt[0]*cnt[3]*cnt[4] + cnt[1]*cnt[2]*cnt[3]
   + cnt[1]*cnt[2]*cnt[4] + cnt[1]*cnt[3]*cnt[4] + cnt[2]*cnt[3]*cnt[4];  
   cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: expected identifier before numeric constant
   33 |    char[5] = {'M','A','R','C','H'};
      |         ^
a.cc:33:9: error: expected ']' before numeric constant
   33 |    char[5] = {'M','A','R','C','H'};
      |         ^
      |         ]
a.cc:33:8: error: structured binding declaration cannot have type 'char'
   33 |    char[5] = {'M','A','R','C','H'};
      |        ^
a.cc:33:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:33:8: error: empty structured binding declaration
a.cc:36:27: error: expected primary-expression before 'char'
   36 |        REP(i,5) if (S[0]==char[i]) cnt[i]++;
      |                           ^~~~
a.cc:36:27: error: expected ')' before 'char'
   36 |        REP(i,5) if (S[0]==char[i]) cnt[i]++;
      |                    ~      ^~~~
      |                           )
Language: C++

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

int main(){
	int n;
	cin>>n;
	
	string s[10000];
	unsignedd long long m=0,a=0,r=0,c=0,h=0;
	for(int i=0;i<n;i++){
		cin>>s[i];
		
		if(s[i][0]=='M') m++;
		if(s[i][0]=='A') a++;
		if(s[i][0]=='R') r++;
		if(s[i][0]=='C') c++;
		if(s[i][0]=='H') h++;
	}
	
	cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'unsignedd' was not declared in this scope; did you mean 'unsigned'?
   12 |         unsignedd long long m=0,a=0,r=0,c=0,h=0;
      |         ^~~~~~~~~
      |         unsigned
a.cc:16:34: error: 'm' was not declared in this scope
   16 |                 if(s[i][0]=='M') m++;
      |                                  ^
a.cc:17:34: error: 'a' was not declared in this scope
   17 |                 if(s[i][0]=='A') a++;
      |                                  ^
a.cc:18:34: error: 'r' was not declared in this scope
   18 |                 if(s[i][0]=='R') r++;
      |                                  ^
a.cc:19:34: error: 'c' was not declared in this scope
   19 |                 if(s[i][0]=='C') c++;
      |                                  ^
a.cc:20:34: error: 'h' was not declared in this scope
   20 |                 if(s[i][0]=='H') h++;
      |                                  ^
a.cc:23:15: error: 'm' was not declared in this scope
   23 |         cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
      |               ^
a.cc:23:17: error: 'a' was not declared in this scope
   23 |         cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
      |                 ^
a.cc:23:19: error: 'r' was not declared in this scope
   23 |         cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
      |                   ^
a.cc:23:25: error: 'c' was not declared in this scope
   23 |         cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
      |                         ^
a.cc:23:31: error: 'h' was not declared in this scope
   23 |         cout<<m*a*r+m*a*c+m*a*h+m*r*c+m*r*h+m*c*h+a*r*c+a*r*h+a*c*h+r*c*h<<endl;
      |                               ^
Language: C++

int main() {
	int n;
	cin >> n;
	string s;
	vector<int64_t> vals(5,0);
	for (int i = 0; i < n; ++i) {
		cin >> s;
		if (s[0] == 'M') vals[0]++;
		if (s[0] == 'A') vals[1]++;
		if (s[0] == 'R') vals[2]++;
		if (s[0] == 'C') vals[3]++;
		if (s[0] == 'H') vals[4]++;
	}
	int64_t res = 0;
	for (int i = 0; i < 5; ++i) {
		for (int j = i+1; j < 5; ++j) {
			for (int k = j + 1; k < 5; ++k) {
				res += vals[i] * vals[j] * vals[k];
			}
		}
	}
	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n;
      |         ^~~
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string s;
      |         ^~~~~~
a.cc:5:9: error: 'vector' was not declared in this scope
    5 |         vector<int64_t> vals(5,0);
      |         ^~~~~~
a.cc:5:16: error: 'int64_t' was not declared in this scope
    5 |         vector<int64_t> vals(5,0);
      |                ^~~~~~~
a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | int main() {
a.cc:5:25: error: 'vals' was not declared in this scope
    5 |         vector<int64_t> vals(5,0);
      |                         ^~~~
a.cc:7:24: error: 's' was not declared in this scope
    7 |                 cin >> s;
      |                        ^
a.cc:14:16: error: expected ';' before 'res'
   14 |         int64_t res = 0;
      |                ^~~~
      |                ;
a.cc:18:33: error: 'res' was not declared in this scope
   18 |                                 res += vals[i] * vals[j] * vals[k];
      |                                 ^~~
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout << res << endl;
      |         ^~~~
a.cc:22:17: error: 'res' was not declared in this scope
   22 |         cout << res << endl;
      |                 ^~~
a.cc:22:24: error: 'endl' was not declared in this scope
   22 |         cout << res << endl;
      |                        ^~~~
Language: C

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

int main(void){
    int N;
    scanf("%d",&N);
    char s[N][11];
    int i,j,k
    long long c[5]={0,0,0,0,0};
    for(i=0;i<N;i++){
        scanf("%s",s[i]);
        if(s[i][0]=='M'){
            c[0]++;
        }else if(s[i][0]=='A'){
            c[1]++;
        }else if(s[i][0]=='R'){
            c[2]++;
        }else if(s[i][0]=='C'){
            c[3]++;
        }else if(s[i][0]=='H'){
            c[4]++;
        }
    }
    long long ans = 0;
    for(i=0;i<3;i++){
        for(j=i+1;j<4;j++){
            for(k=j+1;k<5;k++){
                ans += c[i]*c[j]*c[k];
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'long'
   11 |     long long c[5]={0,0,0,0,0};
      |     ^~~~
main.c:15:13: error: 'c' undeclared (first use in this function)
   15 |             c[0]++;
      |             ^
main.c:15:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:17: error: 'k' undeclared (first use in this function)
   29 |             for(k=j+1;k<5;k++){
      |                 ^
Language: C++

#include<cstdio>
using namespace std;

int main(){
  int n, m[5] = {0,0,0,0,0};
  long long ans = 0;
  char[20] s;
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%s",s);
    if(s[0] == 'M') m[0]++;
    else if(s[0] == 'A') m[1]++;
    else if(s[0] == 'R') m[2]++;
    else if(s[0] == 'C') m[3]++;
    else if(s[0] == 'H') m[4]++;
  }
  for(int j = 0; j < 3; j++)
    for(int k = j+1; k < 4; k++)
      for(int l = k+1; l < 5; l++)
        ans += m[j]*m[k]*m[l];
  printf("%lld\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected identifier before numeric constant
    7 |   char[20] s;
      |        ^~
a.cc:7:8: error: expected ']' before numeric constant
    7 |   char[20] s;
      |        ^~
      |        ]
a.cc:7:7: error: structured binding declaration cannot have type 'char'
    7 |   char[20] s;
      |       ^
a.cc:7:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:7: error: empty structured binding declaration
a.cc:7:12: error: expected initializer before 's'
    7 |   char[20] s;
      |            ^
a.cc:10:16: error: 's' was not declared in this scope
   10 |     scanf("%s",s);
      |                ^
Language: C++

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

int main(){
  long long march[5]={},ans=1;
  bool exist=false;
  string s;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s;
    switch(s[0]){
      case 'M':
        march[0]++;
        break;
      case 'A':
        march[1]++;
        break;
      case 'R':
        march[2]++;
        break;
      case 'C':
        march[3]++;
        break;
      case 'H':
        march[4]++;
        break;
      default:
        break;
    }
  }
  for(int i=0;i<5;i++){
    if(march[i]){
      exist=true;
      ans*=march[i];
    }
  }
  cout<<(exist?ans:0)<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'n' was not declared in this scope
    8 |   cin>>n;
      |        ^
Language: C++

#include<cstdio>
using namespace std;

int main(){
  int n, m[5] = {0,0,0,0,0};
  long long ans;
  string s;
  for(int i = 0; i < n; i++){
    scanf("%s",s);
    if(s[0] == 'M') m[0]++;
    else if(s[0] == 'A') m[1]++;
    else if(s[0] == 'R') m[2]++;
    else if(s[0] == 'C') m[3]++;
    else if(s[0] == 'H') m[4]++;
  }
  for(int j = 0; j < 3; j++)
    for(int k = j+1; k < 4; k++)
      for(int l = l+1; l < 5; l++)
        ans += m[j]*m[k]*m[l];
  printf("%d\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<cstdio>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:9:16: error: 's' was not declared in this scope
    9 |     scanf("%s",s);
      |                ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[] count = new int[5];

    for (int i = 0; i < n; i++) {
      String str = String.valueOf(sc.next().charAt(0));

      if (str.equals("M")) {
        count[0]++;
      } else if (str.equals("A")) {
        count[1]++;
      } else if (str.equals("R")) {
        count[2]++;
      } else if (str.equals("C")) {
        count[3]++;
      } else if (str.equals("H")) {
        count[4]++;
      }
    }

    long ans = 0;

    for (int i = 0; i < 3; i++) {
      for (int j = i+1; j < 4; j++) {
        for (int k = j+1; k < 5; k++) {
          ans += long(count[i] * count[j] * count[k]);
        }
      }
    }

    System.out.println(ans);
  }
}


Compiler output:
Main.java:31: error: '.class' expected
          ans += long(count[i] * count[j] * count[k]);
                     ^
Main.java:31: error: not a statement
          ans += long(count[i] * count[j] * count[k]);
                                          ^
Main.java:31: error: ';' expected
          ans += long(count[i] * count[j] * count[k]);
                                                    ^
3 errors
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<array>
using namespace std;
int main(void){
    int N;
    cin >> N;
    string S;
    long MARCH[5] = {0};
    for (int i = 0; i < N; i++) {
        cin >> S;
        switch(S[0]) {
            case 'M':
                MARCH[0]++;
                break;
            case 'A':
                MARCH[1]++;
                break;
            case 'R':
                MARCH[2]++;
                break;
            case 'C':
                MARCH[3]++;
                break;
            case 'H':
                MARCH[4]++;
                break;
        }
    }
    long count = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                count += MARCH[i] * MARCH[j] * MARCH[k];
            }
        }
    }
    cout << count << endl;
    return 0;
}
}


Compiler output:
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<array>
using namespace std;
int main(void){
    int N;
    cin >> N;
    string S;
    long MARCH[5] = {0};

    for (int i = 0; i < N; i++) {
        cin >> S;
        switch(S[0]) {
            case 'M':
                MARCH[0]++;
                break;
            case 'A':
                MARCH[1]++;
                break;
            case 'R':
                MARCH[2]++;
                break;
            case 'C':
                MARCH[3]++;
                break;
            case 'H':
                MARCH[4]++;
                break;
        }
    }

    long count = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                count += MARCH[i] * MARCH[j] * MARCH[k];
            }
        }
    }

    cout << count << endl;
    return 0;
}



























}


Compiler output:
a.cc:73:1: error: expected declaration before '}' token
   73 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<array>
using namespace std;
int main(){
    int N;
    cin >> N;
    string S;
    long MARCH[5] = {0};

    for (int i = 0; i < N; i++) {
        cin >> S;
        switch(S[0]) {
            case 'M':
                MARCH[0]++;
                break;
            case 'A':
                MARCH[1]++;
                break;
            case 'R':
                MARCH[2]++;
                break;
            case 'C':
                MARCH[3]++;
                break;
            case 'H':
                MARCH[4]++;
                break;
        }
    }

    long count = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                count += MARCH[i] * MARCH[j] * MARCH[k];
            }
        }
    }

    cout << count << endl;
    return 0;
}



























}


Compiler output:
a.cc:73:1: error: expected declaration before '}' token
   73 | }
      | ^
Language: C++

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

int main() {
    int N, M;
    cin >> N >> M;

    if (N >= 2 && M >= 2) {
        cout << (N - 2) * (M - 2) << endl;
    }
    else if (N == 1 || M == 1) {
        cout << max(N, M) - 2 << endl;
    }

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

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "limits.h"
#include "bitset"
#define lp(n) for (int i = 0; i < n; i++)
#define lop(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define ll long long int
#define sp ' '
using namespace std;

int n;
string s;
int cnt[5];
ll ans;

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	ll g = gcd(x, y);
	return x / g * y;
}

int main(){
	lp(5)
		cnt[i] = 0;
	cin >> n;
	lp(n) {
		cin >> s;
		if (s[0] == 'M')cnt[0]++;
		if (s[0] == 'A')cnt[1]++;
		if (s[0] == 'R')cnt[2]++;
		if (s[0] == 'C')cnt[3]++;
		if (s[0] == 'H')cnt[4]++;

	}
	ans = 0;
	lp(3) {
		for (int j = i + 1; j < 4; j++) {
			for (int k = j + 1; k < 5; k++) {
				ans += ll(cnt[i]) * ll(cnt[j]) * ll(cnt[k]);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected primary-expression before 'long'
   11 | #define ll long long int
      |            ^~~~
a.cc:46:40: note: in expansion of macro 'll'
   46 |                                 ans += ll(cnt[i]) * ll(cnt[j]) * ll(cnt[k]);
      |                                        ^~
Language: C++

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "limits.h"
#include "bitset"
#define lp(n) for (int i = 0; i < n; i++)
#define lop(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define ll long long int
#define sp ' '
using namespace std;

int n;
string s;
int cnt[5];
ll ans;

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	ll g = gcd(x, y);
	return x / g * y;
}

int main(){
	lp(5)
		cnt[i] = 0;
	cin >> n;
	lp(n) {
		cin >> s;
		if (s[0] == 'M')cnt[0]++;
		if (s[0] == 'A')cnt[1]++;
		if (s[0] == 'R')cnt[2]++;
		if (s[0] == 'C')cnt[3]++;
		if (s[0] == 'H')cnt[4]++;

	}
	ans = 0;
	lp(3) {
		for (int j = i + 1; j < 4; j++) {
			for (int k = j + 1; k < 5; k++) {
				ans += ll(cnt[i] * cnt[j] * cnt[k]);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected primary-expression before 'long'
   11 | #define ll long long int
      |            ^~~~
a.cc:46:40: note: in expansion of macro 'll'
   46 |                                 ans += ll(cnt[i] * cnt[j] * cnt[k]);
      |                                        ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
int group[5]={};



long long int ans=0;
string tmp;
cin >> N;
for(int i=0;i<N;i++){
	cin>>tmp;
	switch(tmp[0]){
		case 'M': 
			group[0]++;
			break;
		case 'A':
			group[1]++;
			break;
		case 'R':
			group[2]++;
			break;
		case 'C':
			group[3]++;
			break;
		case 'H':
			group[4]++;
			break;
		default:
	}
}

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++){
			ans+=group[i]*group[j]*group[k];
		}
	}
}

printf("%lld\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: expected primary-expression before '}' token
   31 |         }
      |         ^
Language: C

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

/*ソートの時に使う
int sort(const void *a, const void *b){
    return *(int*)a-*(int*)b ;
}
    qsort (data,sizeof(data),sizeof(int),sort); 
*/

int main(void){
    int n,m=0,a=0,r=0,c=0,h=0;
    scanf("%d",&n);
    char s[n][12];
    for (int i=0; i<n; i++){
        scanf("%s",s[i]);
        if (s[i][0]=='M'){
            m++;
        } else if (s[i][0]=='A'){
            a++;
        } else if (s[i][0]=='R'){
            r++;
        } else if (s[i][0]=='C'){
            c++;
        } else if (s[i][0]=='H'){
            h++;
        }
    }
    long long ans=0;
    ans += m*a*r ;
    ans += m*a*c ;
    asn += m*a*h ;
    ans += m*r*c ;
    ans += m*r*h ;
    ans += m*c*h ;
    ans += a*r*c ;
    ans += a*r*h ;
    ans += a*c*h ;
    ans += r*c*h ;
    printf ("%lld\n",ans);
	return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:34:5: error: 'asn' undeclared (first use in this function); did you mean 'ans'?
   34 |     asn += m*a*h ;
      |     ^~~
      |     ans
main.c:34:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include "stdafx.h"
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#include<queue>
using namespace std;
bool b[8];
int main() {
	int n;
	cin >> n;
	long long m = 0, a = 0, r = 0, c = 0, h = 0;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		if (s[0] == 'M')m++;
		if (s[0] == 'A')a++;
		if (s[0] == 'R')r++;
		if (s[0] == 'C')c++;
		if (s[0] == 'H')h++;
	}
	cout << m * a*r + m * a*c + m * a*h + m * r*c + m * r*h + m * c*h + a * r*c + a * r*h + a * c*h + r * c*h;
	getchar();
	getchar();
	return 0;
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
    int n,c[5],ans=0;
    cin>>n;
    string s[100000];
    for(int i=0;i<n;i++)cin>>s[i];
    for(int i=0;i<n;i++){
        if(s[i][0]=='M')s[0]++;
        if(s[i][0]=='A')s[1]++;
        if(s[i][0]=='R')s[2]++;
        if(s[i][0]=='C')s[3]++;
        if(s[i][0]=='H')s[4]++;
    }
    for(int i=0;i<n-2;i++){
        for(int j=1;j<n-1;j++){
            for(int k=2;k<n;k++){
                ans+=s[i]*s[j]*s[k];
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |         if(s[i][0]=='M')s[0]++;
      |                         ~~~~^~
a.cc:13:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   13 |         if(s[i][0]=='A')s[1]++;
      |                         ~~~~^~
a.cc:14:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   14 |         if(s[i][0]=='R')s[2]++;
      |                         ~~~~^~
a.cc:15:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   15 |         if(s[i][0]=='C')s[3]++;
      |                         ~~~~^~
a.cc:16:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   16 |         if(s[i][0]=='H')s[4]++;
      |                         ~~~~^~
a.cc:21:26: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   21 |                 ans+=s[i]*s[j]*s[k];
      |                      ~~~~^~~~~
      |                         |    |
      |                         |    basic_string<[...]>
      |                         basic_string<[...]>
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    String[] S = new String[N];
    long[] count = new long[5];
    long ans = 0;

    for (int i = 0; i < N; i++){
      S[i] = scanner.next();
    }
    for (int i = 0; i < N; i++){
      if(S[i].charAt(0) == 'M'){
        count[0]++;
      } else if (S[i].charAt(0) == 'A'){
        count[1]++;
      } else if (S[i].charAt(0) == 'R'){
        count[2]++;
      } else if (S[i].charAt(0) == 'C'){
        count[3]++;
      } else if (S[i].charAt(0) == 'H'){
        count[4]++;
      } else {
        return;
      }
    }  
    ans = count[0] * count[1] * count[2] + count[0] * count[1]* count[3] +
    count[0] * count[1] * count[4] + count[0] * count[2] * count[3] +
    count[0] * count[2] * count[4] + count[0] * count[3] * count[4] +
    count[1] * count[2] * count[3] + count[1] * count[2] * count[4] +
    count[1] * count[3] * count[4] + count[2] * count[3] * count[4];
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:35: error: <identifier> expected
    System.out.println(ans);
                      ^
Main.java:35: error: <identifier> expected
    System.out.println(ans);
                          ^
Main.java:37: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}

int main(){
ll N;
cin>>N;
vector<string> S(N);
ll m=0; ll a=0; ll r=0; ll c=0; ll h=0;
for(int i=0; i<N; ++i){
cin>>S[i];
if (S[i].at(0) == 'M') {m++;}
else if (S[i].at(0) == 'A') {a++;}
else if (S[i].at(0) == 'R') {r++;}
else if (S[i].at(0) == 'C') {c++;}
else if (S[i].at(0) == 'H') {h++;}
}
ll ans=0;
ans+=m*a*r+m*a*h+m*a*c+m*c*r+m*h*r+m*h*c+c*a*r+h*a*r+h*c*r;
cout<<ans<<edl;
}












Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'edl' was not declared in this scope
   41 | cout<<ans<<edl;
      |            ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}

int main(){
ll N;
vector<string> string(S);
ll m=0; ll a=0; ll r=0; ll c=0; ll h=0;
for(int i=0; i<N; ++i){
cin>>S[i];
if (S[i].at(0) == 'M') {m++;}
if (S[i].at(0) == 'A') {a++;}
if (S[i].at(0) == 'R') {r++;}
if (S[i].at(0) == 'C') {c++;}
if (S[i].at(0) == 'H') {h++;}
}
ll ans=0;
if(m>0&&a>0&&r>0){
ans+=m*a*r;
}
if(m>0&&a>0&&h>0){
ans+=m*a*h;
}
if(m>0&&a>0&&c>0){
ans+=m*a*c;
}
if(m>0&&c>0&&r>0){
ans+=m*c*r;
}
if(m>0&&h>0&&r>0){
ans+=m*h*r;
}
if(m>0&&h>0&&c>0){
ans+=m*h*c;
}
if(a>0&&r>0&&c>0){
ans+=c*a*r;
}
if(a>0&&r>0&&h>0){
ans+=h*a*r;
}
if(a>0&&c>0&&h>0){
ans+=h*a*r;
}
if(r>0&&c>0&&h>0){
ans+=h*c*r;
}
cout<<ans<<endl;
return 0;
}












Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: 'S' was not declared in this scope
   28 | vector<string> string(S);
      |                       ^
Language: C++

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

typedef long long ll;

int main()
{
   int n;
   cin>>n;
   vector<string>s(n);
   vector<char>c(n);
   rep(i,n){
     cin>>s[i];
     c[i]=s[i].at(0);
     }
   
   vector<int>a(5);//m,a,r,c,h
   rep(i,n){
     switch(c[i])
     case 'M':
       a[0]++;
       break;
     case 'A':
       a[1]++;
       break;
     case 'R':
       a[2]++;
       break;
     case 'C':
       a[3]++;
       break;
     case 'H':
       a[4]++;
       break;
   }
   ll ans;
   ans+=a[0]*(a[1]*(a[2]+a[3]+a[4])+a[2]*(a[3]+a[4])+a[3]*a[4]);
   ans+=a[1]*(a[2]*(a[3]+a[4])+a[3]*a[4]);
   ans+=a[2]*a[3]*a[4];
   cout<<ans<<endl;
   
     
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:6: error: case label ''A'' not within a switch statement
   25 |      case 'A':
      |      ^~~~
a.cc:28:6: error: case label ''R'' not within a switch statement
   28 |      case 'R':
      |      ^~~~
a.cc:31:6: error: case label ''C'' not within a switch statement
   31 |      case 'C':
      |      ^~~~
a.cc:34:6: error: case label ''H'' not within a switch statement
   34 |      case 'H':
      |      ^~~~
Language: C++

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

typedef long long ll;

int main()
{
   int n;
   cin>>n;
   vector<string>s(n);
   rep(i,n)cin>>s[i];
   vector<int>a(5);//m,a,r,c,h
   rep(i,n){
     switch(s[i].at(0))
     case 'M':
       a[0]++;
       break;
     case 'A':
       a[1]++;
       break;
     case 'R':
       a[2]++;
       break;
     case 'C':
       a[3]++;
       break;
     case 'H':
       a[4]++;
       break;
   }
   ll ans;
   ans+=a[0]*(a[1]*(a[2]+a[3]+a[4])+a[2]*(a[3]+a[4])+a[3]*a[4]);
   ans+=a[1]*(a[2]*(a[3]+a[4])+a[3]*a[4]);
   ans+=a[2]*a[3]*a[4];
   cout<<ans<<endl;
   
     
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: case label ''A'' not within a switch statement
   20 |      case 'A':
      |      ^~~~
a.cc:23:6: error: case label ''R'' not within a switch statement
   23 |      case 'R':
      |      ^~~~
a.cc:26:6: error: case label ''C'' not within a switch statement
   26 |      case 'C':
      |      ^~~~
a.cc:29:6: error: case label ''H'' not within a switch statement
   29 |      case 'H':
      |      ^~~~
Language: Java

import java.util.*;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N;
        double M=0,A=0,R=0,C=0,H=0;
        ArrayList<Integer> numlist = new ArrayList<>();
        N = sc.nextInt();
        for (int a = 0; a < N; a++) {
            String name = sc.next();
            if(name.indexOf('M')==0){
                M++;
            }
            else if(name.indexOf('A')==0){
                A++;
            }
            else if(name.indexOf('R')==0){
                R++;
            }
            else if(name.indexOf('C')==0){
                C++;
            }
            else if(name.indexOf('H')==0){
                H++;
            }
        }
        numlist.add(M);
        numlist.add(A);
        numlist.add(R);
        numlist.add(C);
        numlist.add(H);
        double num =0;
        for(int a=0;a<3;a++){
            for(int b=a+1;b<4;b++){
                for(int c=b+1;c<5;c++){
                    if(numlist.get(a)!=0&&numlist.get(b)!=0&&numlist.get(c)!=0)
                    num =+(numlist.get(a)*numlist.get(b)*numlist.get(c));
                }
            }
        }
        System.out.println(num);
    }
}


Compiler output:
Main.java:29: error: incompatible types: double cannot be converted to Integer
        numlist.add(M);
                    ^
Main.java:30: error: incompatible types: double cannot be converted to Integer
        numlist.add(A);
                    ^
Main.java:31: error: incompatible types: double cannot be converted to Integer
        numlist.add(R);
                    ^
Main.java:32: error: incompatible types: double cannot be converted to Integer
        numlist.add(C);
                    ^
Main.java:33: error: incompatible types: double cannot be converted to Integer
        numlist.add(H);
                    ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
5 errors
Language: Java

import java.util.*;
 
public class Main {
 
    public static  void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        Map<String, Long> map = new HashMap<>();
        map.put("M",0);
        map.put("A",0);
        map.put("R",0);
        map.put("C",0);
        map.put("H",0);
        String[] march ={"M", "A", "R", "C", "H"};
        for(int i = 0; i < n; i++){
            String str = scanner.next();
            str = str.substring(0,1);
            int v;
            if(str.equals("M") || str.equals("A") || str.equals("R") || str.equals("C") || str.equals("H")) {
                if (map.containsKey(str)) {
                    v = map.get(str) + 1;
                } else {
                    v = 1;
                }
                map.put(str,v);
            }
        }
        long ans = map.get(march[0]) * map.get(march[1]) * map.get(march[2]);
        ans += map.get(march[0]) * map.get(march[1]) * map.get(march[3]);
        ans += map.get(march[0]) * map.get(march[1]) * map.get(march[4]);
        ans += map.get(march[0]) * map.get(march[2]) * map.get(march[3]);
        ans += map.get(march[0]) * map.get(march[2]) * map.get(march[4]);
        ans += map.get(march[0]) * map.get(march[3]) * map.get(march[4]);
        ans += map.get(march[1]) * map.get(march[2]) * map.get(march[3]);
        ans += map.get(march[1]) * map.get(march[2]) * map.get(march[4]);
        ans += map.get(march[1]) * map.get(march[3]) * map.get(march[4]);
        ans += map.get(march[2]) * map.get(march[3]) * map.get(march[4]);
        System.out.println(ans);
    }
}

Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to Long
        map.put("M",0);
                    ^
Main.java:10: error: incompatible types: int cannot be converted to Long
        map.put("A",0);
                    ^
Main.java:11: error: incompatible types: int cannot be converted to Long
        map.put("R",0);
                    ^
Main.java:12: error: incompatible types: int cannot be converted to Long
        map.put("C",0);
                    ^
Main.java:13: error: incompatible types: int cannot be converted to Long
        map.put("H",0);
                    ^
Main.java:21: error: incompatible types: possible lossy conversion from long to int
                    v = map.get(str) + 1;
                                     ^
Main.java:25: error: incompatible types: int cannot be converted to Long
                map.put(str,v);
                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  int N;
  cin >>N;
  int M=0,A=0,R=0,C=0,H=0;
  ll ans=0;
  string s;
  for(int i=1;i<=N;i++){
    cin >> s;
    if(s[0]=='M')M++;
    if(s[0]=='A')A++;
    if(s[0]=='R')R++;
    if(s[0]=='C')C++;
    if(s[0]=='H')H++;
  }
    ll ans=(M*A*R)+(M*A*C)+(M*A*H)+(A*R*C)+(A*C*H)+
    (R*C*H)+(M*R*H)+(A*R*H)+(C*H*M)+(C*R*M);
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: redeclaration of 'll ans'
   29 |     ll ans=(M*A*R)+(M*A*C)+(M*A*H)+(A*R*C)+(A*C*H)+
      |        ^~~
a.cc:19:6: note: 'll ans' previously declared here
   19 |   ll ans=0;
      |      ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  int N;
  cin >>N;
  int M=0,A=0,R=0,C=0,H=0;
  ll ans=0;
  string s;
  for(int i=1;i<=N;i++){
    cin >> s;
    if(s[0]=='M')M++;
    if(s[0]=='A')A++;
    if(s[0]=='R')R++;
    if(s[0]=='C')C++;
    if(s[0]=='H')H++;
  }
    ans(LL)=(M*A*R)+(M*A*C)+(M*A*H)+(A*R*C)+(A*C*H)+
    (R*C*H)+(M*R*H)+(A*R*H)+(C*H*M)+(C*R*M);
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'LL' was not declared in this scope; did you mean 'll'?
   29 |     ans(LL)=(M*A*R)+(M*A*C)+(M*A*H)+(A*R*C)+(A*C*H)+
      |         ^~
      |         ll
a.cc:29:11: error: 'ans' cannot be used as a function
   29 |     ans(LL)=(M*A*R)+(M*A*C)+(M*A*H)+(A*R*C)+(A*C*H)+
      |           ^
Language: C++

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

#define rep(i,n) for(int i=0;i<(int)n;i++)

string S[100010];

int P[10] = { 0,0,0,0,0,0,1,1,1,2 };
int Q[10] = { 1,1,1,2,2,3,2,2,3,3 };
int R[10] = { 2,3,4,3,4,4,3,4,4,4 };

int main() {
    int N;
    cin >> N;
    rep(i, N)cin >> S[i];

    int M = 0, A = 0, R = 0, C = 0, H = 0;
    rep(i, N) {
        if (S[i][0] == 'M')M++;
        if (S[i][0] == 'A')A++;
        if (S[i][0] == 'R')R++;
        if (S[i][0] == 'C')C++;
        if (S[i][0] == 'H')H++;
    }
    int D[5] = { M,A,R,C,H };
    long long res = 0;
    for (int d = 0; d < 10; d++) {
        res += D[P[d]] * D[Q[d]] * D[R[d]];
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:39: error: invalid types 'int[int]' for array subscript
   32 |         res += D[P[d]] * D[Q[d]] * D[R[d]];
      |                                       ^
Language: C++

#include<iostream>
#include<string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdint>
#include <map>
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){

ll n;
cin >> n;

string s;
ll MARCH[5] = {};

for(ll i = 0; i<n; i++){
s =nil;
cin >> s;
 switch ( s[0] )  {  
case 'M':  
MARCH[0]++;  
break;  
case 'A':  
MARCH[1]++;  
break;  
case 'R':  
MARCH[2]++;  
break;  
case 'C':  
MARCH[3]++;  
break;  
case 'H':  
MARCH[4]++;  
break;  
      } 
}

ll ans = 0;

for(ll i = 0; i<n; i++){
 for(ll j = i+1; j < n;j++){
   for(ll k = j+1; k < n;k++){
ans += MARCH[i]* MARCH[j]* MARCH[k];
  }
 }
}

cout << ans << endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: 'nil' was not declared in this scope
   21 | s =nil;
      |    ^~~
Language: C++

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

int main(){

    int N;
    cin >> N;
    string S[N];
    for(int i = 0;i<N;i++) cin >> S[i];

    //重複消去
    /*
    for(int i = 0;i<N;i++){
        if(i != 0){
            for(int j = 0;j<i;j++){
                if(S[i] == S[j]){
                    S[i] == ".....";
                    break;
                }
            }
        }
    }
    */
    S.sort();
    S.unique();

    int M=0,A=0,R=0,C=0,H=0;
    long long int ans;

    string s;
    bool flag;
    for(int i = 0;i<N;i++){
        /*
        flag = false;
        if(i != 0){
            for(int j = 0;j<i;j++){
                if(S[i] == S[j]) break;
                else flag = true;
            }
        }
        else if (i == 0) flag = true;
        */
        //if(flag){
            s = S[i][0];
            if(s == "M") M++;
            else if(s == "A") A++;
            else if(s == "R") R++;
            else if(s == "C") C++;
            else if(s == "H") H++;
        //}
    }

    ans = M*A*R + M*A*C + M*A*H + M*R*C + M*R*H + M*C*H + A*R*C + A*R*H + A*C*H +R*C*H;
    cout << ans << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: request for member 'sort' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   25 |     S.sort();
      |       ^~~~
a.cc:26:7: error: request for member 'unique' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   26 |     S.unique();
      |       ^~~~~~
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;
string s;
int N;
ll m,a,r,c,h;
ll D[5];
int P[10]={0,0,0,0,0,0,1,1,1,2};
int Q[10]={1,1,1,2,2,3,2,2,3,3};
int R[10]={2,3,4,3,4,4,3,4,4,4};
int main () {
  cin >> N;
  for(int i=0;i<N;i++) {
    cin>>s;
    if(s[0]==’M’)m++;
    if(s[0]==’A’)a++;
    if(s[0]==’R’)r++;
    if(s[0]==’C’)c++;
    if(s[0]==’H’)h++;
  }
  D[0]=m, D[1]=a, D[2]=r,D[3]=c,D[4]=h;
  ll res =0;
  for(int d=0;d<10;d++) res+=D[P[d]]*D[Q[d]]*D[R[d]];
  cout << res << endl;
}


Compiler output:
a.cc:15:14: error: extended character ’ is not valid in an identifier
   15 |     if(s[0]==’M’)m++;
      |              ^
a.cc:15:14: error: extended character ’ is not valid in an identifier
a.cc:16:14: error: extended character ’ is not valid in an identifier
   16 |     if(s[0]==’A’)a++;
      |              ^
a.cc:16:14: error: extended character ’ is not valid in an identifier
a.cc:17:14: error: extended character ’ is not valid in an identifier
   17 |     if(s[0]==’R’)r++;
      |              ^
a.cc:17:14: error: extended character ’ is not valid in an identifier
a.cc:18:14: error: extended character ’ is not valid in an identifier
   18 |     if(s[0]==’C’)c++;
      |              ^
a.cc:18:14: error: extended character ’ is not valid in an identifier
a.cc:19:14: error: extended character ’ is not valid in an identifier
   19 |     if(s[0]==’H’)h++;
      |              ^
a.cc:19:14: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:15:14: error: '\U00002019M\U00002019' was not declared in this scope
   15 |     if(s[0]==’M’)m++;
      |              ^~~
a.cc:16:14: error: '\U00002019A\U00002019' was not declared in this scope
   16 |     if(s[0]==’A’)a++;
      |              ^~~
a.cc:17:14: error: '\U00002019R\U00002019' was not declared in this scope
   17 |     if(s[0]==’R’)r++;
      |              ^~~
a.cc:18:14: error: '\U00002019C\U00002019' was not declared in this scope
   18 |     if(s[0]==’C’)c++;
      |              ^~~
a.cc:19:14: error: '\U00002019H\U00002019' was not declared in this scope
   19 |     if(s[0]==’H’)h++;
      |              ^~~
Language: C++

#include <iostream >
using namespace std;
typedef long long ll;
string s;
int N;
ll m,a,r,c,h;
ll D[5];
int P[10]={0,0,0,0,0,0,1,1,1,2};
int Q[10]={1,1,1,2,2,3,2,2,3,3};
int R[10]={2,3,4,3,4,4,3,4,4,4};
int main () {
  cin >> N;
  for(int i=0;i<N;i++) {
    cin>>s;
    if(s[0]==’M’)m++;
    if(s[0]==’A’)a++;
    if(s[0]==’R’)r++;
    if(s[0]==’C’)c++;
    if(s[0]==’H’)h++;
  }
  D[0]=m, D[1]=a, D[2]=r,D[3]=c,D[4]=h;
  ll res =0;
  for(int d=0;d<10;d++) res+=D[P[d]]*D[Q[d]]*D[R[d]];
  cout << res << endl;
}


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

#include <cstdio >
#include <iostream >
using namespace std;
typedef long long ll;
string s;
int N;
ll m,a,r,c,h;
ll D[5];
int P[10]={0,0,0,0,0,0,1,1,1,2};
int Q[10]={1,1,1,2,2,3,2,2,3,3};
int R[10]={2,3,4,3,4,4,3,4,4,4};
int main () {
  scanf("%d",&N);
  for(int i=0;i<N;i++) {
    cin>>s;
    if(s[0]==’M’)m++;
    if(s[0]==’A’)a++;
    if(s[0]==’R’)r++;
    if(s[0]==’C’)c++;
    if(s[0]==’H’)h++;
  }
  D[0]=m, D[1]=a, D[2]=r,D[3]=c,D[4]=h;
  ll res =0;
  for(int d=0;d<10;d++) res+=D[P[d]]*D[Q[d]]*D[R[d]];
  printf("%lld\n",res);
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
    long count[5] = {0,0,0,0,0};
    long a;
    cin >> a;
    string b;
    for (int i = 0; i < a; ++i) {
        cin >> b;
        if(b[0] == 'M'){
            count[0]++;
        }else if(b[0] == 'A'){
            count[1]++;
        }else if(b[0] == 'R'){
            count[2]++;
        }else if(b[0] == 'C'){
            count[3]++;
        }else if(b[0] == 'H'){
            count[4]++;
        }
    }
    int long = 0;
    for (int j = 0; j < 5; ++j) {
        for (int i = j+1; i < 5; ++i) {
            for (int k = i+1; k < 5; ++k) {
                sum += count[j] * count[i] * count[k];
            }
        }
    }
    printf("%d\n",sum);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: expected unqualified-id before '=' token
   22 |     int long = 0;
      |              ^
a.cc:26:17: error: 'sum' was not declared in this scope
   26 |                 sum += count[j] * count[i] * count[k];
      |                 ^~~
a.cc:30:19: error: 'sum' was not declared in this scope
   30 |     printf("%d\n",sum);
      |                   ^~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

#define ll long long
#define REPI(x) for(int i = 0; i < x; i++)
#define REPJ(x) for(int j = 0; j < x; j++)

ll int num = 0;
ll int ans = 0;
ll int a[5];

int main(void)
{
        int N;
        cin >> N;

        char name[5]  = {'M', 'A', 'R', 'C', 'H'};
        char s[11];

        REPI(N)
        {
                cin >> s;
                REPJ(5)
                {
                        if (s[0] == name[j])
                        {
                                a[j]++;
                        }
                }
        }

        for (int i = 0; i < 5; i++){
                for (int j = i+1; j < 5; j++){
                        for (int k = j+1; k < 5; k++){
                                ans += a[i]*a[j]*a[k};
                        }
                }
        }
        cout << ans << endl;
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:53: error: expected ']' before '}' token
   37 |                                 ans += a[i]*a[j]*a[k};
      |                                                     ^
      |                                                     ]
a.cc:37:53: error: expected ';' before '}' token
   37 |                                 ans += a[i]*a[j]*a[k};
      |                                                     ^
      |                                                     ;
a.cc: At global scope:
a.cc:41:9: error: 'cout' does not name a type
   41 |         cout << ans << endl;
      |         ^~~~
a.cc:42:9: error: expected unqualified-id before 'return'
   42 |         return 0;
      |         ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include  <cstdio >
#include  <iostream >
using  namespace  std;
typedef  long  long ll;
string s;
int N;
ll m,a,r,c,h;
ll D[5];
int P[10]={0,0,0,0,0,0,1,1,1,2};
int Q[10]={1,1,1,2,2,3,2,2,3,3};
int R[10]={2,3,4,3,4,4,3,4,4,4};
int  main()
{
scanf ("%d",&N);
for(int i=0;i<N;i++)
{
cin >>s;
if(s[0]=='M')m++;
if(s[0]=='A')a++;
if(s[0]=='R')r++;
if(s[0]=='C')c++;
if(s[0]=='H')h++;
}
D[0]=m,D[1]=a,D[2]=r,D[3]=c,D[4]=h;
ll res =0;
for(int d=0;d<10;d++)
res+=D[P[d]]*D[Q[d]]*D[R[d]];
printf ("% lld\n",res);
}

Compiler output:
a.cc:1:11: fatal error: cstdio : No such file or directory
    1 | #include  <cstdio >
      |           ^~~~~~~~~
compilation terminated.