alexjercan/bugnet huggingface dataset:
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

using namespace std;

int main() {
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0, n;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == "AC")
      c0 = c0 + 1;
    else if (arr[i] == "WA")
      c1 = c1 + 1;
    else if (arr[i] == "TLE")
      c2 = c2 + 1;
    else if (arr[i] == "RE")
      c3 = c3 + 1;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>

using namespace std;
int main() {
  int n, m = 0, e = 0, b = 0, d = 0, w = 0;
  string a[100];
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (int i = 0; i < n; i++) {
    if (a[i] == "AC") {
      m++;
    } else if (a[i] == "TLE") {
      e++;
    } else if (a[i] == "WA") {
      b++;
    } else if (a[i] == "RE") {
      d++;
    }
  }
  cout << "AC"
       << "x" << m << endl;
  cout << "TLE"
       << "x" << e << endl;
  cout << "WA"
       << "x" << b << endl;
  cout << "RE"
       << "x" << d << endl;

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
using namespace std;
int main() {
  int n;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string buf;
    cin >> buf;
    if (buf == "AC") {
      ac++;
    } else if (buf == "WA") {
      wa++;
    } else if (buf == "TLE") {
      tle++;
    } else if (buf == "RE") {
      re++;
    }
  }
  cout << "AC"
       << " x " << ac << endl;
  cout << "WA"
       << " x " << wa << endl;
  cout << "TLE"
       << " x " << tle << endl;
  cout << "RE"
       << " x " << re << endl;
  return 0;
}

Error: -11

Fixed submission:


#include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
  int n, c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  cin >> n;
  string s[10000000];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == "AC")
      c1++;
    else if (s[i] == "WA")
      c2++;
    else if (s[i] == "TLE")
      c3++;
    else if (s[i] == "RE")
      c4++;
  }
  cout << "AC x " << c1 << endl;
  cout << "WA x " << c2 << endl;
  cout << "TLE x " << c3 << endl;
  cout << "RE x " << c4 << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
#include <string>
using namespace std;

void b_judge_status_summary(void) {
  int n;
  string s[100000];
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> s[i];
  int ac_cnt = 0;
  int wa_cnt = 0;
  int tle_cnt = 0;
  int re_cnt = 0;
  for (int i = 0; i < n; i++) {
    string ss = s[i];
    if (ss[0] == 'A')
      ac_cnt++;
    else if (ss[0] == 'W')
      wa_cnt++;
    else if (ss[0] == 'T')
      tle_cnt++;
    else
      re_cnt++;
  }

  cout << "AC x " << ac_cnt << endl;
  cout << "WA x " << wa_cnt << endl;
  cout << "TLE x " << tle_cnt << endl;
  cout << "RE x " << re_cnt << endl;
}

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

Error: 0

Fixed submission:

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
#include <string>
using namespace std;

void b_judge_status_summary(void) {
  int n;
  string s[10000];
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> s[i];
  int ac_cnt = 0;
  int wa_cnt = 0;
  int tle_cnt = 0;
  int re_cnt = 0;
  for (int i = 0; i < n; i++) {
    string ss = s[i];
    if (ss[0] == 'A')
      ac_cnt++;
    else if (ss[0] == 'W')
      wa_cnt++;
    else if (ss[0] == 'T')
      tle_cnt++;
    else
      re_cnt++;
  }

  cout << "AC x " << ac_cnt << endl;
  cout << "WA x " << wa_cnt << endl;
  cout << "TLE x " << tle_cnt << endl;
  cout << "RE x " << re_cnt << endl;
}

int main() {
  b_judge_status_summary();
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

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

  vector<int> count(4, 0);
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;

    if (S == "AC") {
      count.at(0)++;
    } else if (S == "WA") {
      count.at(1)++;
    } else if (S == "TLE") {
      count.at(2)++;
    } else if (S == "RE") {
      count.at(3)++;
    }
  }

  printf("AC x %d\\n", count.at(0));
  printf("WA x %d\\n", count.at(1));
  printf("TLE x %d\\n", count.at(2));
  printf("RE x %d\\n", count.at(3));
}

Error: 0

Fixed submission:

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

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

  vector<int> count(N, 0);
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;

    if (S == "AC") {
      count.at(0)++;
    } else if (S == "WA") {
      count.at(1)++;
    } else if (S == "TLE") {
      count.at(2)++;
    } else if (S == "RE") {
      count.at(3)++;
    }
  }

  printf("AC x %d\\n", count.at(0));
  printf("WA x %d\\n", count.at(1));
  printf("TLE x %d\\n", count.at(2));
  printf("RE x %d\\n", count.at(3));
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int n;
  cin >> n;
  string b;
  vector<int> a(4);
  for (int i = 0; i < n; i++) {
    cin >> b;
    if (b == "AC")
      a.at(0)++;
    else if (b == "WA")
      a.at(1)++;
    else if (b == "TLE")
      a.at(2)++;
    else
      a.at(3)++;
  }

  cout << "AC x" << ' ' << a.at(0) << endl;
  cout << "WA x" << ' ' << a.at(1) << endl;
  cout << "TLE x" << ' ' << a.at(2) << endl;
  cout << "RE x" << ' ' << a.at(3) << endl;

  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 3) >= this->size() (which is 3)


Fixed submission:

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

int main() {
  int n;
  cin >> n;
  string a;
  vector<int> cnt(4);
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "AC")
      a.at(0)++;
    else if (a == "WA")
      a.at(1)++;
    else if (a == "TLE")
      a.at(2)++;
    else
      a.at(3)++;
  }

  cout << "AC x" << ' ' << a.at(0) << endl;
  cout << "WA x" << ' ' << a.at(1) << endl;
  cout << "TLE x" << ' ' << a.at(2) << endl;
  cout << "RE x" << ' ' << a.at(3) << endl;

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <map>

int main() {
  int n;
  std::cin >> n;
  std::map<std::string, int> mp;

  for (int i = 0; i < n; ++i) {
    std::string s;
    std::cin >> s;
    mp[s] += 1;
  }

  std::cout << "AC x " << mp["AC"] << '\\n';
  std::cout << "WA x " << mp["WA"] << '\\n';
  std::cout << "TLE x " << mp["TLE"] << '\\n';
  std::cout << "RE x " << mp["RE"] << '\\n';

  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
#include <map>

int main() {
  int n;
  std::cin >> n;
  std::map<std::string, int> mp;

  for (int i = 0; i < n; ++i) {
    std::string s;
    std::cin >> s;
    mp[s] += 1;
  }

  std::cout << "AC x " + mp["AC"] << '\\n';
  std::cout << "WA x " + mp["WA"] << '\\n';
  std::cout << "TLE x " + mp["TLE"] << '\\n';
  std::cout << "RE x " + mp["RE"] << '\\n';

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int N;
  string S;
  cin >> N;

  map<string, int> mp;

  rep(i, N) {
    cin >> S;
    mp[S]++;
  }
  cout << "AC x " << mp["AC"] << endl;
  cout << "WA x " << mp["WA"] << endl;
  cout << "TLE x " << mp["TLE"] << endl;
  cout << "RE x " << mp["RE"] << endl;
  return 0;
}

Error: WA

Fixed submission:

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

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

  map<string, int> mp;

  rep(i, N) {
    string S;
    cin >> S;
    mp[S]++;
  }
  cout << "AC x " + mp["AC"] << endl;
  cout << "WA x " + mp["WA"] << endl;
  cout << "TLE x " + mp["TLE"] << endl;
  cout << "RE x " + mp["RE"] << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int N;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  cin >> N;

  while (N--) {
    string s;
    cin >> s;
    if (s == "AC") {
      AC++;
    } else if (s == "WA") {
      WA++;
    } else if (s == "TLE") {
      TLE++;
    } else if (s == "RE") {
      RE++;
    }
  }

  cout << "AC x " << AC << "\\n";
  cout << "WA x " << WA << "\\n";
  cout << "TLE x " << TLE << "\\n";
  cout << "RE x " << RE;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {
  int N;
  cin >> N;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  while (N--) {
    string s;
    cin >> s;
    if (s == "AC") {
      AC++;
    } else if (s == "WA") {
      WA++;
    } else if (s == "TLE") {
      TLE++;
    } else if (s == "RE") {
      RE++;
    }
  }

  cout << "AC x " + AC << "\\n";
  cout << "WA x " + WA << "\\n";
  cout << "TLE x " + TLE << "\\n";
  cout << "RE x " + RE;

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<int> a(5, 0);
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      a.at(0)++;
    }
    if (s == "WA") {
      a.at(1)++;
    }
    if (s == "TLE") {
      a.at(2)++;
    }
    if (s == "RE") {
      a.at(3)++;
    }
  }
  cout << "AC x " << a.at(0) << endl;
  cout << "WA x " << a.at(1) << endl;
  cout << "TLE x " << a.at(2) << endl;
  cout << "RE x " << a.at(3) << endl;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<string> s(n);
  vector<int> a(5, 0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
    if (s.at(i) == "AC") {
      a.at(0)++;
    }
    if (s.at(i) == "WA") {
      a.at(1)++;
    }
    if (s.at(i) == "TLE") {
      a.at(2)++;
    }
    if (s.at(i) == "RE") {
      a.at(3)++;
    }
  }
  cout << "AC x " << a.at(0) << endl;
  cout << "WE x " << a.at(1) << endl;
  cout << "TLE x " << a.at(2) << endl;
  cout << "RE x " << a.at(3) << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int n;
  int ac, wa, tle, re;
  ac = wa = tle = re = 0;
  cin >> n;
  string s[100000];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC") {
      ac++;
    } else if (s[i] == "WA") {
      wa++;
    } else if (s[i] == "TLE") {
      tle++;
    } else if (s[i] == "RE") {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}

Error: 0

Fixed submission:

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

int main() {
  int n;
  int ac, wa, tle, re;
  ac = wa = tle = re = 0;
  cin >> n;
  string s[10000];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC") {
      ac++;
    } else if (s[i] == "WA") {
      wa++;
    } else if (s[i] == "TLE") {
      tle++;
    } else if (s[i] == "RE") {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, a = 0, w = 0, t = 0, r = 0;
  scanf("%d", &n);
  char s[4];
  vector<string> vec(n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    vec[i] = s;
  }
  for (int i = 0; i < n; i++) {
    if (vec[i] == "AC") {
      a++;
    } else if (vec[i] == "WA") {
      w++;
    } else if (vec[i] == "TLE") {
      t++;
    } else if (vec[i] == "RE") {
      r++;
    }
  }
  printf("AC x %d\\n", a);
  printf("WA x %d\\n", w);
  printf("TLE x %d\\n", t);
  printf("RE x %d\\n", r);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, a = 0, w = 0, t = 0, r = 0, num;
  scanf("%d", &n);
  string s;
  vector<string> vec(n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    vec[i] = s;
  }
  for (int i = 0; i < n; i++) {
    if (vec[i] == "AC") {
      a++;
    } else if (vec[i] == "WA") {
      w++;
    } else if (vec[i] == "TLE") {
      t++;
    } else if (vec[i] == "RE") {
      r++;
    }
  }
  printf("AC x %d\\n", a);
  printf("WA x %d\\n", w);
  printf("TLE x %d\\n", t);
  printf("RE x %d\\n", r);

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
using namespace std;
int main() {
  int n;
  int f = 0, g = 0, h = 0, i = 0;
  string kase[100000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> kase[i];
  }
  for (int u = 0; u < n; u++) {
    if (kase[u] == "AC") {
      f = f + 1;
    } else if (kase[u] == "WA") {
      g = g + 1;
    } else if (kase[u] == "TLE") {
      h = h + 1;
    } else if (kase[u] == "RE") {
      i = i + 1;
    }
  }
  cout << "AC x"
          " "
       << f << endl;
  cout << "WA x"
          " "
       << g << endl;
  cout << "TLE x"
          " "
       << h << endl;
  cout << "RE x"
          " "
       << i << endl;

  return 0;
}


Error: 0

Fixed submission:

#include <iostream>
#include <string>
using namespace std;
int main() {
  int n;
  int f = 0, g = 0, h = 0, i = 0;
  string kase[10 ^ 5];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> kase[i];
  }
  for (int u = 0; u < n; u++) {
    if (kase[u] == "AC") {
      f = f + 1;
    } else if (kase[u] == "WA") {
      g = g + 1;
    } else if (kase[u] == "TLE") {
      h = h + 1;
    } else if (kase[u] == "RE") {
      i = i + 1;
    }
  }
  cout << "AC x"
          " "
       << f << endl;
  cout << "WA x"
          " "
       << g << endl;
  cout << "TLE x"
          " "
       << h << endl;
  cout << "RE x"
          " "
       << i << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int counter[4];
string answer[4] = {"AC", "WA", "TLE", "RE"};

int main() {
  string s;

  int n = 0;
  cin >> n;

  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (s.compare(answer[0]) == 0)
      counter[0]++;
    else if (s.compare(answer[1]) == 0)
      counter[1]++;
    else if (s.compare(answer[2]) == 0)
      counter[2]++;
    else
      counter[3]++;
  }

  for (int i = 0; i < 4; ++i) {
    cout << answer[i] << " x " << counter[i] << endl;
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int c4 = 0;
  // string AC= , WA=0 , TLE=0 ,RE=0 ;
  int n;
  cin >> n;

  string arr[10];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int j = 0; j < n; j++) {
    if (arr[j] == "AC")
      c1 = c1 + 1;
    if (arr[j] == "WA")
      c2 = c2 + 1;
    if (arr[j] == "TLE")
      c3 = c3 + 1;
    if (arr[j] == "RE")
      c4 = c4 + 1;
  }
  cout << "AC X " << c1 << endl;
  cout << "WA X " << c2 << endl;
  cout << "TLE x " << c3 << endl;
  cout << "RE X " << c4 << endl;

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error


#include <bits/stdc++.h>
using namespace std;
#include <vector>
int main() {
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  int n;
  cin >> n;
  string s;
  while (n--) {
    cin >> s;
    if (s == "AC") {
      AC++;
    }
    if (s == "WA") {
      WA++;
    }
    if (s == "TLE") {
      TLE++;
    }
    if (s == "RE") {
      RE++;
    }
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main()

{

  int N, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;

  string array[100];

  cin >> N;
  if (N >= 1 && N <= 10 ^ 5) {

    for (int i = 0; i < N; i++)

    {

      cin >> array[i];

      if (array[i] == "AC")

        AC_count++;

      else if (array[i] == "WA")

        WA_count++;

      else if (array[i] == "TLE")

        TLE_count++;

      else if (array[i] == "RE")

        RE_count++;
    }
  }

  cout << "AC X " << AC_count << endl
       << "WA X " << WA_count << endl
       << "TLE X " << TLE_count << endl
       << "RE X " << RE_count << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <vector>
using namespace std;
void creatVec(vector<string> &vec, size_t size, size_t &AC, size_t &WA,
              size_t &TLE, size_t &RE);
void check(const string &s, size_t &AC, size_t &WA, size_t &TLE, size_t &RE);
void printer(const string &s, size_t n);
int main() {
  size_t n{}, countAC{}, countWA{}, countTLE{}, countRE{};
  cin >> n;
  vector<string> words{};
  creatVec(words, n, countAC, countWA, countTLE, countRE);
  printer("AC", countAC);
  printer("WA", countWA);
  printer("TLE", countTLE);
  printer("RE", countRE);
  return 0;
}
void creatVec(vector<string> &vec, size_t size, size_t &AC, size_t &WA,
              size_t &TLE, size_t &RE) {
  for (size_t i{}; i < size; i++) {
    string in{};
    cin >> in;
    check(in, AC, WA, TLE, RE);
    vec.push_back(in);
  }
}
void check(const string &s, size_t &AC, size_t &WA, size_t &TLE, size_t &RE) {
  if (s == "AC")
    AC++;
  else if (s == "WA")
    WA++;
  else if (s == "TLE")
    TLE++;
  else if (s == "RE")
    RE++;
}
void printer(const string &s, size_t n) { cout << s << " x " << n << endl; }

Error: WA

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int c4 = 0;
  int n;
  cin >> n;

  string arr[10];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int j = 0; j < n; j++) {
    if (arr[j] == "AC")
      c1 = c1 + 1;
    if (arr[j] == "WA")
      c2 = c2 + 1;
    if (arr[j] == "TLE")
      c3 = c3 + 1;
    if (arr[j] == "RE")
      c4 = c4 + 1;
  }
  cout << "AC X " << c1 << endl;
  cout << "WA X " << c2 << endl;
  cout << "TLE x " << c3 << endl;
  cout << "RE X " << c4 << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

const int MOD = 1000000007;
const int MAX = 2147483647;
const double PI = 3.14159265358979323846;

int main() {
  int n;
  string a;
  int s[4];
  cin >> n;
  for (int i = 0; i < 4; i++) {
    s[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "AC")
      s[0]++;
    if (a == "WA")
      s[1]++;
    if (a == "TLE")
      s[2]++;
    if (a == "RE")
      s[3]++;
  }

  cout << "AC x " << s[0] << endl;
  cout << "WA x " << s[1] << endl;
  cout << "TLE x " << s[2] << endl;
  cout << "RE x " << s[3] << endl;
}


Error: -11

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

const int MOD = 1000000007;
const int MAX = 2147483647;
const double PI = 3.14159265358979323846;

int main() {
  int n;
  string a;
  int s[4];
  cin >> n;
  for (int i = 0; i < n; i++) {
    s[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "AC")
      s[0]++;
    if (a == "WA")
      s[1]++;
    if (a == "TLE")
      s[2]++;
    if (a == "RE")
      s[3]++;
  }

  cout << "AC x " << s[0] << endl;
  cout << "WA x " << s[1] << endl;
  cout << "TLE x " << s[2] << endl;
  cout << "RE x " << s[3] << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
  ll n;
  cin >> n;
  map<string, ll> mp;
  for (ll i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }

  cout << "AC"
       << " "
       << "x"
       << " " << mp["AC"] << "\\n";
  cout << "WA"
       << " "
       << "x"
       << " " << mp["WA"] << "\\n";
  cout << "TLE"
       << " "
       << "x"
       << " " << mp["TLE"] << "\\n";
  cout << "RE"
       << " "
       << "x"
       << " " << mp["RE"] << "\\n";

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
#ifndef ONLNE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  ll n;
  cin >> n;
  map<string, ll> mp;
  for (ll i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }

  cout << "AC"
       << " "
       << "X"
       << " " << mp["AC"] << "\\n";
  cout << "WA"
       << " "
       << "X"
       << " " << mp["WA"] << "\\n";
  cout << "TLE"
       << " "
       << "X"
       << " " << mp["TLE"] << "\\n";
  cout << "RE"
       << " "
       << "X"
       << " " << mp["RE"] << "\\n";

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
typedef long long ll;
using namespace std;

int main() {
  int N;
  cin >> N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  string s[N];
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < N; i++) {
    if (s[i] == "AC")
      ac++;
    if (s[i] == "WA")
      wa++;
    if (s[i] == "TLE")
      tle++;
    if (s[i] == "RE")
      re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}

Error: WA

Fixed submission:

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
typedef long long ll;
using namespace std;

int main() {
  int N;
  cin >> N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  string s[N];
  for (int i = 0; i < N; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < N; i++) {
    if (s[i] == "AC")
      ac++;
    if (s[i] == "WA")
      wa++;
    if (s[i] == "TLE")
      tle++;
    if (s[i] == "RE")
      re++;
  }
  cout << "AC x " + ac << endl;
  cout << "WA x " + wa << endl;
  cout << "TLE x " + tle << endl;
  cout << "RE x " + re << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;

#define REP(a, b, c) for (ll a = b; a < (c); a++)
#define PER(a, b, c) for (ll a = b; a >= (c); a--)

ll ii() {
  ll x;
  cin >> x;
  return x;
}
string is() {
  string x;
  cin >> x;
  return x;
}
ld id() {
  ld x;
  cin >> x;
  return x;
}
void oi(ll x) { cout << x; }
void od(ld x) { cout << fixed << setprecision(10) << x; }
void os(string x) { cout << x; }
void oe() { cout << endl; }
void oie(ll x) {
  oi(x);
  oe();
}
void ode(ld x) {
  od(x);
  oe();
}
void ose(string x) {
  os(x);
  oe();
}

ll mod = 1000000007;

int main() {
  vector<string> ss = {"AC", "WA", "TLE", "RE"};
  vector<ll> sm(4, 0);
  ll N = ii();
  REP(i, 0, N) {
    string s = is();
    REP(i, 0, 4) {
      if (ss[i] == s) {
        sm[i]++;
      }
    }
  }
  REP(i, 0, 4) { cout << ss[i] << " x " << sm[i] << endl; }
  return 0;
}

Error: -11

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;

#define REP(a, b, c) for (ll a = b; a < (c); a++)
#define PER(a, b, c) for (ll a = b; a >= (c); a--)

ll ii() {
  ll x;
  cin >> x;
  return x;
}
string is() {
  string x;
  cin >> x;
  return x;
}
ld id() {
  ld x;
  cin >> x;
  return x;
}
void oi(ll x) { cout << x; }
void od(ld x) { cout << fixed << setprecision(10) << x; }
void os(string x) { cout << x; }
void oe() { cout << endl; }
void oie(ll x) {
  oi(x);
  oe();
}
void ode(ld x) {
  od(x);
  oe();
}
void ose(string x) {
  os(x);
  oe();
}

ll mod = 1000000007;

int main() {
  vector<string> ss = {"AC", "WA", "TLE", "RE"};
  vector<ll> sm(4, 0);
  ll N = ii();
  REP(i, 0, N) {
    string s = is();
    REP(i, 0, 4) {
      if (ss[i] == s) {
        sm[i]++;
      }
    }
  }
  REP(i, 0, N) { cout << ss[i] << " x " << sm[i] << endl; }
  return 0;
}