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

#include <string.h>

int main(void) {
  int n,m,i,x,p=0,s=0;
  int a[100001]={};
  char w[2];
  
  scanf("%d %d",&n,&m);
  
  for(i = 0; i < m; i ++) {
    scanf("%d %s",&x, w);
    if(strcmp(w,"AC") == 0)
      if(a[x] != -1) p += a[x], s ++, a[x] = -1;
    if(strcmp(w,"WA") == 0)
      if(a[x] != -1)　a[x] ++ ;
  } 
  printf("%d %d",s,p);
}
   

Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d %d",&n,&m);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <string.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d %d",&n,&m);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:21: error: stray '\343' in program
   15 |       if(a[x] != -1)<U+3000>a[x] ++ ;
      |                     ^~~~~~~~
main.c:17:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |   printf("%d %d",s,p);
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <climits>
#include <set>
#include <map>
#include <stack>
#include <iomanip>
#include <tuple>
#define ll long long
using namespace std;
struct all_init
{
    all_init()
    {
        cout << fixed << setprecision(12);
    }
} All_init;

int main()
{
    ll n, m,ac=0,wa=0;
    cin>>n>>m;
    vector<bool> b(n+1,false);
    vector<ll> wav(n);
    
    for (ll i = 0; i < m;i++){
        ll p;
        string s;
        cin >> p >> s;
        if(!b[p]&&s=="WA"){
            wav[p]++;
        }
        else if(!b[p]&&s[i]=="AC"){
            ac++;
            b[p] = true;
        }
    }
    for (ll i = 1; i <= n;i++){
        if(b[i]){
            wa += wav[i];
        }
    }
    cout << ac << " " << wa << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |         else if(!b[p]&&s[i]=="AC"){
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,ac=0,p=0;
    cin>>n>>m;
    int a[n]={0};
    while(m--)
    {
        int x;
        string s;
        cin>>x>>s;
        if(a[x-1]==0 && s=="AC") { a[x-1]=1; ac++; } 
        //else if(a[x-1]==1 && s=="AC") p++;
        else if(s="WA" && a[x-1]==0) p++;
        if(ac==n) break;
    }
    cout<<ac<" "<<p;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((int)((char)((((const char*)"WA") != 0) && (a[(x - 1)] == 0)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   15 |         else if(s="WA" && a[x-1]==0) p++;
      |                 ~^~~~~~~~~~~~~~~~~~
      |                  |
      |                  std::__cxx11::basic_string<char>
a.cc:18:17: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   18 |     cout<<ac<" "<<p;
      |              ~~~^~~
      |              |    |
      |              |    int
      |              const char [2]
Language: C++

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

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

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

#include<iostream>
using namespace std;

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

    int p_mem[m];
    std::string p_str_mem[m];
    std::string s_mem[m];
    int penalty_cnt = 0;
    int correct_cnt = 0;

    for ( int i = 0; i < m; i ++ ) {
        std::cin>>p_str_mem[i]>>s_mem[i];
        p_mem[i] = atoi(p_str_mem[i].c_str());
    }    

    for ( int i = 0; i < n; i++ ) {
        bool ac_flg = false;
        int tmp_penalty_cnt = 0;
        for ( int j = 0; j < m; j++ ) {
            char tmp_s_mem = s_mem[j];
            if ( ac_flg != true ) {
                if ( p_mem[j] == i + 1 ) {
                    if ( tmp_s_mem == "AC" ) {
                        correct_cnt++;
                        ac_flg = true;
                    }
                    else if ( tmp_s_mem == "WA" ) {
                        tmp_penalty_cnt++;
                    }
                }
            }
            if ( ac_flg == true ) {
                break;
            }
            
        }
        if ( ac_flg == true ) {
            penalty_cnt += tmp_penalty_cnt;
        }
    }

    cout<<correct_cnt<<" "<<penalty_cnt<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization
   23 |             char tmp_s_mem = s_mem[j];
      |                              ~~~~~~~^
      |                                     |
      |                                     std::string {aka std::__cxx11::basic_string<char>}
a.cc:26:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |                     if ( tmp_s_mem == "AC" ) {
      |                          ~~~~~~~~~~^~~~~~~
a.cc:30:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                     else if ( tmp_s_mem == "WA" ) {
      |                               ~~~~~~~~~~^~~~~~~
Language: C++

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

long long N=0,K=0,M=0,A=0,ansac=0,answa=0,p=0;
string S;
int main(){
    cin >> N >> M;
    vector<pair<string,long long> P(N+1);
    for (i=1;i<=N;i++){
        P[i] = make_pair("WA",0);
    }

    for (int i=0;i<M;i++){
        cin >> p >> S;
        if (P[p].first != "AC"){
            P[p].first = S;
            if (P[p].first=="AC") {
                ansac++;
                answa += P[p].second;
            } else {
                P[p].second++;
            }
        }
    }
    cout << ansac << endl << answa << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: template argument 1 is invalid
   10 |     vector<pair<string,long long> P(N+1);
      |                                        ^
a.cc:10:40: error: template argument 2 is invalid
a.cc:11:10: error: 'i' was not declared in this scope
   11 |     for (i=1;i<=N;i++){
      |          ^
a.cc:12:9: error: 'P' was not declared in this scope
   12 |         P[i] = make_pair("WA",0);
      |         ^
a.cc:17:13: error: 'P' was not declared in this scope
   17 |         if (P[p].first != "AC"){
      |             ^
Language: C++

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

long long N=0,K=0,M=0,A=0,ansac=0,answa=0,p=0;
string S;
int main(){
    cin >> N >> M;
    vector<pair<string,long long> P(N,pair<string,long long>("WA",0));

    for (int i=0;i<M;i++){
        cin >> p >> S;
        if (P[p].first != "AC"){
            P[p].first = S;
            if (P[p].first=="AC") {
                ansac++;
                answa += P[p].second;
            } else {
                P[p].second++;
            }
        }
    }
    cout << ansac << endl << answa << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:69: error: template argument 1 is invalid
   10 |     vector<pair<string,long long> P(N,pair<string,long long>("WA",0));
      |                                                                     ^
a.cc:10:69: error: template argument 2 is invalid
a.cc:14:13: error: 'P' was not declared in this scope
   14 |         if (P[p].first != "AC"){
      |             ^
Language: C++

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

long long N=0,K=0,M=0,A=0,ansac=0,answa=0,p=0;
string S;
int main(){
    cin >> N >> M;
    vector<string> P(N,"WA");

    for (int i=0;i<M;i++){
        cin >> p >> S;
        if (P[p] != "AC"){
            P[p] = S;
            if (P[p]=="AC") {
                ansac++;
            } else {
                answa++;
            }
        }
    }
    cout << ansac << endl << answa << endl;
    return 0;
}


Compiler output:
a.cc:3:9: fatal error: algorithm.h: No such file or directory
    3 | #include<algorithm.h>
      |         ^~~~~~~~~~~~~
compilation terminated.
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];
    }
    vector<int> AC(N+1,0);
    int cnt_AC=0,cnt_WA=0;
    for(int i=0;i<M;i++){
        if(AC[p[i]]==0){
            if(S[i]=="AC"){
                AC[p[i]]++;
                cnt_AC++;
            }else(S[i]=="WA"){
                cnt_WA++;
            }  
        }
    }
    cout << cnt_AC << " " << cnt_WA << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: expected ';' before '{' token
   18 |             }else(S[i]=="WA"){
      |                              ^
      |                              ;
a.cc:18:23: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   18 |             }else(S[i]=="WA"){
      |                  ~~~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

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

long long N=0,K=0,M=0,A=0,ansac=0,answa=0,p=0;
string S;
int main(){
    cin >> N >> M;
    vector<int> P(N)=0;

    for (int i=0;i<M;i++){
        cin >> p >> S;
        if (P[p] != 1){
            if (S == "AC") {
                P[p]=1;
                ansac++;
            } else {
                answa++;
            }
        }
    }
    cout << ansac << endl << answa << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ',' or ';' before '=' token
    9 |     vector<int> P(N)=0;
      |                     ^
Language: C++

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

long long N=0,K=0,M=0,A=0,ans=0,p=0;
string S;
int main(){
    cin >> N >> M;
    vector<String> P[N];
    vector <long long> c[N];

    for (int i=0;i<M;i++){
        cin >> p >> S;
        if(P[p] != "AC"){
            P[p] = S;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'String' was not declared in this scope
    8 |     vector<String> P[N];
      |            ^~~~~~
a.cc:8:18: error: template argument 1 is invalid
    8 |     vector<String> P[N];
      |                  ^
a.cc:8:18: error: template argument 2 is invalid
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(P[p] != "AC"){
      |            ~~~~~^~~~~~~
a.cc:14:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment
   14 |             P[p] = S;
      |                    ^
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,m;
string s;
cin>>n>>m;
int a,b=-1,c=-1;
string s1="k",s2="z";
int c1=0,c2=0,k=0;
while(m--){
  cin>>a>>s;
 if(s[0]=='A' ){
    if(b==a){
      k++;
    }
 else{
    b=a;
    c1++;
 }

 }
 else if(s[0]=="W"&& b!=a){
    c2++;
 }
 }

cout<<abs(c1-k)<<" "<<c2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |  else if(s[0]=="W"&& b!=a){
Language: C

#include "stdio.h"
#include "string.h"

int main(void) {
  /* code */
  int N,M;
  int ac = 0;
  int wa = 0;
  scanf("%d %d",&N, &M);
  int p,count[M];
  char s[2];
  for (int i = 0; i < M; i++) {
    scanf("%d %s", p, s);
    if(count[p] != 1){
      if(strcmp(s,"WA")){
        wa += 1;
      }else if(s,"AC")){
        ac+=1;
        count[p] = 1;
      }
    }
    /* code */
  }
/*
  for (int r = 0; r < N; r++) {
    // if (r == N-1){
    //   break;
    }
    for (int s = 0; s < N; s++) {
      if()
      if(strcmp(S[s],"WA")){
        wa += 1;
      }else if(strcmp(S[s],"AC")){
        ac+=1;
        break;
      }
    }
  }
  */
  printf("%d %d\n",ac,wa);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:23: error: expected statement before ')' token
   17 |       }else if(s,"AC")){
      |                       ^
Language: C

#include "stdio.h"
#include "string.h"

int main(void) {
  /* code */
  int N,M;
  int ac = 0;
  int wa = 0;
  scanf("%d %d",&N, &M);
  int p,count[M];
  char *s;
  for (int i = 0; i < M; i++) {
    scanf("%d %s", p, s);
    if(count[p] != 1){
      if(strcmp(s,"WA")){
        wa += 1;
      }else if(s,"AC")){
        ac+=1;
        count[p] = 1;
      }
    }
    /* code */
  }
/*  
  for (int r = 0; r < N; r++) {
    // if (r == N-1){
    //   break;
    }
    for (int s = 0; s < N; s++) {
      if()
      if(strcmp(S[s],"WA")){
        wa += 1;
      }else if(strcmp(S[s],"AC")){
        ac+=1;
        break;
      }
    }
  }
  */
  printf("%d %d\n",ac,wa);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:23: error: expected statement before ')' token
   17 |       }else if(s,"AC")){
      |                       ^
Language: C

#include "stdio.h"
##include "string.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  int ac = 0;
  int wa = 0;
  scanf("%d %d",&N, &M);
  int p[M];
  char S[M][2];
  for (int i = 0; i < M; i++) {
    scanf("%d %s", &p[i], S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(strcmp(S[s],"WA")){
        wa += 1;
      }else if(strcmp(S[s],"AC")){
        ac+=1;
        break;
      }
    }
  }
  printf("%d %d\n",ac,wa);
  return 0;
}


Compiler output:
main.c:2:1: error: stray '##' in program
    2 | ##include "string.h"
      | ^~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
    2 | ##include "string.h"
      |           ^~~~~~~~~~
Language: C

#include "stdio.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  int ac = 0;
  int wa = 0;
  scanf("%d %d",&N, &M);
  int p[M];
  char S[M][2];
  for (int i = 0; i < M; i++) {
    scanf("%d %s", &p[i], S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(S[s]=="WA"){
        wa += 1;
      }else if(S[s]=="AC"){
        ac+=1;
        break;
      }
    }
    printf("%d %d\n",ac,wa);
  }



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

#include "stdio.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  int ac = 0;
  int wa = 0;
  scanf("%d %d",&N, &M);
  int p[M];
  string S[M][2];
  for (int i = 0; i < M; i++) {
    scanf("%d %s", &p[i], S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(S[s]=="WA"){
        wa += 1;
      }else if(S[s]=="AC"){
        ac+=1;
        break;
      }
    }
    printf("%d %d\n",ac,wa);
  }



Compiler output:
main.c: In function 'main':
main.c:10:3: error: unknown type name 'string'; did you mean 'stdin'?
   10 |   string S[M][2];
      |   ^~~~~~
      |   stdin
main.c:21:14: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   21 |       if(S[s]=="WA"){
      |              ^~
main.c:23:20: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   23 |       }else if(S[s]=="AC"){
      |                    ^~
main.c:29:3: error: expected declaration or statement at end of input
   29 |   }
      |   ^
Language: C

#include "stdio.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  ac = 0;
  wa = 0;
  scanf("%d %d",&N, &M);
  int p[M]
  string S[M];
  for (int i = 0; i < M; i++) {
    scanf("%d %s", &p[i], S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(S[s]=="WA"){
        wa += 1;
      }else if(S[s]=="AC"){
        ac+=1;
        break;
      }
    }
    printf("%d %d\n",ac,wa);

Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'ac' undeclared (first use in this function)
    6 |   ac = 0;
      |   ^~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:3: error: 'wa' undeclared (first use in this function)
    7 |   wa = 0;
      |   ^~
main.c:10:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'string'
   10 |   string S[M];
      |   ^~~~~~
main.c:10:3: error: unknown type name 'string'; did you mean 'stdin'?
   10 |   string S[M];
      |   ^~~~~~
      |   stdin
main.c:12:21: error: 'p' undeclared (first use in this function)
   12 |     scanf("%d %s", &p[i], S[i]);
      |                     ^
main.c:21:14: warning: comparison between pointer and integer
   21 |       if(S[s]=="WA"){
      |              ^~
main.c:23:20: warning: comparison between pointer and integer
   23 |       }else if(S[s]=="AC"){
      |                    ^~
main.c:28:5: error: expected declaration or statement at end of input
   28 |     printf("%d %d\n",ac,wa);
      |     ^~~~~~
main.c:28:5: error: expected declaration or statement at end of input
Language: C

#include "stdio.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  ac = 0;
  wa = 0;
  scanf("%d %d",&N, &M);
  int p[M]
  string S[M];
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &p[i], &S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(S[s]=="WA"){
        wa += 1;
      }else if(S[s]=="AC"){
        ac+=1;
        break;
      }
    }
    printf("%d %d\n",ac,wa);


Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'ac' undeclared (first use in this function)
    6 |   ac = 0;
      |   ^~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:3: error: 'wa' undeclared (first use in this function)
    7 |   wa = 0;
      |   ^~
main.c:10:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'string'
   10 |   string S[M];
      |   ^~~~~~
main.c:10:3: error: unknown type name 'string'; did you mean 'stdin'?
   10 |   string S[M];
      |   ^~~~~~
      |   stdin
main.c:12:21: error: 'p' undeclared (first use in this function)
   12 |     scanf("%d %d", &p[i], &S[i]);
      |                     ^
main.c:21:14: warning: comparison between pointer and integer
   21 |       if(S[s]=="WA"){
      |              ^~
main.c:23:20: warning: comparison between pointer and integer
   23 |       }else if(S[s]=="AC"){
      |                    ^~
main.c:28:5: error: expected declaration or statement at end of input
   28 |     printf("%d %d\n",ac,wa);
      |     ^~~~~~
main.c:28:5: error: expected declaration or statement at end of input
Language: C

#include "stdio.h"

int main(void) {
  /* code */
  int N,M,count1,count2;
  ac = 0;
  wa = 0;
  scanf("%d %d",&N, %M);
  int p[M],S[M];
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &p[i], &S[i]);
    /* code */
  }
  for (int r = 0; r < N; r++) {
    if (r == N-1){
      break;
    }/* code */
    for (int s = 0; s < N; s++) {
      /* code */
      if(S[s]=="WA"){
        wa += 1;
      }else if(S[s]=="AC"){
        ac+=1;
        break;
      }
    }
    printf("%d %d\n",ac,wa);
  }

Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'ac' undeclared (first use in this function)
    6 |   ac = 0;
      |   ^~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:3: error: 'wa' undeclared (first use in this function)
    7 |   wa = 0;
      |   ^~
main.c:8:21: error: expected expression before '%' token
    8 |   scanf("%d %d",&N, %M);
      |                     ^
main.c:20:14: warning: comparison between pointer and integer
   20 |       if(S[s]=="WA"){
      |              ^~
main.c:22:20: warning: comparison between pointer and integer
   22 |       }else if(S[s]=="AC"){
      |                    ^~
main.c:28:3: error: expected declaration or statement at end of input
   28 |   }
      |   ^
Language: C++

#include <iostream>
#include <vector>
#include <string>

struct T {
  bool b = false;
  int w = 0;
} t;

int main() {
	int n, m;
	int p;
	int cc = 0, p = 0, temp = 0;
	std::string s;
	std::cin >> n >> m;
	std::vector<T> a (n+1);
	for(int i = 0; i < m; i++) {
		std::cin >> p >> s;
      	if(a[p].b == false) {
			if(s == "AC") {
				cc++;
				a[p].b = true;
			} else {
				a[p].w++;
			}
		}
	}

	for(int i = 1; i < a.size(); i++) {
		if(a[i].b) {
			p += a[i].w;
		}
	}
	std::cout << cc << " " << p;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: redeclaration of 'int p'
   13 |         int cc = 0, p = 0, temp = 0;
      |                     ^
a.cc:12:13: note: 'int p' previously declared here
   12 |         int p;
      |             ^
Language: Java

class Main {
    public static void main (String[] args)  {
        Scanner in = new Scanner(System.in);
        int numProblems = in.nextInt();
        int numSubmissions = in.nextInt();
        Map<Integer, String> map = new HashMap<Integer, String>();
        int correctAnswers=0;
        int penalties=0;
        for (int i=0;i<numSubmissions;i++){
            int nextTask=in.nextInt();
            String nextResult = in.next();
            if (map.containsKey(nextTask)){
                if(!map.get(nextTask).equals("AC")){
                    if(nextResult.equals("WA")){
                        penalties++;
                    }
                    if(nextResult.equals("AC")){
                        map.put(nextTask, nextResult);
                        correctAnswers++;
                    }
                }
            }
            else {
                map.put(nextTask, nextResult);
                if (nextResult.equals("WA")) {
                    penalties++;
                } else if (nextResult.equals("AC")) {
                    correctAnswers++;
                }
            }
        }
        System.out.print(correctAnswers);
        System.out.print(" "+penalties);


    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
        Map<Integer, String> map = new HashMap<Integer, String>();
        ^
  symbol:   class Map
  location: class Main
Main.java:6: error: cannot find symbol
        Map<Integer, String> map = new HashMap<Integer, String>();
                                       ^
  symbol:   class HashMap
  location: class Main
4 errors
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main() {
  int n, m;
  cin >> n >> m;
  int curr = 1;
  vector<bool> solved(n, false);
  vector<int> fails(n, 0);
  int wa = 0, ac = 0;
  for (int i = 0; i < m; ++i)
  {
    int problem;
    string result;
    cin >> problem >> result;
    if (result == "AC" && !solved[problem])
    {
      solved[problem] = true;
      ac++;
      wa += fails[problem];
    }
    if (temp == "WA" && !solved[problem])
      fails[problem]++;
  }
  cout << ac << " " << wa;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'temp' was not declared in this scope; did you mean 'tm'?
   23 |     if (temp == "WA" && !solved[problem])
      |         ^~~~
      |         tm
Language: Java

public class Main{
public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int numberOfProblems = sc.nextInt();
        int numberOfSubmissions = sc.nextInt();
        int[] wa = new int[numberOfProblems+1];
        int correct =0, penalties = 0;
         while (numberOfSubmissions-->0){
             int indexOfQuestion = sc.nextInt();
             String result = sc.next();

             if(wa[indexOfQuestion]==-1){
                 continue;
             }
             if(result.equals("WA")){
                 wa[indexOfQuestion]++;
             }else {
                 correct++;
                 penalties += wa[indexOfQuestion];
                 wa[indexOfQuestion] = -1;
             }
         }
        System.out.println(correct+ " "+penalties);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n, m, penalties = 0, correct = 0; 
  cin >> n >> m;
  vector < int > penalty(n, 0);
  vector < bool > accepted(n, false);
  for(int i = 1; i <= m; i++){
	int task;
    string verdict;
    cin >> task >> verdict;
    if(verdict == "AC"){
      if(accepted[task] == false)penalties += penalty[task], correct++;
      accepted[task] = true;
    }else{
      penalty[task]++;
    }
  }
  cout << correct << ' ' << penalties
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector < int > penalty(n, 0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:12: error: expected primary-expression before 'int'
    6 |   vector < int > penalty(n, 0);
      |            ^~~
a.cc:7:12: error: expected primary-expression before 'bool'
    7 |   vector < bool > accepted(n, false);
      |            ^~~~
a.cc:13:10: error: 'accepted' was not declared in this scope
   13 |       if(accepted[task] == false)penalties += penalty[task], correct++;
      |          ^~~~~~~~
a.cc:13:47: error: 'penalty' was not declared in this scope; did you mean 'penalties'?
   13 |       if(accepted[task] == false)penalties += penalty[task], correct++;
      |                                               ^~~~~~~
      |                                               penalties
a.cc:14:7: error: 'accepted' was not declared in this scope
   14 |       accepted[task] = true;
      |       ^~~~~~~~
a.cc:16:7: error: 'penalty' was not declared in this scope; did you mean 'penalties'?
   16 |       penalty[task]++;
      |       ^~~~~~~
      |       penalties
a.cc:19:38: error: expected ';' before '}' token
   19 |   cout << correct << ' ' << penalties
      |                                      ^
      |                                      ;
   20 | }
      | ~
Language: C++

n,m = list(map(int,input().split()))
counter = 0
data = []
checkd = []
tmp = {}

wa = 0
#入力処理
for i in range(m):
  a,b = input().split()
  if b == "WA":
    if int(a) not in tmp:
      tmp[int(a)] = 0
    tmp[int(a)] += 1  
  elif (( b == "AC") and (int(a)) not in checkd):
    counter += 1
    checkd.append(int(a))
    if int(a) not in tmp:
      tmp[int(a)] = 0  
    wa += tmp[int(a)]


"""
for i in range(m):
  if data[i][1] == "WA":
    if int(data[i][0]) not in tmp:
      tmp[int(data[i][0])] = 0
    tmp[int(data[i][0])] += 1  
  elif ((data[i][1]) == "AC") and (int(data[i][0]) not in checkd):
    counter += 1
    checkd.append(int(data[i][0]))
    if int(data[i][0] ) not in tmp:
      tmp[int(data[i][0])] = 0  
    wa += tmp[int(data[i][0])]
"""    
print(counter,wa)

  
  



Compiler output:
a.cc:8:2: error: invalid preprocessing directive #\U00005165\U0000529b\U000051e6\U00007406
    8 | #入力処理
      |  ^~~~~~~~
a.cc:23:3: warning: missing terminating " character
   23 | """
      |   ^
a.cc:23:3: error: missing terminating " character
a.cc:35:3: warning: missing terminating " character
   35 | """
      |   ^
a.cc:35:3: error: missing terminating " character
   35 | """
      |   ^    
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = list(map(int,input().split()))
      | ^
a.cc:7:1: error: 'wa' does not name a type
    7 | wa = 0
      | ^~
Language: C++

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

int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  
  int p[M];
  string s[M];
  for (int i = 0; i < M; i++) {
    cin >> p[i] >> s[i];
  }
  
  int ans[N];
  int pen[N];
  
  for (int i = 0; i < N; i++) {
    ans[i] = 0; 
    pf[i] = 0;
    pen[i] = 0;
  }
  
  for (int i = 0; i < M; i++) {
    if (s[i] == "AC") {ans[p[i]-1] = 1; 
                       pen[p[i]-1] = pf[p[i]-1];}
    else if (s[i] == "WA" && ans[p[i]-1] == 0) {pf[p[i]-1]++;}
  }
  
  int outa = 0;
  int outp = 0;
  
  for (int i = 0; i < N; i++) {
    outa = outa + ans[i];
    outp = outp + pen[i];
  }
  
  cout << outa << ' ' << outp << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'pf' was not declared in this scope; did you mean 'p'?
   21 |     pf[i] = 0;
      |     ^~
      |     p
a.cc:27:38: error: 'pf' was not declared in this scope; did you mean 'p'?
   27 |                        pen[p[i]-1] = pf[p[i]-1];}
      |                                      ^~
      |                                      p
a.cc:28:49: error: 'pf' was not declared in this scope; did you mean 'p'?
   28 |     else if (s[i] == "WA" && ans[p[i]-1] == 0) {pf[p[i]-1]++;}
      |                                                 ^~
      |                                                 p
Language: C++

lines = []
_, N = input().split()
N = int(N)

lines = [input() for _ in range(N)]

correct = 0
penalty = 0
solved = set()
unsolved = set()

for line in lines:
    problem, response = line.split()
    if problem in solved:
        pass
    elif problem in unsolved:
        if response == 'AC':
            correct += 1
            solved.add(problem)
            unsolved.remove(problem)
    else:
        if response == 'WA':
            penalty += 1
            unsolved.add(problem)
        elif response == 'AC':
            correct += 1
            solved.add(problem)
            if problem in unsolved:
                unsolved.remove(problem)

print("{} {}", correct, penalty)


Compiler output:
a.cc:17:24: warning: multi-character character constant [-Wmultichar]
   17 |         if response == 'AC':
      |                        ^~~~
a.cc:22:24: warning: multi-character character constant [-Wmultichar]
   22 |         if response == 'WA':
      |                        ^~~~
a.cc:25:26: warning: multi-character character constant [-Wmultichar]
   25 |         elif response == 'AC':
      |                          ^~~~
a.cc:1:1: error: 'lines' does not name a type
    1 | lines = []
      | ^~~~~
Language: C++

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

int main(){
    int N,M; cin >> N >> M;
    vector<pair<int,string>> pS(M);
    for(int i=0;i<M;i++){
        cin >> pS[i].first >> pS[i].second;
    }
    int m = pS[0].first;
    for(int i=0;i<M;i++){
        m = max(m,pS[i]);
    }
    int cnt_AC = 0,cnt_WA = 0;
    for(int i=1;i<=m;i++){
        for(int j=0;j<M;j++){
            if(pS[j].first==i){
                if(pS[j].second=="AC"){
                    cnt_AC++;
                    break;
                }else{
                    cnt_WA++;
                }
            }
        }
    }
    cout << cnt_AC << " " << cnt_WA << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type&)'
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
In file included 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'})
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
Language: C++

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

int main(){
    int N,M; cin >> N >> M;
    vector<pair<int,string>> pS(M);
    for(int i=0;i<M;i++){
        cin >> pS[i].first >> pS[i].second;
    }
    int m = pS[0].first;
    for(int i=0;i<M;i++){
        m = max(m,pS[i]);
    }
    int cnt_AC = 0,cnt_WA = 0;
    for(int i=1;i<=max;i++){
        for(int j=0;j<M;j++){
            if(pS[j].first==i){
                if(pS[j].second=="AC"){
                    cnt_AC++;
                    break;
                }else{
                    cnt_WA++;
                }
            }
        }
    }
    cout << cnt_AC << " " << cnt_WA << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type&)'
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
In file included 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, std::__cxx11::basic_string<char> > >, std::pair<int, std::__cxx11::basic_string<char> > >::value_type' {aka 'std::pair<int, std::__cxx11::basic_string<char> >'})
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |         m = max(m,pS[i]);
      |             ~~~^~~~~~~~~
a.cc:15:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   15 |     for(int i=1;i<=max;i++){
      |                 ~^~~~~
Language: C++

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

int main(){
    int N,M; cin >> N >> M;
    vector<pair<int,string>> pS(M);
    for(int i=0;i<M;i++){
        cin >> pS[i].first >> pS[i].second;
    }
    int max = pS[0].first;
    for(int i=0;i<M;i++){
        max = max(max,pS[i]);
    }
    int cnt_AC = 0,cnt_WA = 0;
    for(int i=1;i<=max;i++){
        for(int j=0;j<M;j++){
            if(pS[j].first==i){
                if(pS[j].second=="AC"){
                    cnt_AC++;
                    break;
                }else{
                    cnt_WA++;
                }
            }
        }
    }
    cout << cnt_AC << " " << cnt_WA << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: 'max' cannot be used as a function
   12 |         max = max(max,pS[i]);
      |               ~~~^~~~~~~~~~~
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int mondai = sc.nextInt();
		int teisyutu = sc.nextInt();
		int[] seitou = new int[mondai];
		int[] pena = new int[mondai];
        int ansOK = 0;
		int ansNG = 0;
		if (teisyutu == 0){
			System.out.print(0);
			return;
		}
		for ( int i = 0; i < teisyutu; i++){
			int number = sc.nextInt() - 1;
			String ret = sc.next();
			if ( seitou[number] == 0){
				if (ret.equals("AC")){
					seitou[number]++;
				} else {
					pena[number]++;
				}
			}
		}
		for ( int i = 0; i < seitou.length; i++){
			if ( seitou[i] == 1){
				ansOK = seitou[i]
				ansNG += pena[i];
			}
		}
		System.out.println(ansOK + " " + ansNG);
	}
}


Compiler output:
Main.java:29: error: ';' expected
				ansOK = seitou[i]
				                 ^
1 error
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;


int main() {
    ll n, m; cin >> n >> m;
    vector<ll> a(n), b(n);
    ll x =0;
    for (int i=0; i<m; i++) {
        ll p; string s; cin >> p >> s; p--;
        if (a[p] == -1) continue;
        if (s == "AC") {
            x++; a[p] = -1;
        } else {
            if (a[p] != -1) b[p]++;
        }
    }
    ll ret = 0; for(i=0; i<n; i++) if (a[i] == -1) ret += b[i];
    cout << x << " " << ret << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: 'i' was not declared in this scope
   28 |     ll ret = 0; for(i=0; i<n; i++) if (a[i] == -1) ret += b[i];
      |                     ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;


int main() {
    ll n, m; cin >> n >> m;
    vector<ll> a(n), b(n);
    ll x =0;
    for (int i=0; i<m; i++) {
        ll p; string s; cin >> p >> s; p--;
        if (a[p] == -1) continue;
        if (s == "AC") {
            x++; a[p] = -1;
        } else {
            if (a[p] != -1) b[p]++;
        }
        ll ret = 0; for(i=0, i<n; i++) if (a[i] == -1) ret += b[i];
        cout << x << " " << ret << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:38: error: expected ';' before ')' token
   27 |         ll ret = 0; for(i=0, i<n; i++) if (a[i] == -1) ret += b[i];
      |                                      ^
      |                                      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int N, M;
int WA[105000];
bool AC[105000];
 
void solve() {
    cin >> N >> M;
    int WAnum = 0;
    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;
}
 
int main() {
    solve();
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

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;
}

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

Compiler output:
a.cc:40:5: error: redefinition of 'int N'
   40 | int N, M;
      |     ^
a.cc:4:5: note: 'int N' previously declared here
    4 | int N, M;
      |     ^
a.cc:40:8: error: redefinition of 'int M'
   40 | int N, M;
      |        ^
a.cc:4:8: note: 'int M' previously declared here
    4 | int N, M;
      |        ^
a.cc:41:5: error: redefinition of 'int WA [105000]'
   41 | int WA[105000];
      |     ^~
a.cc:5:5: note: 'int WA [105000]' previously declared here
    5 | int WA[105000];
      |     ^~
a.cc:42:6: error: redefinition of 'bool AC [105000]'
   42 | bool AC[105000];
      |      ^~
a.cc:6:6: note: 'bool AC [105000]' previously declared here
    6 | bool AC[105000];
      |      ^~
a.cc:44:6: error: redefinition of 'void solve()'
   44 | void solve() {
      |      ^~~~~
a.cc:8:6: note: 'void solve()' previously defined here
    8 | void solve() {
      |      ^~~~~
a.cc:69:5: error: redefinition of 'int main()'
   69 | int main() {
      |     ^~~~
a.cc:33:5: note: 'int main()' previously defined here
   33 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
int main()
{
   ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
 
  vector<int> cnt(n), paisi(n);
  for (int i = 0; i < m; i++){
    int p;
    string vr;
    cin >> p >> vr;
    if(vr=="AC"){
      paisi[p - 1] = 1;
    }
    else if(vr=="WA"){
      if(paisi[p-1] == 0){
        cnt[p - 1]++;
      }
    }
    else
      assert(false);
  }
  int ac = 0, pnl = 0;
  for (int i = 0; i < n; i++){
    if(paisi[i]){
      ++ac;
      pnl += cnt[i];
    }
  }
  cout << ac << " " << pnl << endl;
  return 0;
}
}



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

#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
int main()
{
    int n,m;
    cin>>m>>n;
    int a[n+5]={0};
    int b[n+5]={0};
    for(int i=0;i<n;i++){
        int x;string s;
        cin>>x>>s;
        if(s=="AC"){
            a[x-1]=1;
        }
        if(s=="WA"){
            if(a[x-1]==0){
                b[c-1]++;
            }
        }
    }
    int cnt=0;
    int pl=0;
    for(int i=0;i<m;i++){
        if(a[i])cnt++,pl+=b[i];
    }
    cout<<cnt<<" "<<pl<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'c' was not declared in this scope
   19 |                 b[c-1]++;
      |                   ^
Language: C++

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> penalty(n + 1, 0);
    vector<int> ac(n + 1, 0);
    for (int i = 1; i <= m; ++i) {
        int x;
        cin >> x;
        string str;
        cin >> str;
        
        if (str == "AC") {
            ac[x] = 1;
        }
        if (str == "WA" && ac[x] == 0) {
            penalty[x]++
        }
        
    }
    int sum_pen = 0;
    int sum_ac = 0;
    for (int i = 1; i <= n; ++i) {
        sum_ac += ac[i];
        sum_pen += penalty[i];
    }
    cout << sum_ac << " " << sum_pen << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected ';' before '}' token
   19 |             penalty[x]++
      |                         ^
      |                         ;
   20 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n=0;
	int m=0;
	int p=0;
	int ac=0;
	int ans=0;
	string s;
	map<int,int> table;
	cin>>n>>m;
  	vector<int>	wa(n);
	for(int i=0;i<n;i++)
	{
		table[i]=0;
	}
	for(int i=0;i<m;i++)
	{
		cin>>p>>s;
		if(table[p]==1) continue;
		if(s=="AC")
		{
			table[p]=1;
          	ac++;
		}
		else wa[i]+=1;
	}
  	for(int i=0;i<n;i++)
  	{
  		if(table[i]==0)
  		{
  			wa[i]=0
  		}
  		ans+=wa[i];
  	}
	cout<<ac<<" "<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: expected ';' before '}' token
   33 |                         wa[i]=0
      |                                ^
      |                                ;
   34 |                 }
      |                 ~