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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n >> m;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<bool> a(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<stdio.h>
  +++ |+#include <vector>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:13:10: error: expected primary-expression before 'bool'
   13 |   vector<bool> a(n);
      |          ^~~~
a.cc:14:14: error: 'a' was not declared in this scope
   14 |   rep(i,n+1) a[i]=false;
      |              ^
a.cc:21:5: error: 'string' was not declared in this scope
   21 |     string s;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<stdio.h>
  +++ |+#include <string>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:22:17: error: 's' was not declared in this scope
   22 |     cin >> p >> s;
      |                 ^
a.cc:24:19: error: 'a' was not declared in this scope
   24 |     if(s=="AC" && a[p]==false)
      |                   ^
a.cc:32:3: error: 'cout' was not declared in this scope
   32 |   cout << ac_sum << " " << wa_sum;
      |   ^~~~
a.cc:32:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
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;
  cin >> n >> m;
  int ac_sum = 0;
  int wa_sum = 0;
  
  vector<bool> A(n);
  rep(i,n+1) A[i]=false;
  int w[n];
  rep(i,n) w[n]=0;
  
  rep(i,m)
  {
    int p;
    string s;
    cin >> p >> s;
    
    if(s=="AC" && a[p]==false)
    {
      a[p]=true;
      ac_sum++;
      wa_sum+=w[p];
    }
    else if(s=="WA" && a[p]) w[p]++;
  }
  cout << ac_sum << " " << wa_sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'a' was not declared in this scope
   24 |     if(s=="AC" && a[p]==false)
      |                   ^
Language: C++

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

int main()
{
  int n,m;
  cin >> n >> m;
  int ac_sum = 0;
  int wa_sum = 0;
  
  vector<bool> A(n);
  rep(i,n+1) A[i]=false;
  int w[n];
  rep(i,n) w[i]=0;
  
  rep(i,m)
  {
    int p;
    string s;
    cin >> p >> s;
    
    if(s=="AC" && a[p]==false)
    {
      a[p]=true;
      ac_sum++;
      wa_sum+=w[p];
    }
    else if(s=="WA" && a[p]) w[p]++;
  }
  cout << ac_sum << " " << wa_sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n >> m;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<bool> A(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<stdio.h>
  +++ |+#include <vector>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:13:10: error: expected primary-expression before 'bool'
   13 |   vector<bool> A(n);
      |          ^~~~
a.cc:14:14: error: 'A' was not declared in this scope
   14 |   rep(i,n+1) A[i]=false;
      |              ^
a.cc:21:5: error: 'string' was not declared in this scope
   21 |     string s;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<stdio.h>
  +++ |+#include <string>
    2 | #define rep(i,n) for(int i=0;i<(n);i++)
a.cc:22:17: error: 's' was not declared in this scope
   22 |     cin >> p >> s;
      |                 ^
a.cc:24:19: error: 'a' was not declared in this scope
   24 |     if(s=="AC" && a[p]==false)
      |                   ^
a.cc:32:3: error: 'cout' was not declared in this scope
   32 |   cout << ac_sum << " " << wa_sum;
      |   ^~~~
a.cc:32:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

using namespace std;


int main() {
  int n,m;
  cin >> n >> m;
  int list[n] = {};
  int wa_list[n] = {};
  int count_AC=0;
  for(int i=0;i<m;i++){
      int p;
      string s;
      cin >> p >> s;
      if(list[p-1]==0){
          if(s=="WA") wa_list[p-1]++;
          else{
              count_AC++;
              list[p-1]=1;
          }
      }
  }
  int count_WA =0;
  for(int i=0;i<n;i++){
      if(list[i]==1){
          count_WA += wa_list[i];
      }
  }
  cout << count_AC << " " << count_WA << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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:12:7: error: 'string' was not declared in this scope
   12 |       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:13:19: error: 's' was not declared in this scope
   13 |       cin >> p >> s;
      |                   ^
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout << count_AC << " " << count_WA << endl;
      |   ^~~~
a.cc:28:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:42: error: 'endl' was not declared in this scope
   28 |   cout << count_AC << " " << count_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;
int a[100005],n,m,ans1,ans2;
string s;
int main(){
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		cin>>num>>s;
		if(a[num]!=0) continue;
		if(s[0]=='A') {ans2+=a[num],ans1++,a[num]=1;continue;}
		a[num]++;
	}
	cout<<ans1<<" "<<ans2;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |                 cin>>num>>s;
      |                      ^~~
      |                      enum
Language: C++

#include<bits/stdc++.h>                          
using namespace std;
int n,m,f[100005],a[100005],ans1,ans2;
string s;           
int main(){
    cin>>n>>m;
    if(n==0) {cout<<0<<" "<<0;return 0;}
    for(int i=1;i<=m;i++) 
	{
	    cin>>f[i]>>s;
	    if(s[0]=='A'&&a[f[i]]==0) ans1++,a[f[i]]=1;
	    if(s[0]=='W'&&a[f[i]]==0) ans2++,b[f[i]]=1;
	}
	cout<<ans1<<" "<<ans2;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:46: error: 'b' was not declared in this scope
   12 |             if(s[0]=='W'&&a[f[i]]==0) ans2++,b[f[i]]=1;
      |                                              ^
Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  inm n,m;
  cin>>n>>m;
  vector<int>ac(n),pena(n);
  rep(i,m){
    int p;
    string s;
    cin>>p>>s;
    --p;
    if(ac[p])continue;
    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];
    cout<<AC<<PENA<<endl;
  }
  
  
  
  
      
      
      
      
      


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'inm' was not declared in this scope; did you mean 'int'?
    7 |   inm n,m;
      |   ^~~
      |   int
a.cc:8:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   cin>>n>>m;
      |        ^
      |        yn
a.cc:8:11: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |   cin>>n>>m;
      |           ^
      |           tm
a.cc:27:4: error: expected '}' at end of input
   27 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  inm n,m;
  cin>>n>>m;
  vector<int>ac(n),pena(n);
  rep(i,m){
    int p;
    string s;
    cin>>p>>s;
    --p;
    if(ac[p])continue;
    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];
    cout<<AC<<PENA<<endl;
  
  
  
  
      
      
      
      
      


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'inm' was not declared in this scope; did you mean 'int'?
    7 |   inm n,m;
      |   ^~~
      |   int
a.cc:8:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   cin>>n>>m;
      |        ^
      |        yn
a.cc:8:11: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |   cin>>n>>m;
      |           ^
      |           tm
a.cc:22:3: error: expected primary-expression before '/' token
   22 |   /int AC=0, PENA=0;
      |   ^
a.cc:22:4: error: expected primary-expression before 'int'
   22 |   /int AC=0, PENA=0;
      |    ^~~
a.cc:24:5: error: 'AC' was not declared in this scope; did you mean 'ac'?
   24 |     AC+=ac[i];
      |     ^~
      |     ac
a.cc:25:15: error: 'PENA' was not declared in this scope
   25 |     if(ac[i]) PENA+=pena[i];
      |               ^~~~
a.cc:26:15: error: 'PENA' was not declared in this scope
   26 |     cout<<AC<<PENA<<endl;
      |               ^~~~
a.cc:26:26: error: expected '}' at end of input
   26 |     cout<<AC<<PENA<<endl;
      |                          ^
a.cc:23:11: note: to match this '{'
   23 |   rep(i,n){
      |           ^
a.cc:26:26: error: expected '}' at end of input
   26 |     cout<<AC<<PENA<<endl;
      |                          ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<iostream>
#include <bits/stdc++.h>
#include <string>
#include <algorithm>

using namespace std;
int main()
{
  int n,m ;
  cin >> n >> m ;
  int p[m];
  string s[m];
  for(int i=0;i<m;i++){
    cin >> p[i] >> s[i];
  }   
  int bsk[n] ;
  for(int i=0;i<n;i++){
    cin >> bsk[i] = 0;
  }   

  int wcnt = 0 ;
  int acnt = 0 ;

  for(int i=0;i<m;i++){
      if(bsk[p[i]]==1){
        continue;
      }else{
        if(s[i]=="AC"){
         bsk[p[i]] = 1 ;
         acnt++;
        }else{
         wcnt++;        
        }
      }
  }

    cout << acnt << " " << wcnt << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: no match for 'operator=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
   18 |     cin >> bsk[i] = 0;
      |                     ^
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:718:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator=(std::basic_istream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  718 |       operator=(basic_istream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/istream:718:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_istream<char>&&'
  718 |       operator=(basic_istream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<list>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main() {
  int n,m;
  cin >> n >> m;
  vector<bool> check(n,false);
  int ac = 0;
  int wa = 0;
  for(int i=0;i<m;i++){
    int p;
    string s;
    cin >> p >> s;
    if(check[p]) continue;
    if(s == "AC"){
      check[p] += 1;
      ac += 1;
    }else if(s == "WA"){
      wa += 1;
    }
  }
 
  cout << ac << " " << wa << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: no match for 'operator+=' (operand types are 'std::vector<bool>::reference' and 'int')
   22 |       check[p] += 1;
      |       ~~~~~~~~~^~~~
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<list>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main() {
  int n,m;
  cin >> n >> m;
  vector<int> check(n,0);
  int ac = 0;
  int wa = 0;
  for(int i=0;i<m;i++){
    int p;
    string s;
    cin >> p >> s;
    if(s == "AC" && check[p] == 0){
      check[p] += 1;
      ac += 1;
    }else if(s == "WA" && check[p] == 0){
      wa += 1;
  }
 
  cout << ac << " " << wa << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  intf64_t N,M;
  cin >> N >> M;
  
  vector<double>p(M); 
  vector<string>S(M);
  for(int i=0; i<M; i++){
    cin >> p[i] >> S[i];
    if(S[i]=="WA") p[i]*=-1;
  }
  sort(p.begin(),p.end());
  
  int64_t count2 = 1;
  int64_t range=0;
  if(M==0) count2=0;
  for(int i=0; i<M-1; i++){
    range++;
   if(p[i]!=p[i+1]) count2++;
   if(p[i+1]>0){
     count2--;
     break;
   }
  }
  
  int64_t count = 1;
  if(M==0) count=0;
  for(int i=range; i<M-1; i++){
   if(p[i]!=p[i+1]) count++; 
  }
  
  cout << count << " " << count2 << endl;
  
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'intf64_t' was not declared in this scope; did you mean 'int64_t'?
    5 |   intf64_t N,M;
      |   ^~~~~~~~
      |   int64_t
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> M;
      |          ^
a.cc:6:15: error: 'M' was not declared in this scope
    6 |   cin >> N >> M;
      |               ^
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = new sc.nextInt();
    int m = sc.nextInt();
    int c = 0, pen = 0;
    int[] r = new int[n + 1];
    for(int i = 0; i < m; i++){
      int p = sc.nextInt();
      if(sc.next().equals("WA")){
        if(r[p] >= 0)r[p]++;
      }else{
        if(r[p] >= 0){
          pen += r[p];
          c++;
          r[p] = -1;
        }
      }
    }
    System.out.println(c+" "+pen);
  }
}

Compiler output:
Main.java:5: error: package sc does not exist
    int n = new sc.nextInt();
                  ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner();
    int n = new sc.nextInt();
    int m = sc.nextInt();
    int c = 0, pen = 0;
    int[] r = new int[n + 1];
    for(int i = 0; i < m; i++){
      int p = sc.nextInt();
      if(sc.next().equals("WA")){
        if(r[p] >= 0)r[p]++;
      }else{
        if(r[p] >= 0){
          pen += r[p];
          c++;
          r[p] = -1;
        }
      }
    }
    System.out.println(c+" "+pen);
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
Main.java:5: error: package sc does not exist
    int n = new sc.nextInt();
                  ^
2 errors
Language: C++

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

int main(){
  	int n, m;
  	cin >> n >> m;
  	vector<pair<int, int>> A(n + 5);
  
  	rep(i, m){
      	int p;
      	string s;
      	cin >> p >> s;
      	
      	if(s == "AC") A[p].second = 1;
      	if(A[p].second == 1) continue;  
      	A[p].first++;
    }
  
  	int ac = 0;
  	int wa = 0;
  	for(int i = 1, i <= n, i++){
    	wa += A[i].first;
      	ac += A[i].second;
    }
  
  	cout << ac << " " << wa << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: expected ';' before '<=' token
   22 |         for(int i = 1, i <= n, i++){
      |                         ^~~
      |                         ;
a.cc:22:26: error: expected primary-expression before '<=' token
   22 |         for(int i = 1, i <= n, i++){
      |                          ^~
a.cc:22:35: error: expected ';' before ')' token
   22 |         for(int i = 1, i <= n, i++){
      |                                   ^
      |                                   ;
Language: C++

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

#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define INF 0x3f3f3f3f
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef pair<int, int> pii;

int main(){
    fcin;

    int n, m;
    cin >> n >> m;

    vector<int> ac(n + 1, 0);
    vector<int> wa(n + 1, 0);
    for(int i = 0; i < m; i++){
        int id;
        string judge;
        cin >> id >> judge;

        if(judge == "AC") ac[id] = 1;
        if(!ac[id] and judge == "WA") wa[id]++;
    }

    int acc = 0;
    int wac = 0;

    for(int i = 1; i <= n; i++) acc += ac[i];
    for(int i = 1; i <= n; i++) if(ac[id]) wac += wa[i];

    cout << acc << " " << wac << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:39: error: 'id' was not declared in this scope; did you mean 'i'?
   38 |     for(int i = 1; i <= n; i++) if(ac[id]) wac += wa[i];
      |                                       ^~
      |                                       i
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 M =sc.nextInt();
    int P[]=new int[M];
    String Q[]=new String[M];
    int R[] =new int[N];
    int S[] =new int[N];
    int x=0;int y=0;i
    for(int i=0;i<M;i++){
      P[i]=sc.nextInt();
      Q[i]=sc.next();
      if(R[P[i]-1]==1){continue;}
      if(Q[i].equals("AC")){
        R[P[i]-1]=1;x=x+1;y=y+S[P[i]-1];}
      else{S[P[i]-1]=S[P[i]-1]+1;}}
    System.out.println (x+" "+y);
  }
}

Compiler output:
Main.java:11: error: not a statement
    int x=0;int y=0;i
                    ^
Main.java:11: error: ';' expected
    int x=0;int y=0;i
                     ^
2 errors
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> ac(n),pena(n);
  rep(i,m){
    int a;
    string b;
    cin >> a >> b;
    a--;
    if( ac[a] == 1 )continue;
    if( b == "AC") ac[a] = 1;
    else if( b == "WA") pena[a] ++;
  }
  int ok = 0, ng = 0;
  rep(i,n){
    ok += ac[i];
    if( ac[i] == 1 ) ng += pana[i];
  }
  cout << ok << " " << ng << endl;
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: 'pana' was not declared in this scope; did you mean 'pena'?
   23 |     if( ac[i] == 1 ) ng += pana[i];
      |                            ^~~~
      |                            pena
Language: C++

#include <iostream>
#include <string>
#include <cstring>

using namespace std;
int main() {
    int N,M,p,i;
    int wa = 0;
    cin >> N >> M;
    //int ac = (int*)malloc(N*sizeof(int));
    int* ac = new int[N]{0};
    string S;
    for(i=0;i<M;i++){
        cin >> p >> S;
        if(ac[p] == 0){
            if( !strcmp( S,"AC") ){
                ac[p] = 1;
            }else{
                wa++;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   16 |             if( !strcmp( S,"AC") ){
      |                          ^
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:3:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<bool,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

int main() {
    int n,m;
    cin >> n >> m;
    int co = 0;
    int pe = 0;
    vector<P> pro(n,{false,0});
    rep(i,m) {
        int p;
        string s;
        cin >> p >> s;
        p--;
        if(s == "AC") {
            if(!pro[p].first) {
                pro[p].first = true;
                co++;
                pe += pro[p].second
            }
        } else pro[p].second++;
    }
    cout << co << " " << pe << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:36: error: expected ';' before '}' token
   30 |                 pe += pro[p].second
      |                                    ^
      |                                    ;
   31 |             }
      |             ~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<bool,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

int main() {
    int n,m;
    cin >> n >> m;
    int co = 0;
    int pe = 0;
    vector<P> pro(n,{false,0});
    rep(i,m) {
        int p;
        string s;
        cin >> p >> s;
        p--;
        if(s == "AC") {
            if(!pro[p].fi) {
                pro[p].fi = true;
                co++;
                pe += pro[p].second
            }
        } else pro[p].second++;
    }
    cout << co << " " << pe << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<bool, int> >, std::pair<bool, int> >::value_type' {aka 'struct std::pair<bool, int>'} has no member named 'fi'
   27 |             if(!pro[p].fi) {
      |                        ^~
a.cc:28:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<bool, int> >, std::pair<bool, int> >::value_type' {aka 'struct std::pair<bool, int>'} has no member named 'fi'
   28 |                 pro[p].fi = true;
      |                        ^~
a.cc:30:36: error: expected ';' before '}' token
   30 |                 pe += pro[p].second
      |                                    ^
      |                                    ;
   31 |             }
      |             ~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  map<int,int>mp;
  int ans = 0;
  int pena = 0;
  rep(i,m){
    int a;
    string b;
    cin >> a;
    cin >> b;
    if( b == "AC" ){
      if( mp[a] == 1)continue;
      mp[a] ++;
    }
    else if( b == "WA") {
      if( mp[a] != 1) pena ++ ;
  }
  ans = mp.size();
  cout << ans << " " << pena << endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: Java

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

int main(){
	std::ios::sync_with_stdio(false);
	int N;
	int M;

	vector<int> hash {N,0};
	vector<int> w {N,0};
	cin >> N >> M;
	int correctAns = 0;
	int penalty = 0;
	for(int x= 0;x<M;x++){
		int pX;
		cin >> pX;
		string s;
		cin >> s;
		if(s=="WA"){
			w[pX]--;
		}
		if(s=="AC" && hash[pX]==0){
			correctAns++;
			hash[pX]++;
			if(w[pX]<0){
				penalty-=w[pX];
			}
		}
	}
	cout << correctAns << " "<<abs(penalty);
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include "bits/stdc++.h"
^
Main.java:1: error: class, interface, enum, or record expected
#include "bits/stdc++.h"
         ^
Main.java:3: error: illegal character: '#'
#define l long long;
^
Main.java:3: error: class, interface, enum, or record expected
#define l long long;
        ^
Main.java:6: error: not a statement
	std::ios::sync_with_stdio(false);
	^
Main.java:10: error: not a statement
	vector<int> hash {N,0};
	                  ^
Main.java:11: error: not a statement
	vector<int> w {N,0};
	               ^
Main.java:12: error: not a statement
	cin >> N >> M;
	         ^
Main.java:17: error: not a statement
		cin >> pX;
		    ^
Main.java:19: error: not a statement
		cin >> s;
		    ^
Main.java:31: error: not a statement
	cout << correctAns << " "<<abs(penalty);
	                         ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ';' expected
	std::ios::sync_with_stdio(false);
	                         ^
Main.java:10: error: ';' expected
	vector<int> hash {N,0};
	                ^
Main.java:10: error: ';' expected
	vector<int> hash {N,0};
	                   ^
Main.java:11: error: ';' expected
	vector<int> w {N,0};
	             ^
Main.java:11: error: ';' expected
	vector<int> w {N,0};
	                ^
17 errors
Language: C++

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

int problem[100010];
bool p[100010];

void solve(){

  int n,m;
  cin >> n >> m;

  rep(i,n){
      problem[i]=0;
      p[i]=false;
  }

  rep(i,m){
      int p;
      cin >> p;
      string st;
      cin >> st;
      if(!p[i]){
          if(st=="WA"){
              problem[i]++;
          }
          else{
              p[i]=true;
          }
      }
  }

  int ans1=0;
  int ans2=0;

  rep(i,n){
      ans1 += p[i];
      ans2 += problem[i];
  }

  cout << ans1 << " " << ans2 << endl;

}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:12: error: invalid types 'int[ll {aka long long int}]' for array subscript
   27 |       if(!p[i]){
      |            ^
a.cc:32:16: error: invalid types 'int[ll {aka long long int}]' for array subscript
   32 |               p[i]=true;
      |                ^
Language: C++

def solve():

    N,M=map(int,input().split()) #N個の問題,M回の提出
    A_list=[]#正解問題番号を入れる
    W_list=[0]*N
    WA=0
    PS=[list(map(str,input().split())) for i in range(M) ]
    ans=0
    pena=0
    for x in range(M):
        #if PS[x][0] not in A_list:
            if PS[x][0] in A_list:
                continue
            if PS[x][1]=='AC':
                A_list.append(PS[x][0])
                ans+=1
                WA+=W_list[int(PS[x][0])-1]
            else:
                #pena+=1
                W_list[int(PS[x][0])-1]+=1
    
    #print(ans,pena)
    print(ans,WA)
solve()


Compiler output:
a.cc:3:34: error: stray '#' in program
    3 |     N,M=map(int,input().split()) #N個の問題,M回の提出
      |                                  ^
a.cc:4:14: error: stray '#' in program
    4 |     A_list=[]#正解問題番号を入れる
      |              ^
a.cc:11:15: error: token "[" is not valid in preprocessor expressions
   11 |         #if PS[x][0] not in A_list:
      |               ^
a.cc:11: error: unterminated #if
   11 |         #if PS[x][0] not in A_list:
a.cc:1:1: error: 'def' does not name a type
    1 | def solve():
      | ^~~
Language: C++

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


int main() {
   int n, m, penalty = 0, correct = 0;
   string k;
   cin >> n >> m;
   vector<bool> v(n, false);


   for (int i = 0, p; i < m; i++){
   		cin >> p >> k;

   		if (k == "WA" && checks[p-1] == false){
   			penalty++;
   		}

   		else if(k == "AC" && checks[p-1] == false){
   			correct++;
   			checks[p-1] = true;
   		}
   }

   cout << correct << " " << penalty;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: 'checks' was not declared in this scope
   17 |                 if (k == "WA" && checks[p-1] == false){
      |                                  ^~~~~~
Language: C++

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

int main(){
    int N,M;
    cin >> N >> M;
    map<int/*問題番号*/,int/*間違い数*/> problems,pre;
    bool flag[N];//正解したかしてないか

    for (int i = 0; i < N; i++){
        flag[i]=false;//正解してたらtrue
    }

    int AC_sum=0,WA_sum=0,tmp_sum=0;

    for (int i = 0; i < M; i++){
        int num;
        string tmp;
        cin >> num >> tmp;

        if(flag[num-1]=false&&tmp=="AC"){
            AC_sum++;
            problems[num]=pre[num];
            flag[num-1]=true;
        }
        else if(tmp=="WA"&&flag[num-1]=false){
            pre[num]++;
        }

        
    }

    for (int i = 1; i <= N; i++){
        WA_sum+=problems[i];
    }
    
    



    cout << AC_sum << ' ' << WA_sum;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: lvalue required as left operand of assignment
   31 |         else if(tmp=="WA"&&flag[num-1]=false){
      |                 ~~~~~~~~~^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>

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

int main() {
	int n, m; cin >> n >> m;
    
    vector<int> a(n),p(n);
    rep(i,m){
        int sub;
        string s;
        cin>>sub>>s;
        
        if(a[sub]) continue;

        if(s="AC"){
            a[sub]=1;
        }else{
            p[sub]++;
        }
    }
    int ans=0;
    int pe=0;
    rep(i,n){
        ans+=a[i];
        if(a[i]){
            pe+=p[i];
        }
    }

    printf("%d %d\n",ans,pe);
 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"AC"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   24 |         if(s="AC"){
      |            ~^~~~~
      |             |
      |             std::__cxx11::basic_string<char>
Language: C++

クリ戊＝何やってるぼ

Compiler output:
a.cc:1:1: error: '\U000030af\U000030ea\U0000620a\U0000ff1d\U00004f55\U00003084\U00003063\U00003066\U0000308b\U0000307c' does not name a type
    1 | クリ戊＝何やってるぼ
      | ^~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

int N, M;
int ac[100010];
int wa[100010];


signed main()
{
    int solved = 0, penalty = 0;

    cin >> N >> M;

    rep(i, M) {
        int p; 
        string s;
        cin >> p >> s;

        p--;
        if (s == "AC") {
            ac[p]++;
        } else { // "WA"
            wa[p]++;
        }
    }

    int solved = 0, penalty = 0;

    rep(i, N) {
        if (ac[i] >= 1) {
            solved++;
            penalty += wa[i];
        }
    }

    printf("%d %d\n", solved, penalty);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:9: error: redeclaration of 'int solved'
   58 |     int solved = 0, penalty = 0;
      |         ^~~~~~
a.cc:41:9: note: 'int solved' previously declared here
   41 |     int solved = 0, penalty = 0;
      |         ^~~~~~
a.cc:58:21: error: redeclaration of 'int penalty'
   58 |     int solved = 0, penalty = 0;
      |                     ^~~~~~~
a.cc:41:21: note: 'int penalty' previously declared here
   41 |     int solved = 0, penalty = 0;
      |                     ^~~~~~~
Language: C++

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

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

int N, M;
bool is_solved[100010];

signed main()
{
    int solved = 0, penalty = 0;

    cin >> N >> M;

    rep(i, M) {
        int p; 
        string s;
        cin >> p >> s;

        p--;
        if (s == "AC") {
            if (not is_solved[p]) {
                is_solved[p] = true;
                solved++:
            }
        } else { // "WA"
            if (not is_solved[p]) {
                penalty++;
            }
        }
    }

    printf("%d %d\n", solved, penalty);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:25: error: expected ';' before ':' token
   52 |                 solved++:
      |                         ^
      |                         ;
Language: C++

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

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

int N, M;
bool is_solved[100010];

signed main()
{
    int solved = 0, penalty = 0;

    cin >> N >> M;

    rep(i, M) {
        int p; 
        string s;
        cin >> p >> s;

        p--;
        switch (s) {
            case "AC":
                if (not is_solved[p]) {
                    is_solved[p] = true;
                    solved++:
                }

                break;
            case "WA":
                if (not is_solved[p]) {
                    penalty++;
                }

                break;
        }
    }

    printf("%d %d\n", solved, penalty);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:17: error: switch quantity not an integer
   49 |         switch (s) {
      |                 ^
a.cc:53:29: error: expected ';' before ':' token
   53 |                     solved++:
      |                             ^
      |                             ;
Language: C

#include<stdio.h>

int main(void){
	int n,m,pcnt=0,ccnt=0,t=0,tem=0;
	scanf("%d%d",&n,&m);
	int p[m];
	char s[m][3];
	int a[m];
	for(int i=0;i<m;i++){
		scanf("%d %s",&p[i],&s[i]);
	}


	for(int i=0;i<m;i++){
		if(s[i][0]=='A'){
			for(int k=0;k<=t;k++){
				if(a[k]==p[i]){
					tem=1;
					brak;
				}
			}
			if(tem!=1){
				ccnt++;
				a[t]=p[i];
				t++;
				if(t==n){
					break;
				}
			}
			tem=0;

		}else{
			for(int k=0;k<=t;k++){
				if(a[k]==p[i]){
					tem=1;
					break;
			  }
			}
			if(tem!=1){
				pcnt++;
			}
			tem=0;
		}

	}
	printf("%d %d",ccnt,pcnt);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:41: error: 'brak' undeclared (first use in this function)
   19 |                                         brak;
      |                                         ^~~~
main.c:19:41: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#define fastio(); ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"

using namespace std; 


int main() 
{
	fileio();
	fastio();
	int N,M,n,correct=0,wrong=0;
	string s;
	bool arr[100050]={0};
	cin >> N >> M;
	while(M--){
		cin >> n >> s;
		if(s=="AC"){
			if(!arr[n])
				{arr[n]=true;correct++;}
		}
		else if(arr[n] == false)
			wrong++;
	}
	cout << correct << ' ' << wrong;
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'fileio' was not declared in this scope; did you mean 'fileno'?
   10 |         fileio();
      |         ^~~~~~
      |         fileno
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M,p,a=0,w=0;string J;cin>>N>>M;
  vector<bool>x(N,false);
  vector<int>WA(N,0);
  for(int i=0;i<M;i++){
    cin>>p>>J[i];
    if(J=="AC"){
      if(!x.at(p-1)){a++;x.at(p-1)=true;w+=WA.(p-1);}
    }
    else if(!x.at(p-1))WA.at(p-1)++;
  }
  cout<<a<<" "<<w<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:47: error: expected unqualified-id before '(' token
   10 |       if(!x.at(p-1)){a++;x.at(p-1)=true;w+=WA.(p-1);}
      |                                               ^
Language: C

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

int main() {
	int N, M,i=0;
	bool t = false;
	scanf("%d%d", &N, &M);
	int p[100];
	char S[100][3];
	for (int i = 0; i <= M - 1; i++) {
		scanf("%d%s", &p[i], S[i]);
	}
	int E = 0, C = 0;
	for (int j = 0; j < M; j++) {
		if (i != p[j]) {
			i = p[j];
			t = false;
		}
		if (p[j]==i&&t==false) {
			if (strcmp(S[j],"WA")==0) {
				E++;
			}
			else{
				C++;
				t = true;
			}
		}
	}
	printf("%d %d",C,E);
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: unknown type name 'bool'
    6 |         bool t = false;
      |         ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:6:18: error: 'false' undeclared (first use in this function)
    6 |         bool t = false;
      |                  ^~~~~
main.c:6:18: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:6:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:37: error: 'true' undeclared (first use in this function)
   25 |                                 t = true;
      |                                     ^~~~
main.c:25:37: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <bits/stdc++.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), pena(n);
  rep(i, m) {
    int p;
    string s;
    cin >> p >> s;
    if(ac.at(p)) continue;
    if {
      if(s == "WA") pena.at(p)++;
      else ac.at(p) = 1;
    }
  }
  int AC = 0;
  int PENA = 0;
  rep(i, n) {
    AC += ac.at(i);
    if(ac.at(i)) PENA += pena.at(i);
  }
  cout << AC << " " << PENA << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected '(' before '{' token
   14 |     if {
      |        ^
      |        (
Language: C++

int N, M, sub, ans = 0, pen = 0;
    string feed;
    cin >> N >> M;
    vector<int>Visited(N+1);
    for (int j = 0; j < M; j++)
    {
        cin >> sub;
        cin >> feed;
        if (feed == "AC" && Visited[sub] == 0) { Visited[sub] = 1; ans += 1; pen += j-1; }
    }
    if(pen<=0) { cout << ans << 0 << endl; }
    else { cout << ans<<" "<< pen << endl; }
    return 0;
}

Compiler output:
a.cc:2:5: error: 'string' does not name a type
    2 |     string feed;
      |     ^~~~~~
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin >> N >> M;
      |     ^~~
a.cc:4:5: error: 'vector' does not name a type
    4 |     vector<int>Visited(N+1);
      |     ^~~~~~
a.cc:5:5: error: expected unqualified-id before 'for'
    5 |     for (int j = 0; j < M; j++)
      |     ^~~
a.cc:5:21: error: 'j' does not name a type
    5 |     for (int j = 0; j < M; j++)
      |                     ^
a.cc:5:28: error: 'j' does not name a type
    5 |     for (int j = 0; j < M; j++)
      |                            ^
a.cc:11:5: error: expected unqualified-id before 'if'
   11 |     if(pen<=0) { cout << ans << 0 << endl; }
      |     ^~
a.cc:12:5: error: expected unqualified-id before 'else'
   12 |     else { cout << ans<<" "<< pen << endl; }
      |     ^~~~
a.cc:13:5: error: expected unqualified-id before 'return'
   13 |     return 0;
      |     ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N,M;
  cin >> N >> M;
  
  vector<int>check(N,0);
  vector<int>check_w(N,0);
  int ac = 0;
  int wa = 0;
  
  for(int i=0;i<M;i++){
    int p;
    string s;
    
    cin >> p;
    cin >> s;
    
    if(s == "AC") check[p-1]++;
    else if(check[p-1] == 0) check_w[p-1]++;
  }
  
  for(int i=0;i<N;i++){
    if(check[i] != 0){
      ac++;
      wa += check_w[p-1];
    }
  }
  
  cout << ac << " " << wa << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: 'p' was not declared in this scope
   27 |       wa += check_w[p-1];
      |                     ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N,M;
  cin >> N >> M;
  
  vector<int>check(N,0);
  vector<int>check_w(N,0);
  int ac = 0;
  int wa = 0;
  
  for(int i=0;i<M;i++){
    int p;
    string s;
    
    cin >> p;
    cin >> s;
    
    if(s == "AC") check[p-1]++;
    else if(check[p-1] == 0) check_w[p-1]++;
    }
  }
  
  for(int i=0;i<N;i++){
    if(check[i] != 0){
      ac++;
      wa += check_w[p-1];
    }
  }
  
  cout << ac << " " << wa << endl;
  
  return 0;
}



Compiler output:
a.cc:25:3: error: expected unqualified-id before 'for'
   25 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:25:15: error: 'i' does not name a type
   25 |   for(int i=0;i<N;i++){
      |               ^
a.cc:25:19: error: 'i' does not name a type
   25 |   for(int i=0;i<N;i++){
      |                   ^
a.cc:32:3: error: 'cout' does not name a type
   32 |   cout << ac << " " << wa << endl;
      |   ^~~~
a.cc:34:3: error: expected unqualified-id before 'return'
   34 |   return 0;
      |   ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^