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

#include <bits/stdc++.h>

using namespace std;

void fast();

/*
 *
 * Watch out! Another Buggy Code From Muhammad_Mamdouh, Happy Coding;
 *
 */

int main() {
  fast();
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;

  while (n--) {
    string s;
    cin >> s;

    if (s == "AC")
      ++a;
    if (s == "WA")
      ++b;
    if (s == "TLE")
      ++c;
    if (s == "RE")
      ++d;
  }

  cout << "AC"
       << " x " << a << '\\n';
  cout << "WA"
       << " x " << b << '\\n';
  cout << "TLE"
       << " x " << c << '\\n';
  cout << "RE"
       << " x " << d << '\\n';

  return 0;
}

void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

Error: WA

Fixed submission:

#include <iostream>

using namespace std;
int main() {
  int n, m = 0, e = 0, b = 0, d = 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 {
      d++;
    }
  }
  cout << "AC x" << m << endl;
  cout << "WA x" << b << endl;
  cout << "TLE x" << e << endl;
  cout << "RE x" << d << endl;

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

#include <cstdio>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n, w, a, t, r, i;
  t = r = a = w = 0;
  cin >> n;
  char s[n][4];
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
    if (s[i][0] == 'A') {
      a++;
    } else if (s[i][0] == 'W') {
      w++;
    } else if (s[i][0] == 'T') {
      t++;
    } else {
      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);
}

Error: 0

Fixed submission:

#include <cstdio>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n, w, a, t, r, i;
  t = r = a = w = 0;
  cin >> n;
  char s[10000][4];
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
    if (s[i][0] == 'A') {
      a++;
    } else if (s[i][0] == 'W') {
      w++;
    } else if (s[i][0] == 'T') {
      t++;
    } else {
      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);
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

/*
 * main.cpp
 *
 *  Created on: ??‏/??‏/????
 *      Author: Israa
 */

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

unordered_map<string, int> mp;
string verdicts[5] = {"AC", "WA", "TLE", "RE"}, s;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  while (n--) {
    cin >> s;
    mp[s]++;
  }
  for (int i = 0; i < 4; i++) {
    cout << verdicts[i] << " x " << mp[verdicts[i]] << "\\n";
  }
  return 0;
}

Error: 0

Fixed submission:

#include <iostream>
#include <string>

using namespace std;

int main() {
  int arr_size, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;
  string array[10], in;
  cin >> arr_size;
  for (int i = 0; i < arr_size; i++)
    cin >> array[i];
  for (int i = 0; i < arr_size; 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>

using namespace std;

int main() {
  int number, AC = 0, WA = 0, TLE = 0, RE = 0;
  string temp;
  cin >> number;
  for (int i = 0; i < number; ++i) {
    cin >> temp;
    if (temp == "AC")
      ++AC;
    else if (temp == "WA")
      ++WA;
    else if (temp == "TLE")
      ++TLE;
    else if (temp == "RE")
      ++RE;
  }
  printf("AC x %d\\n", AC);
  printf("WA x %d\\n", WA);
  printf("TLE x %d\\n", TLE);
  printf("RE x %d\\n", RE);
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
#include <string>
using namespace std;
int main() {
  string arr[10000];
  int n;
  cin >> n;
  int count1 = 0;
  int count2 = 0;
  int count3 = 0;
  int count4 = 0;

  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n; i++) {
    if (arr[i] == "AC") {
      count1++;
    } else if (arr[i] == "WA") {
      count2++;
    } else if (arr[i] == "TLE") {
      count3++;
    } else if (arr[i] == "RE") {
      count4++;
    }
  }
  if (count1 != 0) {
    cout << "AC"
         << " "
         << "*"
         << " " << count1 << endl;
  } else if (count1 == 0) {
    cout << "AC"
         << " "
         << "*"
         << " " << count1 << endl;
  }
  if (count2 != 0) {
    cout << "WA"
         << " "
         << "*"
         << " " << count2 << endl;
  } else if (count2 == 0) {
    cout << "WA"
         << " "
         << "*"
         << " " << count2 << endl;
  }
  if (count3 != 0) {
    cout << "TLE"
         << " "
         << "*"
         << " " << count3 << endl;
  } else if (count3 == 0) {
    cout << "TLE"
         << " "
         << "*"
         << " " << count3 << endl;
  }
  if (count4 != 0) {
    cout << "RE"
         << " "
         << "*"
         << " " << count4 << endl;
  } else if (count4 == 0) {
    cout << "RE"
         << " "
         << "*"
         << " " << count4 << endl;
  }
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

// 4

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

int main() {
  int a, i = 0;

  scanf("%d", &a);

  char status[3];
  int ac = 0, wa = 0, tle = 0, re = 0;

  while (i < a) {
    i++;
    scanf("%s", status);
    getchar();
    if (!strcmp("AC", status)) {
      ac++;
    } else if (!strcmp("WA", status)) {
      wa++;
    } else if (!strcmp("TLE", status)) {
      tle++;
    } else if (!strcmp("RE", status)) {
      re++;
    }
  }

  printf("AC x %d\\n", ac);
  printf("WA x %d\\n", wa);
  printf("TLE x %d\\n", tle);
  printf("RE x %d\\n", re);

  return 0;
}

Error: 0

Fixed submission:

#include <stdio.h>
int main() {
  int n;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  char kata[12];

  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%s", &kata[i]);
    for (int i = 0; i < n; i++) {

      if (kata[i] == 'A' && kata[i + 1] == 'C') {
        AC++;
        continue;
      } else if (kata[i] == 'W' && kata[i + 1] == 'A') {
        WA++;
        continue;
      } else if (kata[i] == 'T' && kata[i + 1] == 'L' && kata[i + 2] == 'E') {
        TLE++;
        continue;
      } else if (kata[i] == 'R' && kata[i + 1] == 'E') {
        RE++;
        continue;
      }
    }
  }
  printf("AC x %d\\n", AC);
  printf("WA x %d\\n", WA);
  printf("TLE x %d\\n", TLE);
  printf("RE x %d\\n", RE);

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

#include <stdio.h>
#include <string.h>
int main() {
  int n, o;
  char string[255];
  int character[6] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &string);
    if (o = strcmp(string, "AC") == 0) {
      ++character[1];
    }
    if (o = strcmp(string, "WA") == 0) {
      ++character[2];
    }
    if (o = strcmp(string, "TLE") == 0) {
      ++character[3];
    }
    if (o = strcmp(string, "RE") == 0) {
      ++character[4];
    }
  }
  printf("AC x %d\\n", character[1]);
  printf("WA x %d\\n", character[2]);
  printf("TLE x %d\\n", character[3]);
  printf("RE x %d\\n", character[4]);
  return 0;
}


Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  // N test cases
  // each case, theres a string for the verdict of it
  // find the values of AC, WA, TLE, and RE
  // 1<N<1e5
  int n;
  scanf("%d", &n);

  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;

  for (int i = 0; i < n; i++) {
    char str[5];
    scanf("%s", str[i]);
    switch (str[0]) { // biar dia bacanya chara pertama aja
    case 'A':         // switch cmn bisa 1 chara ya casenya
      AC++;
      break;
    case 'W':
      WA++;
      break;
    case 'T':
      TLE++;
      break;
    case 'R':
      RE++;
      break;
    }
  }
  printf("AC x %d\\n", AC);
  printf("WA x %d\\n", WA);
  printf("TLE x %d\\n", TLE);
  printf("RE x %d\\n", RE);

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

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define eb emplace_back
const long long MOD = 1e9 + 7;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REP(i, k, n) for (int(i) = (k); (i) <= (n); (i)++)
#define REPR(i, k, n) for (int(i) = (k); (i) >= (n); (i)--)
#define watch(x) cout << (#x) << " = " << (x) << endl
#define t(x)                                                                   \\
  int x;                                                                       \\
  cin >> x;                                                                    \\
  while (x--)

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  /*---- continue Coding ;----*/

  int n;
  cin >> n;
  string a[n];
  int b[4] = {0};
  rep(i, n) cin >> a[i];
  rep(i, n) {
    if (a[i] == "AC") {
      b[0]++;
    } else if (a[i] == "WA") {
      b[1]++;
    } else if (a[i] == "TLE") {
      b[2]++;
    } else if (a[i] == "RE") {
      b[3]++;
    }
  }
  cout << "AC x " << b[0] << "\\n";
  cout << "WA x " << b[1] << "\\n";
  cout << "TLE x " << b[2] << "\\n";
  cout << "RE x " << b[3] << "\\n";

  /*---- break ;----*/

  cerr << "Execution time: " << (float)clock() / CLOCKS_PER_SEC << " secs"
       << endl;
  return 0;
}

Error: 0

Fixed submission:

#include <iostream>
#include <string>
using namespace std;
int main() {
  int n, a = 0, w = 0, t = 0, r = 0;
  string *ar = new string[n];
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> ar[i];
  for (int i = 0; i < n; i++) {
    if (ar[i] == "AC") {
      a++;
    } else if (ar[i] == "WA") {
      w++;
    } else if (ar[i] == "TLE") {
      t++;
    } else if (ar[i] == "RE") {
      r++;
    }
  }
  cout << "AC"
       << " "
       << "x"
       << " " << a << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << w << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << t << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << r << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include "bits/stdc++.h"
using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REP(n) for (int i = 0; i < int(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)

int main() {
  int num, a, b, c, d;
  a = b = c = d = 0;
  string s;
  cin >> num;

  REP(num) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}


Error: -11

Fixed submission:

#include "bits/stdc++.h"
using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)

int main() {
  int num, a, b, c, d = 0;
  string s;
  cin >> num;

  REP(l, num - 1) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC x" + a << endl;
  cout << "WA x" + b << endl;
  cout << "TLE x" + c << endl;
  cout << "RE x" + d << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int countA = 0, countW = 0, countT = 0, countR = 0;
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == "AC")
      countA++;
    else if (s[i] == "WA")
      countW++;
    else if (s[i] == "TLE")
      countT++;
    else if (s[i] == "RE")
      countR++;
  }
  cout << "AC x " << countA << "\\n";
  cout << "WA x " << countW << "\\n";
  cout << "TLE x " << countT << "\\n";
  cout << "RE x " << countR << "\\n";
  return 0;
}

Error: 0

Fixed submission:

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

int main() {
  int num, accounter = 0, wacounter = 0, tlecounter = 0, recounter = 0;
  cin >> num;
  string arr[100];
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
    if (arr[i] == "AC")
      accounter++;
    else if (arr[i] == "WA")
      wacounter++;
    else if (arr[i] == "TLE")
      tlecounter++;
    else if (arr[i] == "RE")
      recounter++;
  }
  cout << "AC"
       << " "
       << "x " << accounter << endl;
  cout << "WA"
       << " "
       << "x " << wacounter << endl;
  cout << "TLE"
       << " "
       << "x " << tlecounter << endl;
  cout << "RE"
       << " "
       << "x " << recounter << endl;

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

#include <iostream>

int main(void) {
  int n;
  std::cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  std::string str;
  for (int i = 0; i < n; i++) {
    std::cin >> str;
    if (str == "AC") {
      a++;
    } else if (str == "WA") {
      b++;
    } else if (str == "TLE") {
      c++;
    } else {
      d++;
    }
  }
  std::cout << "AC x " << a << std::endl;
  std::cout << "WA x " << b << std::endl;
  std::cout << "TLE x " << c << std::endl;
  std::cout << "RE x " << d << std::endl;

  return 0;
}

Error: WA

Fixed submission:

#include <iostream>

int main(void) {
  int n;
  std::cin >> n;
  int r[4];
  std::string a[n];
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
    if (a[i] == "AC") {
      r[0]++;
    } else if (a[i] == "WA") {
      r[1]++;
    } else if (a[i] == "TLE") {
      r[2]++;
    } else {
      r[3]++;
    }
  }
  std::cout << "AC x " << a[0] << std::endl;
  std::cout << "WA x " << a[1] << std::endl;
  std::cout << "TLE x " << a[2] << std::endl;
  std::cout << "RE x " << a[3] << std::endl;

  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(4, 0);
  while (n--) {
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "WA")
      a[1]++;
    else if (s == "TLE")
      a[2]++;
    else
      a[3]++;
  }
  cout << "AC x " << a[0] << '\\n';
  cout << "WA x " << a[1] << '\\n';
  cout << "TLE x " << a[2] << '\\n';
  cout << "RE x " << a[3] << '\\n';
  return 0;
}

Error: 1

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<int> a(4, 0);
  while (n--) {
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "WA")
      a[1]++;
    else if (s == "TLE")
      a[2]++;
    else
      a[3]++;
  }
  cout << "AC x " << a[0] << '\\n';
  cout << "WA x " << a[1] << '\\n';
  cout << "TLE x " << a[2] << '\\n';
  cout << "RE x " << a[3] << '\\n';
  return 1;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

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

  char S[N][4];
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  vector<int> cnt(4);
  cnt.at(0) = 0;
  cnt.at(1) = 0;
  cnt.at(2) = 0;
  cnt.at(3) = 0;

  int j = 0;
  while (S[j][0] != '\\0') {
    if (S[j][0] == 'A' && S[j][1] == 'C') {
      cnt.at(0)++;
    }
    if (S[j][0] == 'W' && S[j][1] == 'A') {
      cnt.at(1)++;
    }
    if (S[j][0] == 'T' && S[j][1] == 'L' && S[j][2] == 'E') {
      cnt.at(2)++;
    }
    if (S[j][0] == 'R' && S[j][1] == 'E') {
      cnt.at(3)++;
    }
    j++;
  }

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

Error: 0

Fixed submission:

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

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

  vector<char> S(N * 3, 0);
  for (int i = 0; i < N * 3; i++) {
    cin >> S.at(i);
  }
  vector<int> cnt(4);
  cnt.at(0) = 0;
  cnt.at(1) = 0;
  cnt.at(2) = 0;
  cnt.at(3) = 0;

  int i = 0;
  while (S.at(i) != '\\0') {
    if (S.at(i) == 'A' && S.at(i + 1) == 'C') {
      cnt.at(0)++;
      i += 2;
    } else if (S.at(i) == 'W' && S.at(i + 1) == 'A') {
      cnt.at(1)++;
      i += 2;
    } else if (S.at(i) == 'T' && S.at(i + 1) == 'L' && S.at(i + 2) == 'E') {
      cnt.at(2)++;
      i += 3;
    } else {
      cnt.at(3)++;
      i += 2;
    }
  }

  cout << "AC x " << cnt.at(0) << endl;
  cout << "WA x " << cnt.at(1) << endl;
  cout << "TLE x " << cnt.at(2) << endl;
  cout << "RE x " << cnt.at(3) << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define Vsort(a) sort(a.bigin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
using ll = long long;

int main() {
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  vector<string> s(n);
  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 {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define Vsort(a) sort(a.bigin(), a.end())
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
using ll = long long;

int main() {
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  vector<string> s(n);
  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 {
      re++;
    }
  }
  cout << "AC × " + ac << endl;
  cout << "WA × " + wa << endl;
  cout << "TLE × " + tle << endl;
  cout << "RE × " + re << endl;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long
#define db double
using namespace std;
map<string, int> mp;
int n;
string s;
int main() {
  cin >> n;
  while (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 ll long long
#define db double
using namespace std;
map<string, int> mp;
int n;
string s;
int main() {
  cin >> n;
  while (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;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

  vector<string> vec(a);
  vector<int> ans(4);
  for (int i = 0; i < a; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < a; i++) {
    if (vec.at(i) == "AC") {
      ans.at(0) += 1;
    } else if (vec.at(i) == "WA") {
      ans.at(1) += 1;
    } else if (vec.at(i) == "TLE") {
      ans.at(2) += 1;
    } else if (vec.at(i) == "RE") {
      ans.at(3) += 1;
    }
  }
  cout << "AC x " << ans.at(0) << endl;
  cout << "WA x " << ans.at(1) << endl;
  cout << "TLE x " << ans.at(2) << endl;
  cout << "RE x " << ans.at(3) << endl;
}


Error: WA

Fixed submission:

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

  vector<string> vec(a);
  vector<int> ans(4);
  for (int i = 0; i < a; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < 4; i++) {
    if (vec.at(i) == "AC") {
      ans.at(0) += 1;
    } else if (vec.at(i) == "WA") {
      ans.at(1) += 1;
    } else if (vec.at(i) == "TLE") {
      ans.at(2) += 1;
    } else if (vec.at(i) == "RE") {
      ans.at(3) += 1;
    }
  }
  cout << "AC x " << ans.at(0) << endl;
  cout << "WA x " << ans.at(1) << endl;
  cout << "TLE x " << ans.at(2) << endl;
  cout << "RE x " << ans.at(3) << endl;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < N; i++)
    cin >> S[i];
  for (int i = 0; i < N; 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;
  return 0;
}

Error: 0

Fixed submission:

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

int main() {
  int N;
  vector<string> S(N);
  cin >> N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < N; i++)
    cin >> S[i];
  for (int i = 0; i < N; 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;
  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Runtime Error

/*
QUESTION    :

RULE        :

INPUT       :

OUTPUT      :
*/
/*
    int     :10^9
long long   :10^19
*/
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < (n); ++i)
#define repeq(i, a, n) for (int i = a; i <= (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  string s;
  vector<int> c(4);
  rep(i, 0, n) {
    cin >> s;
    if (s == "AC") {
      c.at(0)++;
    }
    if (s == "WA") {
      c.at(1)++;
    }
    if (s == "TLE") {
      c.at(2)++;
    }
    if (s == "RE") {
      c.at(3)++;
    }
  }
  cout << "AC x " << c.at(0) << endl;
  cout << "WA x " << c.at(1) << endl;
  cout << "TLE x " << c.at(2) << endl;
  cout << "RE x " << c.at(3) << endl;

  return 0;
}

Error: 0

Fixed submission:

/*
QUESTION    :

RULE        :

INPUT       :

OUTPUT      :
*/
/*
    int     :10^9
long long   :10^19
*/
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < (n); ++i)
#define repeq(i, a, n) for (int i = a; i <= (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  string s;
  vector<int> c(n);
  rep(i, 0, n) {
    cin >> s;
    if (s == "AC") {
      c.at(0)++;
    }
    if (s == "WA") {
      c.at(1)++;
    }
    if (s == "TLE") {
      c.at(2)++;
    }
    if (s == "RE") {
      c.at(3)++;
    }
  }
  cout << "AC x " << c.at(0) << endl;
  cout << "WA x " << c.at(1) << endl;
  cout << "TLE x " << c.at(2) << endl;
  cout << "RE x " << c.at(3) << endl;

  return 0;
}
Problem p02613 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int n, AC = 0, WA = 0, TLE = 0, RE = 0;
  string S;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    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;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  int n;
  string S;
  cin >> n;
  for (int i = 0; i < n; n++) {
    cin >> S;
    if (S == "AC")
      c0++;
    if (S == "WA")
      c1++;
    if (S == "TLE")
      c2++;
    if (S == "RE")
      c3++;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
  return 0;
}