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

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac(N),pena(N);
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    --num;
    if(ac[num]) continue;
    if(str=="AC"){
      ac[num] =1;
    }else {
      pena[num]++;
    }
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  priitf("%d" "%d/n" ,AC,PENA);
  return 0;
}
  
    
  
  
  
  
  


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　vector<int> ac(N),pena(N);
      | ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000vector' was not declared in this scope
    8 | 　vector<int> ac(N),pena(N);
      | ^~~~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 | 　vector<int> ac(N),pena(N);
      |          ^~~
a.cc:14:8: error: 'ac' was not declared in this scope
   14 |     if(ac[num]) continue;
      |        ^~
a.cc:16:7: error: 'ac' was not declared in this scope
   16 |       ac[num] =1;
      |       ^~
a.cc:18:7: error: 'pena' was not declared in this scope
   18 |       pena[num]++;
      |       ^~~~
a.cc:23:9: error: 'ac' was not declared in this scope; did you mean 'AC'?
   23 |     AC+=ac[i];
      |         ^~
      |         AC
a.cc:24:21: error: 'pena' was not declared in this scope
   24 |     if(ac[i]) PENA+=pena[i];
      |                     ^~~~
a.cc:26:3: error: 'priitf' was not declared in this scope; did you mean 'printf'?
   26 |   priitf("%d" "%d/n" ,AC,PENA);
      |   ^~~~~~
      |   printf
Language: C++

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac(N),pena(N);
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    num--;
    if(ac[num]) continue;
    if(str=="AC"){
      ac[num] =1;
    }else {
      pena[num]++;
    }
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  priitf("%d" "%d/n" ,AC,PENA);
  return 0;
}
  
    
  
  
  
  
  


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　vector<int> ac(N),pena(N);
      | ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000vector' was not declared in this scope
    8 | 　vector<int> ac(N),pena(N);
      | ^~~~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 | 　vector<int> ac(N),pena(N);
      |          ^~~
a.cc:14:8: error: 'ac' was not declared in this scope
   14 |     if(ac[num]) continue;
      |        ^~
a.cc:16:7: error: 'ac' was not declared in this scope
   16 |       ac[num] =1;
      |       ^~
a.cc:18:7: error: 'pena' was not declared in this scope
   18 |       pena[num]++;
      |       ^~~~
a.cc:23:9: error: 'ac' was not declared in this scope; did you mean 'AC'?
   23 |     AC+=ac[i];
      |         ^~
      |         AC
a.cc:24:21: error: 'pena' was not declared in this scope
   24 |     if(ac[i]) PENA+=pena[i];
      |                     ^~~~
a.cc:26:3: error: 'priitf' was not declared in this scope; did you mean 'printf'?
   26 |   priitf("%d" "%d/n" ,AC,PENA);
      |   ^~~~~~
      |   printf
Language: C++

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac[N],pena[N];
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    num--;
    if(ac[num]) continue;
    if(str=="AC"){
      ac[num] =1;
    }
    else {
      pena[num]++;
    }
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  priitf("%d" "%d/n" ,AC,PENA);
  return 0;
}
  
    
  
  
  
  
  


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　vector<int> ac[N],pena[N];
      | ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000vector' was not declared in this scope
    8 | 　vector<int> ac[N],pena[N];
      | ^~~~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 | 　vector<int> ac[N],pena[N];
      |          ^~~
a.cc:14:8: error: 'ac' was not declared in this scope
   14 |     if(ac[num]) continue;
      |        ^~
a.cc:16:7: error: 'ac' was not declared in this scope
   16 |       ac[num] =1;
      |       ^~
a.cc:19:7: error: 'pena' was not declared in this scope
   19 |       pena[num]++;
      |       ^~~~
a.cc:24:9: error: 'ac' was not declared in this scope; did you mean 'AC'?
   24 |     AC+=ac[i];
      |         ^~
      |         AC
a.cc:25:21: error: 'pena' was not declared in this scope
   25 |     if(ac[i]) PENA+=pena[i];
      |                     ^~~~
a.cc:27:3: error: 'priitf' was not declared in this scope; did you mean 'printf'?
   27 |   priitf("%d" "%d/n" ,AC,PENA);
      |   ^~~~~~
      |   printf
Language: C++

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac[N],pena[N];
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    num--;
    if(ac[num]) continue;
    if(str=="AC"){
      ac[num] =1;
    }
    else pena[num]++;
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  cout<<AC<<PENA<<endl;
}
  
    
  
  
  
  
  


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　vector<int> ac[N],pena[N];
      | ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000vector' was not declared in this scope
    8 | 　vector<int> ac[N],pena[N];
      | ^~~~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 | 　vector<int> ac[N],pena[N];
      |          ^~~
a.cc:14:8: error: 'ac' was not declared in this scope
   14 |     if(ac[num]) continue;
      |        ^~
a.cc:16:7: error: 'ac' was not declared in this scope
   16 |       ac[num] =1;
      |       ^~
a.cc:18:10: error: 'pena' was not declared in this scope
   18 |     else pena[num]++;
      |          ^~~~
a.cc:22:9: error: 'ac' was not declared in this scope; did you mean 'AC'?
   22 |     AC+=ac[i];
      |         ^~
      |         AC
a.cc:23:21: error: 'pena' was not declared in this scope
   23 |     if(ac[i]) PENA+=pena[i];
      |                     ^~~~
Language: C++

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac[N],pena[N];
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    num--;
    if(ac[num]) continue;
    if(str=="AC"){
      ac[num] =1;
    }
    else pena[num]++;
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  cout<<AC<<PENA<<endl;
}
  
    
  
  
  for(int i=0;i<M;i++){
    cin>>score.at("AC")
    
  
  
  
  
  


Compiler output:
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　vector<int> ac[N],pena[N];
      | ^
a.cc: In function 'int main()':
a.cc:10:1: error: '\U00003000vector' was not declared in this scope
   10 | 　vector<int> ac[N],pena[N];
      | ^~~~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 | 　vector<int> ac[N],pena[N];
      |          ^~~
a.cc:16:8: error: 'ac' was not declared in this scope
   16 |     if(ac[num]) continue;
      |        ^~
a.cc:18:7: error: 'ac' was not declared in this scope
   18 |       ac[num] =1;
      |       ^~
a.cc:20:10: error: 'pena' was not declared in this scope
   20 |     else pena[num]++;
      |          ^~~~
a.cc:24:9: error: 'ac' was not declared in this scope; did you mean 'AC'?
   24 |     AC+=ac[i];
      |         ^~
      |         AC
a.cc:25:21: error: 'pena' was not declared in this scope
   25 |     if(ac[i]) PENA+=pena[i];
      |                     ^~~~
a.cc: At global scope:
a.cc:33:3: error: expected unqualified-id before 'for'
   33 |   for(int i=0;i<M;i++){
      |   ^~~
a.cc:33:15: error: 'i' does not name a type
   33 |   for(int i=0;i<M;i++){
      |               ^
a.cc:33:19: error: 'i' does not name a type
   33 |   for(int i=0;i<M;i++){
      |                   ^
Language: C++

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


int main(){
  int N,M;
  cin>>N>>M;
　vector<int> ac[N],pena[N];
  for(int i=0;i<M;i++){
    int num;
    string str;
    cin>>num>>str;
    num--;
    if(ac[num]) continue;
    if(str=='AC'){
      ac[num] =1;
    }
    else pena[num]++;
  }
  int AC=0,PENA=0;
  for(int i=0;i<N;i++){
    AC+=ac[i];
    if(ac[i]) PENA+=pena[i];
  }
  cout<<AC<<PENA<<endl;
}
  
    
  
  
  for(int i=0;i<M;i++){
    cin>>score.at("AC")
    
  
  
  
  
  


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

#include <bits/stdc++.h>

typedef long long ll;
const int INF = 1e9;

using namespace std; 

#define REP(inc, bgn, end) for (int inc = bgn; inc < end; inc++)

int main() {
    int n, m, wa[100100], p, ac_count = 0, wa_count = 0;
    bool ac[100100];
    string s;

    cin >> n >> m;

    REP(i, o, n) {
        wa[i] = 0;
        ac[i] = false
    }

    REP(i, 0, m) {
        cin >> p >> s;
        p--;
        if (ac[p]) continue;
        else if (s == "AC") {
            ac_count++;
            wa_count += wa[p];
            ac[p] = true;
        }
        else {
            wa[p]++;
        }
    }

    cout << ac_count << ' ' << wa_count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'o' was not declared in this scope
   17 |     REP(i, o, n) {
      |            ^
a.cc:8:43: note: in definition of macro 'REP'
    8 | #define REP(inc, bgn, end) for (int inc = bgn; inc < end; inc++)
      |                                           ^~~
a.cc:19:22: error: expected ';' before '}' token
   19 |         ac[i] = false
      |                      ^
      |                      ;
   20 |     }
      |     ~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> ac(n)/*既にACしたかどうか*/,pena(n);
  for (int i=0;i<m;++i){
      int p;
      string s;
      cin >> p >> s;
      --p;
      if (ac[p]) continue;//これが肝(ACが既に出てたらそれより先は無視。0ならflase,1ならtrueって感じ。)
      if (s=="AC") {
        ac[p]=1;  
      }
      else {
        pena[p]++;
      }
  }
  int AC=0,PENA=0;
  for (int i=0;i<n;++i){
          AC+=ac[i];
          if (ac[i]) PENA+=pena[i];
      }
      cout << AC << PENA << endl;
  }
}

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

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> p(m);
  vector<string> s(m);
  for (int i=0;i<m;++i) cin >> p[i] >> s[i];
  
  for (int i=0;i<m;++i){
    int ans=0;
    int pen=0;
    if (s[i]=="AC"){
      pen++;
      break;
    }
    ans++;
  }
  cout << ans << pen << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   cout << ans << pen << endl;
      |           ^~~
      |           abs
a.cc:20:18: error: 'pen' was not declared in this scope
   20 |   cout << ans << pen << endl;
      |                  ^~~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> p(m),s(m);
  for (int i=0;i<m;++i) cin >> p[i] >> s[i];
  
  for (int i=0;i<m;++i){
    int ans=0;
    int pen=0;
    if (s[i]=="AC"){
      pen++;
      break;
    }
    ans++;
  }
  cout << ans << pen << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (s[i]=="AC"){
a.cc:19:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   cout << ans << pen << endl;
      |           ^~~
      |           abs
a.cc:19:18: error: 'pen' was not declared in this scope
   19 |   cout << ans << pen << endl;
      |                  ^~~
Language: C++

int main() {
int N,M;
cin>>N>>M;
vector<int>AC(N);
vector<int>WA(N);
int countAC=0;
int countWA=0;
for(int i=0; i<M; i++){
int p;
char S;
cin>>p>>S;
if(S='AC'){
if(AC.at(i)==0){
countAC++;
AC.at(i)=1;
}
}
else{
if(WA.at(i)==0){
countWA++;
WA.at(i)=1;
}
}
}
cout<<countAC<<""<<countWA<<endl;
}

Compiler output:
a.cc:12:6: warning: multi-character character constant [-Wmultichar]
   12 | if(S='AC'){
      |      ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
    3 | cin>>N>>M;
      | ^~~
a.cc:4:1: error: 'vector' was not declared in this scope
    4 | vector<int>AC(N);
      | ^~~~~~
a.cc:4:8: error: expected primary-expression before 'int'
    4 | vector<int>AC(N);
      |        ^~~
a.cc:5:8: error: expected primary-expression before 'int'
    5 | vector<int>WA(N);
      |        ^~~
a.cc:12:6: warning: overflow in conversion from 'int' to 'char' changes value from '16707' to '67' [-Woverflow]
   12 | if(S='AC'){
      |      ^~~~
a.cc:13:4: error: 'AC' was not declared in this scope
   13 | if(AC.at(i)==0){
      |    ^~
a.cc:19:4: error: 'WA' was not declared in this scope
   19 | if(WA.at(i)==0){
      |    ^~
a.cc:25:1: error: 'cout' was not declared in this scope
   25 | cout<<countAC<<""<<countWA<<endl;
      | ^~~~
a.cc:25:29: error: 'endl' was not declared in this scope
   25 | cout<<countAC<<""<<countWA<<endl;
      |                             ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<pair<int string>>P(M);
  for(int i=0;i<M;i++){
    cin>>P.at(i).first>>P.at(i).second;
  }
  vector<int>AC(N,0);
  vector<int>WA(N,0);
  for(int i=0;i<M;i++){
    if(AC.at(P.at(i).first-1)==1){
    }
    else{
      if(P.at(i).second=="AC"){
        AC.at(P.at(i).first-1)=1;
      }
      else{
        WA.at(P.at(i).first-1)=WA.at(P.at(i).first-1)+1;
      }
    }
  }
  int sumWA=0;
  int sumAC=0;
  for(int i=0;i<N;i++){
    if(AC.at(i)==1){
      sumAC=sumAC+1;
      sumWA=sumWA+WA.at(i);
    }
  }
  cout<<sumAC<<" "<<sumWA<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: two or more data types in declaration of 'type name'
    6 |   vector<pair<int string>>P(M);
      |               ^~~
a.cc:6:19: error: wrong number of template arguments (1, should be 2)
    6 |   vector<pair<int string>>P(M);
      |                   ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:6:25: error: template argument 1 is invalid
    6 |   vector<pair<int string>>P(M);
      |                         ^~
a.cc:6:25: error: template argument 2 is invalid
a.cc:8:12: error: request for member 'at' in 'P', which is of non-class type 'int'
    8 |     cin>>P.at(i).first>>P.at(i).second;
      |            ^~
a.cc:8:27: error: request for member 'at' in 'P', which is of non-class type 'int'
    8 |     cin>>P.at(i).first>>P.at(i).second;
      |                           ^~
a.cc:13:16: error: request for member 'at' in 'P', which is of non-class type 'int'
   13 |     if(AC.at(P.at(i).first-1)==1){
      |                ^~
a.cc:16:12: error: request for member 'at' in 'P', which is of non-class type 'int'
   16 |       if(P.at(i).second=="AC"){
      |            ^~
a.cc:17:17: error: request for member 'at' in 'P', which is of non-class type 'int'
   17 |         AC.at(P.at(i).first-1)=1;
      |                 ^~
a.cc:20:17: error: request for member 'at' in 'P', which is of non-class type 'int'
   20 |         WA.at(P.at(i).first-1)=WA.at(P.at(i).first-1)+1;
      |                 ^~
a.cc:20:40: error: request for member 'at' in 'P', which is of non-class type 'int'
   20 |         WA.at(P.at(i).first-1)=WA.at(P.at(i).first-1)+1;
      |                                        ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
using ll = long long;

int main(){
    int n,m;
    cin >> n >> m;
    map<int,int> cor;
    vector<int> p(m);
    vector<string> s(m);
    for (int i=0;i<m;i++){
        cin >> p.at(i) >> s.at(i);
    }
    int nc=0;
    int wc=0;
    for (int i=0;i<m;i++){
        if(s.at(i)=="AC"&&cor[p.at(i)]!=1) {
            cor[p.at(i)]=1;
            nc++;
        }
        if(s.at(i)=="WA"&&cor[p.at(i)]!=1&&"WA"!=1)
            wc++;
    }
    
    cout << nc << " " << wc << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |         if(s.at(i)=="WA"&&cor[p.at(i)]!=1&&"WA"!=1)
      |                                            ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<pair<int,string>>P(M);
  for(int i=0;i<M;i++){
    cin>>P.at(i).first>>P.at(i).second;
  }
  sort(P.begin(),P.end());
  int countAC=0;
  int countWA=0;
  int L=N+1;
  bool flag=false;
  for(int i=0;i<M;i++){
    if(P.at(i).first!=L){
      L=P.at(i).first;
      if(P.at(i).second=="AC"){
        flag=true;
        countAC=countAC+1;
      }
      else{
        flag=false;
      }
    }
    else{
      if(flag){
        if(P.at(i).second=="AC"){
        }
        else{
          countWA=countWA+1;
        }
      }
    }
  }
  
      
      
    
  

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

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

int main()
{
  long long n,m;
  cin>>n>>m;
  map<ll,ll>mx;
  string s;
  int x,pen=0;
  for(int i=0;i<m;i++)
  {
    	cin>>x>>s;
    	if(s=="AC")
    	mx[x]++;
    	else if(s=="WA"&&mx[x]==0)
          pen++;
  }
  
  
  cout<<mx.size()<<" "<<pen;}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'll' was not declared in this scope
    8 |   map<ll,ll>mx;
      |       ^~
a.cc:8:12: error: template argument 1 is invalid
    8 |   map<ll,ll>mx;
      |            ^
a.cc:8:12: error: template argument 3 is invalid
a.cc:8:12: error: template argument 4 is invalid
a.cc:15:11: error: invalid types 'int[int]' for array subscript
   15 |         mx[x]++;
      |           ^
a.cc:16:28: error: invalid types 'int[int]' for array subscript
   16 |         else if(s=="WA"&&mx[x]==0)
      |                            ^
a.cc:21:12: error: request for member 'size' in 'mx', which is of non-class type 'int'
   21 |   cout<<mx.size()<<" "<<pen;}
      |            ^~~~
Language: C++

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

int main()
{
  long long n,m;
  cin>>n>>m;
  map<ll,ll>mx;
  string s;
  int x,pen=0;
  for(int i=0;i<m;i++)
  {
    	cin>>x>>s;
    	if(s=="AC")
    	mx[x]++;
    	else if(s=="WA"&&mx[x]==0)
          pen++;
  }
  
  
  cout<<mx.size()<<" "<<pen;}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepspace'
    2 | using namepspace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'map' was not declared in this scope
    8 |   map<ll,ll>mx;
      |   ^~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:8:7: error: 'll' was not declared in this scope
    8 |   map<ll,ll>mx;
      |       ^~
a.cc:8:13: error: 'mx' was not declared in this scope; did you mean 'm'?
    8 |   map<ll,ll>mx;
      |             ^~
      |             m
a.cc:9:3: error: 'string' was not declared in this scope
    9 |   string s;
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:13:17: error: 's' was not declared in this scope
   13 |         cin>>x>>s;
      |                 ^
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout<<mx.size()<<" "<<pen;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main()
{
  ll n,m;
  cin>>n>>m;
  
 ll a[m+1]={0},pos=0,neg=0;
  for(ll i=0,x,y;i<n;i++)
  {
    cin>>x>>y;
    if(y=="WA"&&a[x]==0)neg++;
    else if(y=="AC"&&a[x]==0)pos++,a[x]=1;
      
    
  }
  
  cout<<pos<<" "<<neg;  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(y=="WA"&&a[x]==0)neg++;
      |        ~^~~~~~
a.cc:15:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     else if(y=="AC"&&a[x]==0)pos++,a[x]=1;
      |             ~^~~~~~
Language: C++

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

int main()
{
  ll n,m;
  cin>>n>>m;
  
 ll a[n]={0},pos=0,neg=0;
  for(ll i=0;i<n;i++)
  {
    cin>>x>>y;
    if(y=="WA"&&a[x]==0)neg++;
    else if(y=="AC"&&a[x]==0)pos++,a[x]=1;
      
    
  }
  
  cout<<pos<<" "<<neg;  
  
  
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  map<int,pair<bool,int>>R;
  for(int i=0;i<M;i++){
  int x; string s;
    if(s=="AC"){
    if(!R.count(x))
      R[x]=make_pair(true,0);
      else
        R[x]=make_pair(true,R.at(x).second);
    }else{
    if(!R.count(x))
      R[x]=make_pair(false,1);
      else{if(!R.at(x).first)
        R[x]=make_pair(false,1+R[x].second);}
    }
  }int ans=0;
   int ans1=0;
  for(auto p:R){
   auto k=p.first;
    auto v=p.second;
    if(v.first)
      ans++;
      ans1+=v.second;
  }cout<<ans<<" "<<ans1<<endl;
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: redeclaration of 'int ans'
   21 |   }int ans=0;
      |        ^~~
a.cc:6:7: note: 'int ans' previously declared here
    6 |   int ans=0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  map<int,pair<bool,int>>R;
  for(int i=0;i<M;i++){
  int x; string s;
    if(s=="AC"){
    if(!R.count(x))
      R[x]=make_pair(true,0);
      else
        R[x]=make_pair(true,R[x].second);
    }else{
    if(!R.count(x))
      R[x]=make_pair(false,1);
      else{if(!R.second.first)
        R[x]=make_pair(false,1+R[x].second);}
    }
  }int ans=0;
   int ans1=0;
  for(auto p:R){
   auto k=p.first;
    auto v=p.second;
    if(v.first)
      ans++;
      ans1+=v.second;
  }cout<<ans<<" "<<ans1<<endl;
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   18 |       else{if(!R.second.first)
      |                  ^~~~~~
a.cc:21:8: error: redeclaration of 'int ans'
   21 |   }int ans=0;
      |        ^~~
a.cc:6:7: note: 'int ans' previously declared here
    6 |   int ans=0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  map<int,pair<bool,int>>R;
  for(int i=0;i<M;i++){
  int x; string s;
    if(s=="AC"){
    if(!R.count(x))
      R[x]=make_pair(true,0);
      else
        R[x]=make_pair(true,R[x].second.second);
    }else{
    if(!R.count(x))
      R[x]=make_pair(false,1);
      else{if(!R.second.first)
        R[x]=make_pair(false,1+R[x].second.second);}
    }
  }int ans=0;
   int ans1=0;
  for(auto p:R){
   auto k=p.first;
    auto v=p.second;
    if(v.first)
      ans++;
      ans1+=v.second;
  }cout<<ans<<" "<<ans1<<endl;
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: request for member 'second' in 'R.std::map<int, std::pair<bool, int> >::operator[](x).std::pair<bool, int>::second', which is of non-class type 'int'
   14 |         R[x]=make_pair(true,R[x].second.second);
      |                                         ^~~~~~
a.cc:18:18: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   18 |       else{if(!R.second.first)
      |                  ^~~~~~
a.cc:19:44: error: request for member 'second' in 'R.std::map<int, std::pair<bool, int> >::operator[](x).std::pair<bool, int>::second', which is of non-class type 'int'
   19 |         R[x]=make_pair(false,1+R[x].second.second);}
      |                                            ^~~~~~
a.cc:21:8: error: redeclaration of 'int ans'
   21 |   }int ans=0;
      |        ^~~
a.cc:6:7: note: 'int ans' previously declared here
    6 |   int ans=0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  map<int,pair<bool,int>>R;
  for(int i=0;i<M;i++){
  int x; string s;
    if(s=="AC"){
    if(!R.count(x))
      R[x]=make_pair(true,0);
      else
        R[x]=make_pair(true,R[x].second.second);
    }else{
    if(!R.count(x))
      R[x]=make_pair(false,1);
      else{if(!R.second.first)
        R[x]=make_pair(false,1+R.second.second);}
    }
  }int ans=0;
   int ans1=0;
  for(auto p:R){
   auto k=p.first;
    auto v=p.second;
    if(v.first)
      ans++;
      ans1+=v.second;
  }cout<<ans<<" "<<ans1<<endl;
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: request for member 'second' in 'R.std::map<int, std::pair<bool, int> >::operator[](x).std::pair<bool, int>::second', which is of non-class type 'int'
   14 |         R[x]=make_pair(true,R[x].second.second);
      |                                         ^~~~~~
a.cc:18:18: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   18 |       else{if(!R.second.first)
      |                  ^~~~~~
a.cc:19:34: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   19 |         R[x]=make_pair(false,1+R.second.second);}
      |                                  ^~~~~~
a.cc:21:8: error: redeclaration of 'int ans'
   21 |   }int ans=0;
      |        ^~~
a.cc:6:7: note: 'int ans' previously declared here
    6 |   int ans=0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  map<int,pair<bool,int>>R;
  for(int i=0;i<M;i++){
  int x; string s;
    if(s=="AC"){
    if(!R.count(x))
      R[x]=make_pair(true,0);
      else
        R[x]=make_pair(true,R.second.second);
    }else{
    if(!R.count(x))
      R[x]=make_pair(false,1);
      else{if(!R.second.first)
        R[x]=make_pair(false,1+R.second.second);}
    }
  }int ans=0;
   int ans1=0;
  for(auto p:R){
   auto k=p.first;
    auto v=p.second;
    if(v.first)
      ans++;
      ans1+=v.second;
  }cout<<ans<<" "<<ans1<<endl;
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   14 |         R[x]=make_pair(true,R.second.second);
      |                               ^~~~~~
a.cc:18:18: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   18 |       else{if(!R.second.first)
      |                  ^~~~~~
a.cc:19:34: error: 'class std::map<int, std::pair<bool, int> >' has no member named 'second'
   19 |         R[x]=make_pair(false,1+R.second.second);}
      |                                  ^~~~~~
a.cc:21:8: error: redeclaration of 'int ans'
   21 |   }int ans=0;
      |        ^~~
a.cc:6:7: note: 'int ans' previously declared here
    6 |   int ans=0;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  set<int> S;
  for(int i=0;i<M;i++){
  int x; string s;
    cin>>x>>s
      if(s=="AC"){
      S.insert(x);
      }else{
      if(!S.count(x))
         ans++;}
      
  }int ans1=S.size();
  cout<<ans1<<" "<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before 'if'
   10 |     cin>>x>>s
      |              ^
      |              ;
   11 |       if(s=="AC"){
      |       ~~      
a.cc:13:8: error: 'else' without a previous 'if'
   13 |       }else{
      |        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  set<int> S;
  for(int i=0;i<M;i++){
  int x; string s;
    cin>>x>>s
      if(s=="AC"){
      S.insert(x);
      }else{
      if(!S.cout(x))
         ans++;}
      
  }int ans1=S.size();
  cout<<ans1<<" "<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before 'if'
   10 |     cin>>x>>s
      |              ^
      |              ;
   11 |       if(s=="AC"){
      |       ~~      
a.cc:13:8: error: 'else' without a previous 'if'
   13 |       }else{
      |        ^~~~
a.cc:14:13: error: 'class std::set<int>' has no member named 'cout'; did you mean 'count'?
   14 |       if(!S.cout(x))
      |             ^~~~
      |             count
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int ans=0;
  set<int> S;
  for(int i=0;i<M;i++){
  int x; string s;
    cin>>x>>s
      if(s=="AC"){
      S.insert(x);
      }else
      if(!S.cout(x))
         ans++;
      
  }int ans1=S.size();
  cout<<ans1<<" "<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before 'if'
   10 |     cin>>x>>s
      |              ^
      |              ;
   11 |       if(s=="AC"){
      |       ~~      
a.cc:13:8: error: 'else' without a previous 'if'
   13 |       }else
      |        ^~~~
a.cc:14:13: error: 'class std::set<int>' has no member named 'cout'; did you mean 'count'?
   14 |       if(!S.cout(x))
      |             ^~~~
      |             count
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <limits>
#include <map>

using namespace std;

int main(){
    long n,m,pi;
    long ok=0,ng=0;
    string judge;
    map<int,bool> sub;
    cin >> n >> m;
    for(int i=0;i<m; i++){
        cin >> pi;
        cin >> judge;
        if(sub[pi] =="AC") continue;

        if(judge == "AC"){
            sub[pi] = "AC";                                                                                      ok++;
        }else{
            ng++;
        }
    }
    cout << ok << " " << ng << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |         if(sub[pi] =="AC") continue;
Language: C++

N, K, M = map(int, input().split())
A = list(map(int, input().split()))

sumA = sum(A)

ans = N * M - sumA
if ans > K:
  print(-1)
elif ans < 0:
  print(0)
else:
  print(ans)

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

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,m;
    cin>>n>>m;
    vector<pair<ll,ll>> vp(n,make_pair(0,0));
    ll p;
    string s;
    rep(i,m){
        cin>>p>>s;
        if(vp[p-1].first==0&&s=="AC") vp[p-1].first++;
        if(vp[p-1].first==0&&s=="WA") vp[p-1].second++;
    }
    ll cr=0,icr==0;
    rep(i,n){
        cr+=vp[i].first;
        icr+=vp[i].second;
    }
    cout<<cr<<' '<<icr<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: expected initializer before '==' token
   20 |     ll cr=0,icr==0;
      |                ^~
a.cc:23:9: error: 'icr' was not declared in this scope; did you mean 'cr'?
   23 |         icr+=vp[i].second;
      |         ^~~
      |         cr
a.cc:25:20: error: 'icr' was not declared in this scope; did you mean 'cr'?
   25 |     cout<<cr<<' '<<icr<<endl;
      |                    ^~~
      |                    cr
Language: C++

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

int main(){
    int N,M; cin>>N>>M;
    vector<bool> CL(N+1,0);
    int AC=0;
    int WA=0;
    vector<int> WAarray(N+1,0);
    for(int i=0;i<M;i++){
        int num;cin>>num;
        string result;cin>>result;
        if(CL.at(num))continue;
        if(result=="AC"){
            count.at(0)++;
            AC++;
            WA+=WAarray.at(num);
            CL.at(num)=1;
        }else if(result=="WA"){
            WAarray.at(num++;
        }
        
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: overloaded function with no contextual type information
   15 |             count.at(0)++;
      |                   ^~
a.cc:20:29: error: expected ')' before ';' token
   20 |             WAarray.at(num++;
      |                       ~     ^
      |                             )
Language: C++

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

int main(){
    int N,M; cin>>N>>M;
    vector<bool> CL(N+1,0);
    int AC=0;
    int WA=0;
    vector<int> WAarray(N+1,0);
    for(int i=0;i<M;i++){
        int num;cin>>num;
        string result;cin>>result;
        if(CL.at(num))continue;
        if(result=="AC"){
            count.at(0)++;
            AC++;
            WA+=WAarray[num];
            CL.at(num)=1;
        }else if(result=="WA"){
            WAarray[num]++;
        }
        
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: overloaded function with no contextual type information
   15 |             count.at(0)++;
      |                   ^~
Language: C

#include<stdio.h>

int ac[100000];
int wa[100000];

int main(){
  int n,m;
  int i;
  int p;
  char s[3];
  int asum = 0;
  int wsum = 0;

  scanf("%d %d", &n, &m);

  for(i = 0;i < n;i++){
    ac[i] = 0;
    wa[i] = 0;
  }

  for(i = 0;i < m;i++){
    scanf("%d %s", &p, s);

    if(s[0] == 'W'){
      if(ac[p] != 1) {
        wa[p]++;
      }
    }

    else{
      if(ac[p] != 1){
        ac[p]++;
      }
    }
  }

  for(i = 0;i < n;i++){
    if(ac[i] == 1){
      asum++;
      wsam += wa[i];
    }
  }

  printf("%d %d\n", asum, wsum);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:40:7: error: 'wsam' undeclared (first use in this function); did you mean 'wsum'?
   40 |       wsam += wa[i];
      |       ^~~~
      |       wsum
main.c:40:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <iomanip>

typedef long long ll;
typedef long double ld;

using namespace std;
using Graph = vector<vector<ll>>;

#define rep(i, N) for (ll i = 0; i < (ll)(N); ++i)
#define ALL(a) (a).begin(),(a).end()

const ll inf = 1e18+7;
const ll mod = 1e9+7;

ll GetDigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

int main(){
    ll N,M,acs=0,ps=0,p=0;
    cin >> N >> M;
    string S;
    vector<ll> fl(N,0);
    vector<ll> WA(N,0);
    rep(i,M){
        cin >> p >> S;
        if(fl[p-1]==0){
            if(S=="AC"){
                acs++;
                fl[p-1] = 1;
        }else{
            WA[p-1]++;
        }
    }
    for(i=0;i<N;i++){
        if(fl[i]==1){
            ps+=WA[i];
        }
    }
        cout <<acs <<" "<< ps << endl;
    	return 0;
}


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

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

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

void solve() {
    cin >> N >> M;
    int WAnum = 0;
    int 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]++;
        }
    }
    cout << ACnum << " " << WAnum << endl;
    return;
}


    solve();
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: a function-definition is not allowed here before '{' token
    9 | void solve() {
      |              ^
a.cc:35:5: error: 'solve' was not declared in this scope
   35 |     solve();
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int n,m,a,b,ac,wa;
   cin>>n>>m;
   vector<int> p(m);
   vector<string> s(m); 
   ac=0;
   wa=0;
   a=1;
   b=1;
   rep(i,m){
    cin>>p.at(i)>>s.at(i);
     rep(j,n){
     if(p.at(b)==a){
     if(s.at(b)=="AC"){
      ac++;
      b++;
      continue;
      }
     wa++;
     b++; 
     }
     a++
    }
     continue;
   }
   cout<<ac<<" "<<wa<<endl;
 }


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

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int n,m,a,ac,wa;
   cin>>n>>m;
   vector<int> p;
   vector<string> s; 
   ac=0;
   wa=0;
   a=1;
   rep(i,m){
    cin>>p.at(i)>>s.at(i);
     if(p.at(i)==a){
     if(s.at(i)=="AC"){
      ac++;
      a++
      continue;
      }
     wa++;
     }
     continue;
   }
   cout<<ac<<wa<<endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: expected ';' before 'continue'
   17 |       a++
      |          ^
      |          ;
   18 |       continue;
      |       ~~~~~~~~
Language: C++

n, m = map(int, input().split())
ac = 0
wa = 0
l = [input().split() for i in range(m)]
d = dict()
for i in range(m):
    if l[i][0] not in d or l[i][0] in d and d[l[i][0]] != "AC":
        d[l[i][0]] = l[i][1]
        if l[i][1] == "AC":
            ac += 1
        else:
            wa += 1
print(ac, wa)

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>
#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 q;
        cin >> p >> q;
        p--;
        if (ac[p]) continue;
        if (q == "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:2:18: error: expected ',' or ';' before 'for'
    2 | #define rep(i,n) for(int i = 0;i < (n);i++)
      |                  ^~~
a.cc:9:5: note: in expansion of macro 'rep'
    9 |     rep(i,m){
      |     ^~~
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     rep(i,m){
      |         ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0;i < (n);i++)
      |                                ^
Language: C

#include <stdio.h>
int main(void)
{
  int a,b,c,d,i,acc=0;
  int pe=0;
  int ac[10000];
  char x[3];
  for(i=0;i<=10000;i++){
    ac[i]=0;
  }
  scanf("%d %d",&a,&b);
  for(c=0;c<b;c++){
    scanf("%d  %s",&d,x);
    if(ac[d]!=1){
      if(x[0]=='W'){
        pe++;
      }else
        if(x[0]=='A'){
          acc++;
          ac[d]=1;
        }

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


Compiler output:
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n+1, 0);
    vector<bool> v(n+1, false);
    for (int i = 0; i < m; i++) {
        int p;
        string s;
        cin >> p >> s;
        if(!v[p]) {
            if (s == "WA") {
                a[p]++;
            }
            else {
                v[p] = true;
            }
        }
    }
    int sum = 0;
    int pen = 0;
    for (int i = 1; i <= n; i++) {
        if (v[p]) {
            pen += a[p];
            sum++;
        }
    }
    cout << sum << " " << pen << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: 'p' was not declared in this scope
   26 |         if (v[p]) {
      |               ^
Language: C

#include<iostream>
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
int main()
{
    fastio;
    long long n,m,a,i,correct=0,wrong=0;
    string b;
    cin>>n>>m;
    map<long long,string> mp;
    for(i=0;i<m;i++)
    {
        cin>>a>>b;
        if(b=="AC" && mp[a]!="flag")
        {
            correct++;
            mp[a]="flag";
        }
        else if(mp[a]!="flag" && b=="WA")
        {
            wrong++;
        }
    }
    cout<<correct<<" "<<wrong;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N,M;
    int p[1000000];
    int accnt=0;
    int pncnt=0;
    int ac[1000000]={0};
    string S[1000000];
    cin >>N>>M;
    for(int i=0;i<M;i++){
        cin >>p[i]>>S[i];
        if(S[i]=="AC"&&ac[p[i]-1]==0){
            accnt++;
            ac[p[i]-1]=1;
            continue;
        }
    }
    for(int i=0;i<M;i++){
        
        if(S[i]=="WA"&&ac[p[i]-1]==1){
            pncnt++;
            ac[p[i]-1]=;
            
        }
        
    }
    cout <<accnt<<" "<<pncnt<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: expected primary-expression before ';' token
   23 |             ac[p[i]-1]=;
      |                        ^
Language: C++

n,m=map(int,input().split())
ac=0
penal=0
ar={f"{m}":-1 for m in range(1,n+1)}
for _ in range(m):
    id_,res=input().split()
    if ar[id_]==-1 and res=='WA':
        penal+=1
    elif ar[id_]==-1 and res=='AC':
        ac+=1
        ar[id_]=1
print(ac, penal)

Compiler output:
a.cc:7:29: warning: multi-character character constant [-Wmultichar]
    7 |     if ar[id_]==-1 and res=='WA':
      |                             ^~~~
a.cc:9:31: warning: multi-character character constant [-Wmultichar]
    9 |     elif ar[id_]==-1 and res=='AC':
      |                               ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m=map(int,input().split())
      | ^
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for _ in range(m):
      | ^~~
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<int> p(m);
  vector<string> s(m);
  rep(i,m){
  	cin >> p[i] >> s[i];
  	--p[i];
  }

  int ac = 0, pena = 0;
  vector<int> wrong(n);
  vector<bool> seen(n);
  memset(seen, false, sizeof(seen));
  rep(i,m){
  	if(s[i] == "AC" && seen[p[i]] == false){
  		++ac;
  		pena += wrong[p[i]];
  		seen[p[i]] = true;
  	}
  	if(s[i] == "WA") ++wrong[p[i]];
  }
  cout << ac << " " << pena << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: cannot convert 'std::vector<bool>' to 'void*'
   21 |   memset(seen, false, sizeof(seen));
      |          ^~~~
      |          |
      |          std::vector<bool>
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:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int[] AC = new int[N];
    int[] WA = new int[N];
    for(int i=0; i<N; i++){
      int tmpNum = sc.nextInt()-1;
      boolean isAC = sc.next().equals("AC");
      if(isAC){
        AC[tmpNum] = 1;
      }else{
        if(AC[tmpNum] != 1){
          WA[tmpNum]++;
        }
      }
    }
    int sumAC = 0;
    for(int i=0; i<N; i++){
      if(AC[i] == 1){
        sumWA += WA[i];
      }
    }
    System.out.println(Arrays.stream(problems).sum() + " " + sumWA);
  }
}       


Compiler output:
Main.java:23: error: cannot find symbol
        sumWA += WA[i];
        ^
  symbol:   variable sumWA
  location: class Main
Main.java:26: error: cannot find symbol
    System.out.println(Arrays.stream(problems).sum() + " " + sumWA);
                                     ^
  symbol:   variable problems
  location: class Main
Main.java:26: error: cannot find symbol
    System.out.println(Arrays.stream(problems).sum() + " " + sumWA);
                                                             ^
  symbol:   variable sumWA
  location: class Main
3 errors
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int[] AC = new int[N];
    int[] WA = new int[N];
    for(int i=0; i<N; i++){
      int tmpNum = sc.nextInt()-1;
      boolean isAC = sc.next().equals("AC");
      if(isAC){
        AC[tmpNum] = 1;
      }else{
        if(AC[tmpNum] != 1){
          WA[tmpNum]++;
        }
      }
    }
    int sumAC = 0;
    int sumWA = 0;
    for(int i=0; i<N; i++){
      if(AC[i] == 1){
        sumWA += WA[i];
        sumAC++;
      }
    }
    System.out.println(sumAC + " " + sumWA);
  }
}
    }
        

Compiler output:
Main.java:31: error: class, interface, enum, or record expected
    }
    ^
1 error