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

#include "pch.h"
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <vector>

using namespace std;

map<char, vector<int> > SerchChractorIndex(const string &s)
{
  map<char, vector<int> > chara_indexs;
  set<int> ignore_indexs;

  for (int i = 0; i < s.size(); ++i)
  {
    //探索済みの文字は調べない
    if (chara_indexs.count(s[i]) != 0) continue;

    vector<int> indexs;
    for (int j = 0; j < s.size(); ++j)
    {
      //すでに探索済みのindexは見ない
      if (ignore_indexs.count(j) != 0) continue;

      if (s[i] == s[j])
      {
        indexs.push_back(j);
        ignore_indexs.insert(j);
      }
    }
    chara_indexs.insert(make_pair(s[i], indexs));
    delete &indexs;
  }
  ignore_indexs.clear();
  return chara_indexs;
}

void C_110()
{
  string S, T;
  cin >> S >> T;

  //map<char, vector<int> > S_chraIndexs;
  //set<int> ignore_indexs;
  //for (int i = 0; i < S.size(); ++i)
  //{
  //  //探索済みの文字は調べない
  //  if (S_chraIndexs.count(S[i]) != 0) continue;
  //  
  //  vector<int> indexs;
  //  for (int j = 0; j < S.size(); ++j)
  //  {
  //    //すでに探索済みのindexは見ない
  //    if (ignore_indexs.count(j) != 0) continue;

  //    if (S[i] == S[j])
  //    {
  //      indexs.push_back(j);
  //      ignore_indexs.insert(j);
  //    }
  //  }
  //  S_chraIndexs.insert(make_pair(S[i], indexs));
  //  delete &indexs;
  //}

  //map<char, vector<int> > T_chraIndexs;
  //ignore_indexs.clear();
  //for (int i = 0; i < T.size(); ++i)
  //{
  //  //探索済みの文字は調べない
  //  if (T_chraIndexs.count(T[i]) != 0) continue;

  //  vector<int> indexs;
  //  for (int j = 0; j < T.size(); ++j)
  //  {
  //    //すでに探索済みのindexは見ない
  //    if (ignore_indexs.count(j) != 0) continue;

  //    if (T[i] == T[j])
  //    {
  //      indexs.push_back(j);
  //      ignore_indexs.insert(j);
  //    }
  //  }
  //  T_chraIndexs.insert(make_pair(T[i], indexs));
  //  delete &indexs;
  //  delete &ignore_indexs;
  //}

  map<char, vector<int> > S_chraIndexs = SerchChractorIndex(S);
  map<char, vector<int> > T_chraIndexs = SerchChractorIndex(T);

  bool flag = false;
  for (map<char, vector<int> >::iterator itr_S = S_chraIndexs.begin(); itr_S != S_chraIndexs.end(); ++itr_S)
  {
    for (map<char, vector<int> >::iterator itr_T = T_chraIndexs.begin(); itr_T != T_chraIndexs.end(); ++itr_T)
    {
      if (itr_S->second == itr_T->second) 
      {
        flag = true;
        break;
      }
    }

    if(flag == false)
    {
      cout << "NO" << endl;
      return;
    }
    else flag = false;

  }
  cout << "YES" << endl;
  return ;
}

int main()
{
  C_110();
  return 0;
}

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

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

#define LSOne(S) ((S) & (-S))

#define EPS 1e-6
#define MOD 1000000007

#define fi first
#define se second
#define pb push_back
#define ende '\n'

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define mset(x, y) memset(&x, (y), sizeof(x))

using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n, m, p;
  bitset<101234> problemas;
  ll erros[101234];
  memset(erros, 0);
  string s;
  cin >> n >> m;

  ll acertos, penalidades;
  acertos = penalidades = 0;

  while (m--) {
    cin >> p >> s;
    if ((s == "AC") && (!problemas[p])) {
      penalidades += erros[p];
      problemas[p] = 1;
      acertos++;
    }
    else if ((s == "WA") && (!problemas[p]))
      erros[p]++;
  }
  cout << acertos <<  ' ' << penalidades << ende;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: too few arguments to function 'void* memset(void*, int, size_t)'
   28 |   memset(erros, 0);
      |   ~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:14: note: declared here
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |              ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
 
int main() {
    int N;
    cin >> N;

    vector <int> P(N), Q(N);

    rep(i,N){ cin >> P.at(i);}
    rep(i,N){ cin >> Q.at(i);}

    vector <int> a(N);
    rep(i,N) a.at(i) = i + 1;

    map < vector<int>, int> m_a;
    do{
        m_a[a] = m_a.size();
    }while(next_permutation(a.begin(),a.end())
    int ans = abs(m_a.at(P)-m_a.at(Q));

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:47: error: expected ')' before 'int'
   20 |     }while(next_permutation(a.begin(),a.end())
      |           ~                                   ^
      |                                               )
   21 |     int ans = abs(m_a.at(P)-m_a.at(Q));
      |     ~~~                                        
a.cc:20:47: error: expected ';' before 'int'
   20 |     }while(next_permutation(a.begin(),a.end())
      |                                               ^
      |                                               ;
   21 |     int ans = abs(m_a.at(P)-m_a.at(Q));
      |     ~~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
    int n,m,anum=0,wnum=0;
    cin>>n>>m;
    int wa[n+1];
    bool ac[n+1];
    for(int i=0;i<=n;i++)
      {
          ac[i]=false;
          wa[i]=0;
      }
    
    while(m--)
     {
         int p;string s;
         cin>>p>>s;
         if(s=="WA"&& ac[p]==false)
               ++wa[p];
         else if(s=="AC"&& ac[p]==false)
             ac[p]=true;
          else (ac[p])
             continue;
     }
     
     for(int j=1;j<=n;j++)
       {
             if(ac[j])
               {
                   wnum+=wa[j];
                   anum++;
               }
       }
    
    cout<<anum<<" "<<wnum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before 'continue'
   25 |           else (ac[p])
      |                       ^
      |                       ;
   26 |              continue;
      |              ~~~~~~~~
Language: C++

#include<cstdio>
int n,m,cnta,cntw;
bool ac[233333];
int main(){
    scanf("%d%d",&n,&m);
    while(m--){
        int k;scanf("%d",&k);
        if(getchar(),getchar(),getchar()=='C'){
            if(!ac[k)cnta++,ac[k]=1;
        }else if(!ac[k])cntw++;
    }
    printf("%d %d\n",cnta,cntw);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ']' before ')' token
    9 |             if(!ac[k)cnta++,ac[k]=1;
      |                     ^
      |                     ]
Language: C

#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	bool problem[N] = {0};
	int solved = 0, penalty = 0;
	while(M-- > 0){
		int p;
		char S[2];
		cin >> p >> S;
		
		if(!problem[p]){
			if(S[0] == 'A'){
				solved++;
				problem[p] = true;
			}else{
				penalty++;
			}
		}
	}
	
	cout << solved << " " << penalty;
	return 0;
}

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

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

int main(){
	int N, M;
	cin >> N >> M;
	bool problem[N] = {0};
	int solved = 0, penalty = 0;
	while(M-- > 0){
		int p;
		char S[2];
		cin >> p >> S;
		
		if(!problem[p]){
			if(S[0] == 'A'){
				solved++;
				problem[p] = true;
			}else{
				penalty++;
			}
		}
	}
	
	cout << solved << " " << penalty;
	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: Java

import java.util.*;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        if(M>0){
            int[] p = new int[M];
            String[] S = new String[M];
            int AC = 0;
            int WA = 0;
            int x = 2;
            String A = "AC";
            String W = "WA";
            
            for(int i=0; i<M; i++){
                p[i] = sc.nextInt();
                S[i] = sc.next();
            }
            if(S[0].equals(W)){
                WA += 1;
            }
            else if(S[0].equals(A)){
                AC += 1;
                x = 0;
            }
            for(int i=1; i<M; i++){
                if(p[i]==p[i-1] && i<x){
                    if(S[i].equals(W)){
                        WA += 1;
                        x += 1;
                    }
                    else if(S[i].equals(A)){
                        AC += 1;
                        x = i;
                    }
                }
                else if(p[i]!=p[i-1]){
                    if(S[i].equals(W)){
                        WA += 1;
                    }
                    else if(S[i].equals(A)){
                        AC += 1;
                    }
                    x = i+2;
                }
            }
            System.out.println(AC + " " + WA);
        }
        if(M==0){
            System.out.println(0 + " " + 0);
        }

    }
}

Compiler output:
Main.java:3: error: class at151c is public, should be declared in a file named at151c.java
public class at151c{
       ^
1 error
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] po=new boolean[N+1];
        int[] pena=new int[N+1];
        Arrays.fill(pena,0);
        for(int i=0; i<M; i++){
            int p=sc.nextInt();
            String s=sc.next();
            if(s.equals("WA")){
                if(!po[p]){
                    pena[p]++;
                }
                else{}
            }
            else if(s.equals("AC")){
                if(!po[p]){
                    po[p]=true;
                }
            }
        }
        int penasum=0;
        int ans=0;
        for(int i=0; i<=N; i++){
            if(po[i]) {
                ans++;
                penasum+=pena[i];
            }
        }

        System.out.println(ans+" "+penasum);
    }

}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        Arrays.fill(pena,0);
        ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

n, m = map(int, input().split())

is_acs = [False] * n
wa_counts = [0] * n

for _ in range(m):
    p, s = input().split()
    p = int(p) - 1

    if s == "AC":
        is_acs[p] = True

    elif not is_acs[p]:
        wa_counts[p] += 1


ac_count = 0
penalty_count = 0

for a, w in zip(is_acs, wa_counts):
    if a:
        ac_count += 1
        penalty_count += w

print(ac_count, penalty_count)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[10];
	int m,n,num,b[100005]={0},ac=0,wa=0;
	scanf("%d%d",&m,&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%s",&num,a);
		if(b[num]!=-1&&a[0]=='A')
		{
			ac++;
			b[num]=-1;
		}
		if(b[num]!=-1&&a[0]=='W')
		{
			wa++;
		}
	}
	printf("%d %d",ac,wa);
}

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

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

typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;

#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) in.begin(),in.end()
#define ALL(in,K) (in),(in)+(K)

#define INF 1e18
#define MOD 1000000007
#define SIZE 10005
#define PI 	3.14159265358979323846

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a, b)*b; } //最小公倍数

ll input(){
  ll a;
  cin >> a;
  return a;
}

vi sub(vector<bool> fin,ll n) {
  vi ret;
  REP(i,n) {
    if(fin.at(i))continue;
    vector<bool> cp = fin;
    cp.at(i) = true;
    vi result = sub(cp,n);
    ret.insert(ret.end(),result.begin(),result.end());
  }
  return ret;
}

int main() {
  ll n,m;
  cin >> n >> m;
  vector<bool> fin(m,false);
  ll ans1=0, ans2=0;
  REP(i,m) {
    ll p;
    string s;
    cin >> p >> s;
    if(s=="AC") ans1+=(fin(p)?0:1);
    else ans2+=(fin(p)?1:0);
  }
  cout << ans1 << " " << ans2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:27: error: no match for call to '(std::vector<bool>) (ll&)'
   54 |     if(s=="AC") ans1+=(fin(p)?0:1);
      |                        ~~~^~~
a.cc:55:20: error: no match for call to '(std::vector<bool>) (ll&)'
   55 |     else ans2+=(fin(p)?1:0);
      |                 ~~~^~~
Language: C++

// [[ABC134C] Exception Handling] https://www.luogu.com.cn/problem/AT4843
#include <algorithm>
#include <iostream>
#include <map>
using namespace std;
int AC[105000], ACans, WAans, WA[105000];
int main() {
  int n, m;
  cin >> n >> m;

  int p;
  string S;
  while (M--) {
    cin >> p >> S;
    if (AC[p]) continue;
    if (S == "AC") {
      AC[p] = true;
      ACans++;
      WAans += WA[p];
    } else if (S == "WA") {
      WA[p]++;
    }
  }
  cout << ACans << " " << WAans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'M' was not declared in this scope
   13 |   while (M--) {
      |          ^
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
    int n,m,p;
    int cnt=0,a[10005],ans=0;
    char s[10];
    scanf("%d%d",&n,&m);
    memset(vis,0,sizeof(vis));
    for(int i=1;i<=m;i++)
    {
        scanf("%d %s",&p,s);
        if(!vis[p])
        {
            if(strcmp(s,"AC")==0)
            {
                cnt++;
                ans+=a[p];
                vis[p]=1;
            }
            else
            {
                a[p]++;
            }
        }
    }
    printf("%d %d\n",cnt,ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'vis' was not declared in this scope
    9 |     memset(vis,0,sizeof(vis));
      |            ^~~
Language: C++

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
   int n,m;
   cin >> n >> m;
   int WA[100010],numAC,numWA;
   bool AC[100010];
   rep(i,0,n){
   	 WA[i]=0;
   	 AC[i]=false;
   }
   while(M--){
   	int p;
   	string s;
   	cin >> p >> s;
    if(AC[p]) continue;
    if(s=="AC"){
    	AC[p]=true;
    	numAC++;
    	numWA += WA[p];
    }else if(s=="WA"){
        numWA++;
    }
   }cout << numAC << " " << numWA << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'M' was not declared in this scope
   17 |    while(M--){
      |          ^
Language: C

#include<stdio.h>
int main(void){
  int N,M;
  scanf("%d %d",&N,&M);
  int p[100001],s[100001][3];
  int i;
  for(i=0;i<M;i++){
    scanf("%d %s",&p[i],&s[i])
      printf("%d %s\n",p[i],s[i]);
  }
  
    

Compiler output:
main.c: In function 'main':
main.c:8:31: error: expected ';' before 'printf'
    8 |     scanf("%d %s",&p[i],&s[i])
      |                               ^
      |                               ;
    9 |       printf("%d %s\n",p[i],s[i]);
      |       ~~~~~~                   
main.c:10:3: error: expected declaration or statement at end of input
   10 |   }
      |   ^
Language: C++

#include <bits/c++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)

using namespace std;

int main(){
  int n , m;
  cin >> n >> m;
  vector <int> ac(n) , pe(n);
  rep(i,m){
    int p;
    string s;
    cin >> p >> s;
    --p;
    if(ac[p]) continue;
    if(s == "AC"){
      ac[p] = 1;
    }else{
      pe[p]++;
    }
  }
  int addAC = 0 , addPena =0;
  rep(i,n){
    addAC+= ac[i];
    if(ac[i]) addPena += pe[i];
  }
  cout << addAC << " " << addPena << endl;
  return 0;
}


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

#include <<bits/c++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)

using namespace std;

int main(){
  int n , m;
  cin >> n >> m;
  vector <int> ac(n) , pe(n);
  rep(i,m){
    int p;
    string s;
    cin >> p >> s;
    --p;
    if(ac[p]) continue;
    if(s == "AC"){
      ac[p] = 1;
    }else{
      pe[p]++;
    }
  }
  int addAC = 0 , addPena =0;
  rep(i,n){
    addAC+= ac[i];
    if(ac[i]) addPena += pe[i];
  }
  cout << addAC << " " << addPena << endl;
  return 0;
}


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

#include <<bits/c++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)

using namespace std;

int main(){
  int n , m;
  cin >> n >> m;
  vector <int> ac(n) , pe(n);
  rep(i,m){
    int p;
    string s;
    cin >> p >> s;
    --p;
    if(ac[p]) continue;
    if(s == "AC"){
      sc[p] = 1;
    }else{
      pe[p]++;
    }
  }
  int addAC = 0 , addPena =0;
  rep(i,n){
    AC+= ac[i];
    if(ac[i]) PENA += pe[i];
  }
  cout << addAC << " " << addPena << endl;
  return 0;
}


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

#include <<bits/c++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)

using namespace std;

int main(){
  int n , m;
  cin >> n >> m;
  vector <int> ac(n),pe(n);
  rep(i,n){
    int p;
    string s;
    cin >> p >> s;
    --p;
    if(ac[p]) continue;
    if(s == "AC"){
      sc[p] = 1;
    }else{
      pena[p]++;
    }
  }
  int addAC = 0 , addPena =0;
  rep(i,n){
    AC+= ac[i];
    if(ac[i]) PENA += pena[i];
  }
  cout << addAC << " " << addPena << endl;
  return 0;
}


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

#include <iostream>
#include <string>
#include <vector>
//#include <<bits/c++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)

using namespace std;

int main(){
  int n , m;
  cin >> n >> m;
  vector <int> ac(n),pe(n);
  rep(i,n){
    int p;
    string s;
    cin >> p >> s;
    --p;
    if(ac[p]) continue;
    if(s == "AC"){
      sc[p] = 1;
    }else{
      pena[p]++;
    }
  }
  int addAC = 0 , addPena =0;
  rep(i,n){
    AC+= ac[i];
    if(ac[i]) PENA += pena[i];
  }
  cout << addAC << " " << addPena << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'sc' was not declared in this scope; did you mean 's'?
   20 |       sc[p] = 1;
      |       ^~
      |       s
a.cc:22:7: error: 'pena' was not declared in this scope; did you mean 'pe'?
   22 |       pena[p]++;
      |       ^~~~
      |       pe
a.cc:27:5: error: 'AC' was not declared in this scope; did you mean 'ac'?
   27 |     AC+= ac[i];
      |     ^~
      |     ac
a.cc:28:15: error: 'PENA' was not declared in this scope
   28 |     if(ac[i]) PENA += pena[i];
      |               ^~~~
a.cc:28:23: error: 'pena' was not declared in this scope; did you mean 'pe'?
   28 |     if(ac[i]) PENA += pena[i];
      |                       ^~~~
      |                       pe
Language: Java

import java.util.Scanner;

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

		//解いたことがあるかカウンター
		int[] ac = new int[N];
        //ACしたならばWAを数えてもよい退避場所
		int[] wa = new int[N];

		//答えカウンター
		int ok = 0;
		int ng = 0;

		for (int i = 0; i < M; i++) {
			//問題番号は配列のキーにあたる
			int indx = sc.nextInt();
			String acWa = sc.next();

			if (acWa.equals("AC")) {
				if (ac[indx - 1] == 1) {

				} else {
					ok++;
					ac[indx - 1] = 1;
				}
			} else {
				if (ac[indx - 1] == 1) {

				} else {
					wa[indx - 1]++;
				}
			}
		}
      　//ACしたならばWAを数えてもよい
		for (int i = 0; i < N; i++) {
			if (ac[i] == 1) {
				ng = ng + wa[i];
			}else {
			}
		}

		System.out.println(ok + " " + ng);
	}
}

Compiler output:
Main.java:38: error: illegal character: '\u3000'
      ?//AC?????WA???????
      ^
1 error
Language: C++

import java.io.*;
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner sc = new Scanner(System.in);
       HashMap<Integer,String> hm = new HashMap<>();
       int n  = sc.nextInt();
       int m = sc.nextInt();
      int pen=0,correct=0;
       for(int i=0; i<m; i++){
           int  x = sc.nextInt();
           String s = sc.next();
           if(hm.containsKey(x)){
               String ver = hm.get(x);
               if(ver.equals("WA") && s.equals("WA"))
                     pen++;
               else if(ver.equals("WA") && s.equals("AC")){
                   hm.put(x,"AC");correct++;
               }
           }else{
               if(s.equals("AC"))
                   correct++;
               if(s.equals("WA"))
                   pen++;
               hm.put(x,s);
           }
       }
       System.out.println(correct+" "+pen);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;




    int main(){
        int n, m;
        std::cin >> n >> m;
        std::vector<int> ac(n), pena(n);
        rep(i, m){
            int p;
            string s;
            std::cin >> p >> s;
            --p;
            if (ac[p]) contiune;
            if (s == "AC")
            {
                ac[p] = 1;
            }else{
                pena[p]++;
            }
        }
        int AC = 0, PENA =0;
        rep(i, n){
            AC += ac[i];
            if(ac[i]) PENA += pena[i];
        }
        std::cout << AC << PENA << "\n";
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: 'contiune' was not declared in this scope
   19 |             if (ac[p]) contiune;
      |                        ^~~~~~~~
Language: C++

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

int main(){
  int n, m; cin>>n >>m;
  vector<int> AC(n, 0), WA(n, 0);
  for(int i=0;i<m;i++){
    int p, s;
    cin>>p >>s;
    if(AC[p-1]==0){
      if(s=="AC"){
        AC[p-1]++;
      }else{
        WA[p-1]++;
      }
    }
  }
  
  int ans1=0, ans2=0;
  for(int i=0;i<n;i++){
    ans1+=AC[i];
    ans2+=WA[i];
  }
  
  cout<<ans1<<" "<<ans2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |       if(s=="AC"){
      |          ~^~~~~~
Language: C++

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

int main(){
  int ACnum = 0;
  int WAnum = 0;
  int N,M;
  cin >>N>>M;
  int WA[N];
  bool AC[N];
  for(int i=0;i<N;i++){
    WA[i] =0;
    AC[i] =false;
  }
  
  while(M--){
    int p;
    string S;
    cin >>p>>S;
    if(AC[p]) {
      continue;
    }
    if(S == "AC"){
      AC[i] = true;
      ACnum ++;
      WAnum += WA[p];
    }
    else if (S == "WA"){
      WA[p] ++;
    }
  }
  cout <<ACnum<<" "<<WAnum<<endl;
}


      
    
}

  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'i' was not declared in this scope
   24 |       AC[i] = true;
      |          ^
a.cc: At global scope:
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

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

int N,M;
int WA[105000];
bool AC[105000];

void solve()
{
    cin >> N >> M;
    int WAnum = 0,ACnum = 0;
    for(int i= 1;i <= N; i++)
    {
        WA[i] = 0;
        AC[i] = false;
    }

    while(M--)
    {
        int p;
        string S;
        cin >> p >> S;
        if(AC[p]) continue;
        if(S == "AC") {
            AC[p] = true;
            ACnum++;
            WAnum += WA[p];
        } else if(S == "WA") {
            WA[p]++;
        }
    }
    count << ACnum << " " << WAnum << endl;
}

int main() {
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:11: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   32 |     count << ACnum << " " << WAnum << endl;
      |     ~~~~~~^~~~~~~~
Language: C++

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

int main(){
  int n, m; cin>>n >>m;
  vector<pair<int, string>> ps(m, pair<int,string>);
  for(int i=0;i<m;i++){
    cin>>ps[i].first >>ps[i].second; //firstが問題番号, secondが結果
  }
  
  vector<pair<int, int>> pr(n, make_pair(0, 0)); //firstがペナルティ, secondがAC数
  for(int i=0;i<m;i++){
    if(pr[ps[i].first-1].second == 0){
      if(ps[i].second == "AC")pr[ps[i].first-1].second++;
      else pr[ps[i].first-1].first++;
    }
  }
  
  int ans1=0, ans2=0; //ans1は正答数, ans2はペナルティ数
  for(int i=0;i<n;i++){
    if(pr[ps[i].first-1].second > 0)ans1++;
    ans2+=pr[ps[i].first-1].first;
  }
  
  cout<<ans1<<" "<<ans2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:51: error: expected primary-expression before ')' token
    6 |   vector<pair<int, string>> ps(m, pair<int,string>);
      |                                                   ^
Language: C++


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

    uint N,M;
    cin>>N>>M;
    set<int> ACs;
    vector<int> penalties(N);
    iter(i,M){
        int p;
        string S;
        cin>>p>>S;
        auto it = ACs.find(p);
        if (it == ACs.end()) {
            //not found
            if (S=="AC") ACs.insert(p);
            else penalties[p]++;
        }
    }

    auto AC_num = ACs.size();
    auto penalty_num =0;
    forin(p, ACs){
        penalty_num+=penalties[p];
    }

    cout<<AC_num<<" "<<penalty_num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin.tie(0);
      |     ^~~
a.cc:4:5: error: 'ios' has not been declared
    4 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:6:5: error: 'uint' was not declared in this scope; did you mean 'int'?
    6 |     uint N,M;
      |     ^~~~
      |     int
a.cc:7:10: error: 'N' was not declared in this scope
    7 |     cin>>N>>M;
      |          ^
a.cc:7:13: error: 'M' was not declared in this scope
    7 |     cin>>N>>M;
      |             ^
a.cc:8:5: error: 'set' was not declared in this scope
    8 |     set<int> ACs;
      |     ^~~
a.cc:8:9: error: expected primary-expression before 'int'
    8 |     set<int> ACs;
      |         ^~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> penalties(N);
      |     ^~~~~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> penalties(N);
      |            ^~~
a.cc:10:10: error: 'i' was not declared in this scope
   10 |     iter(i,M){
      |          ^
a.cc:10:5: error: 'iter' was not declared in this scope
   10 |     iter(i,M){
      |     ^~~~
a.cc:22:19: error: 'ACs' was not declared in this scope
   22 |     auto AC_num = ACs.size();
      |                   ^~~
a.cc:24:11: error: 'p' was not declared in this scope
   24 |     forin(p, ACs){
      |           ^
a.cc:24:5: error: 'forin' was not declared in this scope
   24 |     forin(p, ACs){
      |     ^~~~~
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout<<AC_num<<" "<<penalty_num;
      |     ^~~~
Language: C++

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

int main(){
 int n,m; cin >> n >> m;
 vector<int> check(n,0);
 vector<int> che(n,0)
 int wa=0; int ac=0;
 rep(i,m){
     int p; string s; cin >> p >> s;
     if(check[p-1]==0){
         if(s=="WA") check[p-1]++;
         else {
             ac++;
             che[p-1]=1;
         }
     }
 }
rep(i,n) if(che[i] == 1) wa+=check[i];
 cout << ac << ' ' << wa << endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: expected ',' or ';' before 'int'
   11 |  int wa=0; int ac=0;
      |  ^~~
a.cc:22:26: error: 'wa' was not declared in this scope
   22 | rep(i,n) if(che[i] == 1) wa+=check[i];
      |                          ^~
a.cc:23:23: error: 'wa' was not declared in this scope
   23 |  cout << ac << ' ' << wa << endl;
      |                       ^~
Language: C++


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

    int p;
    std::string S;
    bool AC[N + 1] = {false};

    int ac_count = 0, wa_count = 0;
    for (int i = 0; i < M; ++i) {
        std::cin >> p >> S;
        if (AC[p]) {
            continue;
        }

        if (S == "AC") {
            ac_count++;        
            AC[p] = true;
        } else {
            wa_count++;
        }
    }

    std::printf("%d %d\n", ac_count, wa_count);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::cin >> N >> M;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:7:10: error: 'string' is not a member of 'std'
    7 |     std::string S;
      |          ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | 
a.cc:12:14: error: 'cin' is not a member of 'std'
   12 |         std::cin >> p >> S;
      |              ^~~
a.cc:12:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:26: error: 'S' was not declared in this scope
   12 |         std::cin >> p >> S;
      |                          ^
a.cc:25:10: error: 'printf' is not a member of 'std'
   25 |     std::printf("%d %d\n", ac_count, wa_count);
      |          ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;
    map<int,int> mp;
    int p = 0,ans = 0;
    for(int i = 0; i < m; i++){
        int a; string s;
        cin >> a >> s;
        if(mp[a] == -1)
            continue
        if(s == "AC"){
            p += mp[a];mp[a] = -1; ans++;}
        else
            mp[a]++;
    }
    cout << ans << ' ' << p << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before 'if'
   15 |             continue
      |                     ^
      |                     ;
   16 |         if(s == "AC"){
      |         ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using llong = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

int main() {
   int n, m;
   cin >> n >> m;
   vector<int> pena(n), ans(n);
   rep(i, m) {
      int p;
      string s;
      cin >> p >> s;
      p--;
      if (ans[p] == 0) {
         if (s == "AC") {
            ans[p]++;
         } else {
            pena[p]++;
         }
      }
   }
   pair<int, int> res;
   rep(i, n) {
      res.first += ans[i];
      res.second += pena[i];
   }
   pirntf("%d %d\n", res.first, res.second);
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:4: error: 'pirntf' was not declared in this scope; did you mean 'printf'?
   32 |    pirntf("%d %d\n", res.first, res.second);
      |    ^~~~~~
      |    printf
Language: C++

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

int status[100005];
int main() {
    int n, m;
    cin >> n >> m;
    memset(status, 0, sizeof(status));
    int ans = 0, penaleits = 0;
    for(int i = 0; i < m; i++){
        int p;
        string s;
        cin >> p >> s;
        if(status[p] == 0 && s == "WA") penaleits++;
        if(status[p] == 0 && s == "AC") {ans++; status[p] = 1;}
    }
    cout << ans << " " << penaleits << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'memset' was not declared in this scope
   11 |     memset(status, 0, sizeof(status));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;

    vector<bool> isAC(n, false);
    vector<int> cntWA(n, 0);
    for (int i = 0; i < m; ++i) {
        int p;
        string s;
        cin >> p >> s;
        p--;

        if (s == "AC") {
            isAC[p] = true;
        } else if (isAC[p] == false) {
            cntWA[p]++;
        }
    }

    int ac = 0, wa = 0;
    for (int i = 0; i < n; ++i) {
        if (isAC[i] == true) {
            ac++;
            wa += cntWA[i];
        }
    }

    cout << ac << " " << wa << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n >> m;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<bool> isAC(n, false);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'bool'
    7 |     vector<bool> isAC(n, false);
      |            ^~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> cntWA(n, 0);
      |            ^~~
a.cc:11:9: error: 'string' was not declared in this scope
   11 |         string s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:12:21: error: 's' was not declared in this scope
   12 |         cin >> p >> s;
      |                     ^
a.cc:16:13: error: 'isAC' was not declared in this scope
   16 |             isAC[p] = true;
      |             ^~~~
a.cc:17:20: error: 'isAC' was not declared in this scope
   17 |         } else if (isAC[p] == false) {
      |                    ^~~~
a.cc:18:13: error: 'cntWA' was not declared in this scope
   18 |             cntWA[p]++;
      |             ^~~~~
a.cc:24:13: error: 'isAC' was not declared in this scope
   24 |         if (isAC[i] == true) {
      |             ^~~~
a.cc:26:19: error: 'cntWA' was not declared in this scope
   26 |             wa += cntWA[i];
      |                   ^~~~~
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << ac << " " << wa << endl;
      |     ^~~~
a.cc:30:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:32: error: 'endl' was not declared in this scope
   30 |     cout << ac << " " << wa << endl;
      |                                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main(){
	ll N,M,p,res=0;
  	string str;
  	cin>>N>>M;
	set<ll> liste;
	vector<ll>vect(N,0);
	for (ll i=0;i<M;i++){
		cin>>p>>str;
		if(str=="AC")set.insert(p);
		if(set.find(p)==set.end()&&str=="WA")vect[p]++;
	}
	for(auto i:set)res+=vect[i];
	cout<<liste.size()<<" "<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: expected unqualified-id before '.' token
   13 |                 if(str=="AC")set.insert(p);
      |                                 ^
a.cc:14:23: error: expected unqualified-id before '.' token
   14 |                 if(set.find(p)==set.end()&&str=="WA")vect[p]++;
      |                       ^
a.cc:16:23: error: missing template arguments before ')' token
   16 |         for(auto i:set)res+=vect[i];
      |                       ^
Language: C++

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

int main() {
 int N,M,ac=0,wa=0;
  cin>>N>>M;
  vector<int> A(M);
  vector<string>B(M);
  unordered_map<int,int> map;
    for(int i=0; i<M; i++){
      cin>>A[i]>>B[i];
      if(!map.count(A[i])){
     	 if(B[i]=="AC"){map[A[i]]=1; ac++;}
         else wa++;}
    }
  cout<<ac<<" "<<wa<<endl;
}

  
  
  
  
  
  
  
  
  
  
  
  
  
}


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

#include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(int i=0; i< 100000 ; ++i){
    	Q[i]=1;
    }
     
    for (int i=0;i<M; ++i){
    	scanf("%d%d", &p[i], &S[i]);
        if(strcmp(S[i],WA)==0) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
    
    printf("%d %d", &AC_count, &WA_count);
 }


Compiler output:
main.c: In function 'main':
main.c:14:12: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   14 |         if(strcmp(S[i],WA)==0) ++WA_count;
      |            ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int main(){
main.c:14:24: error: 'WA' undeclared (first use in this function)
   14 |         if(strcmp(S[i],WA)==0) ++WA_count;
      |                        ^~
main.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   14 |         if(strcmp(S[i],WA)==0) ++WA_count;
      |                   ~^~~
      |                    |
      |                    int
main.c:14:20: note: expected 'const char *' but argument is of type 'int'
Language: C

#include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(int i=0; i< 100000 ; ++i){
    	Q[i]=1;
    }
     
    for (int i=0;i<M; ++i){
    	scanf("%d%s", &p[i], &S[i]);
        if(S[i]==WA) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
    
    printf("%d %d", &AC_count, &WA_count);
 }


Compiler output:
main.c: In function 'main':
main.c:14:18: error: 'WA' undeclared (first use in this function)
   14 |         if(S[i]==WA) ++WA_count;
      |                  ^~
main.c:14:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(int i=0; i< 100000 ; ++i){
    	Q[i]=1;
    }
     
    for (int i=0;i<M; ++i){
    	scanf("%d%d", &p[i], &S[i]);
        if(S[i]==WA) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
    
    printf("%d%d", &AC_count, " ", &WA_count);
 }


Compiler output:
main.c: In function 'main':
main.c:14:18: error: 'WA' undeclared (first use in this function)
   14 |         if(S[i]==WA) ++WA_count;
      |                  ^~
main.c:14:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(int i=0; i< Q ; ++Q){
    	Q[i]=1;
    }
     
    for (int i=0;i<M; ++i){
    	scanf("%d%d", &p[i], &S[i]);
        if(S[i]==WA) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
    
    printf("%d%d", &AC_count, " ", &WA_count);
 }


Compiler output:
main.c: In function 'main':
main.c:8:19: warning: comparison between pointer and integer
    8 |     for(int i=0; i< Q ; ++Q){
      |                   ^
main.c:8:25: error: lvalue required as increment operand
    8 |     for(int i=0; i< Q ; ++Q){
      |                         ^~
main.c:14:18: error: 'WA' undeclared (first use in this function)
   14 |         if(S[i]==WA) ++WA_count;
      |                  ^~
main.c:14:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(i=0; i< Q ; ++Q){
    	Q[i]=1;
    }
     
    for (i=0;i<M; ++i){
    	scanf("%d%d", &p[i], &S[i]);
        if(S[i]==WA) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
    
    printf("%d%d", &AC_count, " ", &WA_count);
 }


Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'i' undeclared (first use in this function)
    8 |     for(i=0; i< Q ; ++Q){
      |         ^
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:21: error: lvalue required as increment operand
    8 |     for(i=0; i< Q ; ++Q){
      |                     ^~
main.c:14:18: error: 'WA' undeclared (first use in this function)
   14 |         if(S[i]==WA) ++WA_count;
      |                  ^~
Language: C

include<stdio.h>
int main(){
	int N,M;
	int p[100000], S[100000], Q[100000];
    int AC_count=0;
    int WA_count=0;
	scanf("%d%d", &N , &M);
    for(i=0; i< Q ; ++Q){
    	Q[i]=1;
    }
     
    for (i=0;i<M; ++i){
    	scanf("%d%d", &p[i], &S[i]);
        if(S[i]==WA) ++WA_count;
        	else if (Q[i]==1){
             ++AC_count;
             Q[i]=0;
        }
    }
 }

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){

  int n,m;
  int a;
  int a1,a2;
  string s;
  
  
  
  for(int i = 0;i < m;i ++){

     cin >> a.at(i) >> s.at(i);
    
    if(s.at(i) == 'AC'){

       a2 ++;
    }

    if(a.at(i) != a.at(i + 1)){

     a1 ++;
  }else{
    
      a1 + 0;
    }
  }
cout << a1 << a2 <<endl;
}

 


  
  

Compiler output:
a.cc:16:19: warning: multi-character character constant [-Wmultichar]
   16 |     if(s.at(i) == 'AC'){
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:14:15: error: request for member 'at' in 'a', which is of non-class type 'int'
   14 |      cin >> a.at(i) >> s.at(i);
      |               ^~
a.cc:21:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   21 |     if(a.at(i) != a.at(i + 1)){
      |          ^~
a.cc:21:21: error: request for member 'at' in 'a', which is of non-class type 'int'
   21 |     if(a.at(i) != a.at(i + 1)){
      |                     ^~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
//max=({});
//条件式が真ならwhileの中身を回し続ける

int INF = 100000;

int main() {
	int n, m;
	cin >> n >> m;
	int AC = 0;
	int WA = 0;
	vector<bool>flag(n + 1);
	rep(i, n) {
		flag[i + 1] = false;
	}
	rep(i, m) {
		int p;
		string s;
		cin >> p >> s;
		if (s[i] == "AC") {
			flag[p[i]] = true;
			AC++;
		}
		else if (flag[p[i]] = true)continue;
		else if (flag[p[i]] = false)WA++;
	}
	cout << AC <<" "<< WA << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |                 if (s[i] == "AC") {
a.cc:25:31: error: invalid types 'int[int]' for array subscript
   25 |                         flag[p[i]] = true;
      |                               ^
a.cc:28:32: error: invalid types 'int[int]' for array subscript
   28 |                 else if (flag[p[i]] = true)continue;
      |                                ^
a.cc:29:32: error: invalid types 'int[int]' for array subscript
   29 |                 else if (flag[p[i]] = false)WA++;
      |                                ^
Language: C++

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

int main(){
    int n,m;
    cin>>n>>m;
    int ac=0,wa=0;
    set<int>a;
    for(int i=0;i<m;i++){
        int t;
        string s;
        cin>>t>>s;
        if(a.find(t)==a.end()){
            if(s=="WA"){
                wa++;
            }
            else{
                ac++;
                a.insert(t);
            }
        }
        else{
            if(s=="WA"){
                wa++
                a.erase(t);
            }
        }
    }
    cout<<ac<<" "<<wa<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected ';' before 'a'
   24 |                 wa++
      |                     ^
      |                     ;
   25 |                 a.erase(t);
      |                 ~
Language: C++

  vector<int> p(m);
  vector<string> s(m);
  rep(i,m)cin >> p[i] >> s[i];
  rep(i,m){
    if(s[i]=="AC"){
      if(tmp<p[i]){
	tmp = p[i];
	ac+=1;
      }
    }
    else{
      if(tmp<p[i])wa+=1;
    }
  }
  cout << ac << " " << wa << endl;
  return 0;
}


Compiler output:
a.cc:1:3: error: 'vector' does not name a type
    1 |   vector<int> p(m);
      |   ^~~~~~
a.cc:2:3: error: 'vector' does not name a type
    2 |   vector<string> s(m);
      |   ^~~~~~
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 |   rep(i,m)cin >> p[i] >> s[i];
      |      ^
a.cc:4:6: error: expected constructor, destructor, or type conversion before '(' token
    4 |   rep(i,m){
      |      ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << ac << " " << wa << endl;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^