prithivMLmods/Coder-Stat huggingface dataset:
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include "bits/stdc++.h"
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);
using namespace std;

// ll gcd(ll a, ll b)
//{
//     if (a == 0)
//         return b;
//     else
//         return gcd(b % a, a);
// }

// ll modexp(ll x, ll y, ll p)
//{
//     ll res = 1;
//     x = x % p;
//     while (y > 0)
//     {
//         if (y & 1)
//             res = (res * x) % p;
//         y = y >> 1;
//         x = (x * x) % p;
//     }
//     return res;
// }

// ll sub_mod(ll a, ll b, ll m)
//{
//     if (a >= b)
//         return a - b;
//     else
//         return m - b + a;
// }

// ll add_mod(ll a, ll b)
// {
//    if (0 == b)
//        return a;

//    b = mod - b;
//    if (a >= b)
//        return a - b;
//    else
//        return mod - b + a;
// }

int main() {
  fastio;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ll k = 0, x = 0;
  cin >> k >> x;
  if (k * 500 >= x)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}


Fixed submission:
#include "bits/stdc++.h"
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);
using namespace std;

// ll gcd(ll a, ll b)
//{
//     if (a == 0)
//         return b;
//     else
//         return gcd(b % a, a);
// }

// ll modexp(ll x, ll y, ll p)
//{
//     ll res = 1;
//     x = x % p;
//     while (y > 0)
//     {
//         if (y & 1)
//             res = (res * x) % p;
//         y = y >> 1;
//         x = (x * x) % p;
//     }
//     return res;
// }

// ll sub_mod(ll a, ll b, ll m)
//{
//     if (a >= b)
//         return a - b;
//     else
//         return m - b + a;
// }

// ll add_mod(ll a, ll b)
// {
//    if (0 == b)
//        return a;

//    b = mod - b;
//    if (a >= b)
//        return a - b;
//    else
//        return mod - b + a;
// }

int main() {
  fastio;
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  // #endif
  ll k = 0, x = 0;
  cin >> k >> x;
  if (k * 500 >= x)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define endl '\n'
#define fastIO                                                                 \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define int long long int
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  return gcd(b, a % b);
}
int combination(int n, int k) {
  int spaceOptimize[k + 1];
  memset(spaceOptimize, 0, sizeof(spaceOptimize));
  spaceOptimize[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = min(i, k); j > 0; j--) {
      spaceOptimize[j] = spaceOptimize[j] + spaceOptimize[j - 1];
    }
  }
  return spaceOptimize[k];
}
signed main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  fastIO

      int n,
      k;
  cin >> n >> k;
  if (n * 500 >= k)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define endl '\n'
#define fastIO                                                                 \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define int long long int
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  return gcd(b, a % b);
}
int combination(int n, int k) {
  int spaceOptimize[k + 1];
  memset(spaceOptimize, 0, sizeof(spaceOptimize));
  spaceOptimize[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = min(i, k); j > 0; j--) {
      spaceOptimize[j] = spaceOptimize[j] + spaceOptimize[j - 1];
    }
  }
  return spaceOptimize[k];
}
signed main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt","r", stdin);
#endif
  fastIO

      int n,
      k;
  cin >> n >> k;
  if (n * 500 >= k)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

using namespace std;

void solve() { return; }

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

  int n, k;

  cin >> n >> k;

  cout << (n * 500 >= k ? "Yes" : "No") << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

using namespace std;

void solve() { return; }

int32_t main() {
  int n, k;

  cin >> n >> k;

  cout << (n * 500 >= k ? "Yes" : "No") << endl;

  return 0;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x, 0;
#define all(v) v.begin(), v.end()

#define naman                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;

ll mpow(ll base, ll exp) {
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1)
      result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

const ll INF = 1e18;
const double PI = 4 * atan(1);

void solve() {
  ll k, x;
  cin >> k >> x;
  if (500 * k >= x)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
}

int32_t main() {
  naman ll i = 0, j = 0;

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  // cout << fixed << setprecision(10);

  int t;
  t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
}

Fixed submission:
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x, 0;
#define all(v) v.begin(), v.end()

#define naman                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;

ll mpow(ll base, ll exp) {
  base %= mod;
  ll result = 1;
  while (exp > 0) {
    if (exp & 1)
      result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

const ll INF = 1e18;
const double PI = 4 * atan(1);

void solve() {
  ll k, x;
  cin >> k >> x;
  if (500 * k >= x)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
}

int32_t main() {
  naman ll i = 0, j = 0;
  /*
  #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
  #endif
  */
  // cout << fixed << setprecision(10);

  int t;
  t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cassert>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main() {
  int x, y;
  cin >> x >> y;
  return x * 500 >= y;
}

Fixed submission:
#include <algorithm>
#include <cassert>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main() {
  int x, y;
  cin >> x >> y;
  if (x * 500 >= y)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
// constexpr long long MOD = 998244353LL;
template <class T, class U> inline bool chmax(T &a, U b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class U> inline bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int k, x;
  cin >> k >> x;
  string ans = 0;

  if (k * 500 >= x)
    ans = "Yes";
  else
    ans = "No";

  cout << ans << ln;
  return 0;
}

Fixed submission:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
// constexpr long long MOD = 998244353LL;
template <class T, class U> inline bool chmax(T &a, U b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class U> inline bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int k, x;
  cin >> k >> x;
  string ans;

  if (k * 500 >= x)
    ans = "Yes";
  else
    ans = "No";

  cout << ans << ln;
  return 0;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000007
#define qmod 998244353
#define M 1000001
#define endl "\n"
#define all(a) (a).begin(), (a).end()
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; --i)
#define F first
#define S second
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;

int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  fast;
  int k, x;
  cin >> k >> x;
  cout << (k * 500 >= x ? "Yes" : "No");
  return 0;
}

// keep it simple stupid


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

#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000007
#define qmod 998244353
#define M 1000001
#define endl "\n"
#define all(a) (a).begin(), (a).end()
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; --i)
#define F first
#define S second
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;

int main() {

  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  // #endif

  fast;
  int k, x;
  cin >> k >> x;
  cout << (k * 500 >= x ? "Yes" : "No");
  return 0;
}

// keep it simple stupid
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  if (a * 500 >= b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

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

int main() {

  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  if (a * 500 >= b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02811 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int count = 0;
  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      count++;
  }
  cout << count << endl;
}


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

int main() {
  int K, X;
  cin >> K >> X;
  if (K * 500 >= X)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      ans++;
  }

  cout << ans << endl;

  return 0;
}

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int ans = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      ans++;
  }

  cout << ans << endl;

  return 0;
}
Problem p02812 (C++)

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

int main() {
  int N, count = 0;
  string S;
  cin >> N;
  cin >> S;

  rep(i, N) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


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

int main() {
  int N, count = 0;
  string S;
  cin >> N;
  cin >> S;

  // rep(i, N) { N-1かN番目に'A'があったらN+1かN+2番目まで操作を行ってしまう
  rep(i, N - 2) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main(void) {
  int count = 0;
  int N;
  string s;
  cin >> N >> s;

  for (int i = 0; i < N; i++) {
    if (s.at(i) == 'A') {
      if (i + 2 <= N) {
        if (s.at(i + 1) == 'B') {
          if (s.at(i + 2) == 'C') {
            count++;
          }
        }
      }
    }
  }
  cout << count << endl;
}

Fixed submission:
#include <iostream>
using namespace std;
int main(void) {
  int count = 0;
  int N;
  string s;
  cin >> N >> s;

  for (int i = 0; i < N; i++) {
    if (s.at(i) == 'A') {
      if (i + 2 <= N - 1) {
        if (s.at(i + 1) == 'B') {
          if (s.at(i + 2) == 'C') {
            count++;
          }
        }
      }
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
  int N;
  int count = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
  int N;
  int count = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  string objStr;
  int len, count = 0;
  cin >> len;
  getline(cin, objStr);
  for (int i = 0; i <= len - 3; i++) {
    if (objStr.substr(i, 3) == "ABC") {
      ++count;
      i = i + 2;
    }
  }
  cout << count << endl;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  string objStr;
  int len, count = 0;
  cin >> len;
  cin >> objStr;
  for (int i = 0; i <= len - 3; i++) {
    if (objStr.substr(i, 3) == "ABC") {
      ++count;
      i = i + 2;
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>
using namespace std;

int main() {
  string s;
  cin >> s;

  int sum = 0;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s.substr(i, 3) == "ABC") {
      sum++;
    }
  }
  cout << sum << endl;
}

Fixed submission:
#include <iostream>
#include <string>
using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int sum = 0;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s.substr(i, 3) == "ABC") {
      sum++;
    }
  }
  cout << sum << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
#define yn                                                                     \
  { puts("Yes"); }                                                             \
  else {                                                                       \
    puts("No");                                                                \
  }
#define MAX_N 200005

int main() {
  string s;
  cin >> s;

  int ans = 0;

  rep(i, s.size() - 2) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      ans++;
  }

  cout << ans << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
#define yn                                                                     \
  { puts("Yes"); }                                                             \
  else {                                                                       \
    puts("No");                                                                \
  }
#define MAX_N 200005

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int ans = 0;

  rep(i, s.size() - 2) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      ans++;
  }

  cout << ans << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  int n, count = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; ++i)
    cin >> s[i];
  for (int i = 0; i < n; ++i) {
    if (s.substr(i, 3) == "ABC")
      count++;
  }
  cout << count << endl;
}


Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int n, count = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; ++i)
    cin >> s[i];
  for (int i = 0; i < n - 2; ++i) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      count++;
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  char ch[n + 1];
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> ch[i];
  for (int i = 3; i <= n; i++) {
    if (ch[i] == 'C' && ch[i - 1] == 'B' && ch[i - 2] == 'A')
      ans++;
  }
  cout << ans;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 2; i < n; i++) {
    if (s[i] == 'C' && s[i - 1] == 'B' && s[i - 2] == 'A')
      ans++;
  }
  cout << ans;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include "bits/stdc++.h"
using namespace std;
int main() {
  string S;
  cin >> S;
  long ans = 0;
  for (int i = 0; i < S.size() - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      ans++;
  }
  cout << ans << endl;
}

Fixed submission:
#include "bits/stdc++.h"
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  long ans = 0;
  for (int i = 0; i < S.size() - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      ans++;
  }
  cout << ans << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>

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

  int result = 0;
  for (int i = 0; i != N - 2; i++) {
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') {
      result++;
      i = i + 2;
    }
  }

  std::cout << result << std::endl;

  return 0;
}

Fixed submission:
#include <iostream>
#include <string>

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

  int result = 0;
  for (int i = 0; i < N - 2; i++) {
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') {
      result++;
      i = i + 2;
    }
  }

  std::cout << result << std::endl;

  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  long n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B') {
        if (s.at(i + 2) == 'C') {
          ans++;
        }
      }
    }
  }
  cout << ans;
}

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

int main() {
  long n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 2; i < n; i++) {
    if (s.at(i) == 'C') {
      if (s.at(i - 1) == 'B') {
        if (s.at(i - 2) == 'A') {
          ans++;
        }
      }
    }
  }
  cout << ans;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int Y = 0;
  string S;
  cin >> N >> S;
  for (int X = 0; X < N; X++) {
    if (X + 2 <= N) {
      if (S.at(X) == 'A' && S.at(X + 1) == 'B' && S.at(X + 2) == 'C') {
        Y++;
      }
    }
  }
  cout << Y << endl;
}

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

int main() {
  int N;
  int Y = 0;
  string S;
  cin >> N >> S;
  for (int X = 0; X < N; X++) {
    if (X + 2 < N) {
      if (S.at(X) == 'A' && S.at(X + 1) == 'B' && S.at(X + 2) == 'C') {
        Y++;
      }
    }
  }
  cout << Y << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define p_q priority_queue
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int co = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B') {
        if (s.at(i + 2) == 'C') {
          co++;
        }
      }
    }
  }

  cout << co << endl;
}


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

#define ll long long
#define p_q priority_queue
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;

  int co = 0;
  for (int i = 0; i + 2 < n; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B') {
        if (s.at(i + 2) == 'C') {
          co++;
        }
      }
    }
  }

  cout << co << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int K;
  string S;
  cin >> K >> S;
  int res = 0;
  for (int i = 0; i < (K - 1); i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      res++;
    }
  }
  cout << res << endl;

  return 0;
}

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

int main() {
  int K;
  string S;
  cin >> K >> S;
  int res = 0;
  for (int i = 0; i < (K - 2); i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      res++;
    }
  }
  cout << res << endl;

  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

void solve() {
  int n;
  string s;
  cin >> s;

  int ans = 0;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s.substr(i, 3) == "ABC")
      ans++;
  }
  cout << ans;
}

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int t = 1;
  //    cin >> t;

  while (t--)
    solve();
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

void solve() {
  int n;
  cin >> n;

  string s;
  cin >> s;

  int ans = 0;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s.substr(i, 3) == "ABC")
      ans++;
  }
  cout << ans;
}

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int t = 1;
  //    cin >> t;

  while (t--)
    solve();
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG

/*
 // 深さ優先探索
vector<bool> seen;
int dfs(const Graph &G, ll v) {
    seen[v] = true; // v を訪問済にする
    int score = 0;

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー

        // 負荷さ優先探索中の処理



        dfs(G, next_v); // 再帰的に探索, 毎回mat渡してええの？
    }
    return score;
} */

/*
//桁数の計算
ll keta(ll num){
  ll ans= 0 ;
  ll rem;

  for (ll i = 4; i >= 0 ; i--){
    rem = pow(10,i);
    ans += (num / rem);
    num = num % rem;
  }
  return ans;
}
*/

int main() {
  ll N;
  string S;
  cin >> N >> S;
  ll ans = 0;
  for (ll i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      ans++;
  }

  cout << ans << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG

/*
 // 深さ優先探索
vector<bool> seen;
int dfs(const Graph &G, ll v) {
    seen[v] = true; // v を訪問済にする
    int score = 0;

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー

        // 負荷さ優先探索中の処理



        dfs(G, next_v); // 再帰的に探索, 毎回mat渡してええの？
    }
    return score;
} */

/*
//桁数の計算
ll keta(ll num){
  ll ans= 0 ;
  ll rem;

  for (ll i = 4; i >= 0 ; i--){
    rem = pow(10,i);
    ans += (num / rem);
    num = num % rem;
  }
  return ans;
}
*/

int main() {
  ll N;
  string S;
  cin >> N >> S;
  ll ans = 0;
  for (ll i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      ans++;
  }

  cout << ans << endl;

  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
}

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

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

  int cnt = 0;
  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
}
Problem p02812 (C++)

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

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

  int count = 0;
  rep(i, N) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }

  cout << count << endl;
}


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

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

  int count = 0;
  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }

  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  for (int i = 2; i < N; i++) {
    if (S.at(i - 2) == 'A' && S.at(i - 1) == 'B' && S.at(i) == 'C') {
      count++;
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      cnt++;
  }
  cout << cnt;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      cnt++;
  }
  cout << cnt;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  string s;
  int res = 0;
  cin >> n >> s;

  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      res++;
    }
  }

  cout << res << endl;
}

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

int main() {
  int n;
  string s;
  int res = 0;
  cin >> n >> s;

  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      res++;
    }
  }

  cout << res << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ROOP(i, N) for (int i = 0; i < N; i++)
#define RVROOP(i, N) for (int i = N; i >= 0; i--)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      ans++;
    }
  }
  cout << ans << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define ROOP(i, N) for (int i = 0; i < N; i++)
#define RVROOP(i, N) for (int i = N; i >= 0; i--)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  for (int i = 0; i <= N - 3; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      ans++;
    }
  }
  cout << ans << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int abc = 0;
  string S;
  cin >> N;
  cin >> S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      abc++;
    }
  }
  cout << abc << endl;
}

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

int main() {
  int N;
  int abc = 0;
  string S;
  cin >> N;
  cin >> S;
  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      abc++;
    }
  }
  cout << abc << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  int N;
  int count = 0;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A') {
      if (S.at(i + 1) == 'B') {
        if (S.at(i + 2) == 'C') {
          count++;
        }
      }
    }
  }
  cout << count << endl;
}

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

int main() {
  string S;
  int N;
  int count = 0;
  cin >> N >> S;
  for (int i = 0; i <= N - 3; i++) {
    if (S.at(i) == 'A') {
      if (S.at(i + 1) == 'B') {
        if (S.at(i + 2) == 'C') {
          count++;
        }
      }
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
        i += 2;
        ans++;
      }
    }
  }
  cout << ans << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < N - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      ans++;
    }
  }
  cout << ans << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;

  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B') {
        if (s.at(i + 2) == 'C') {
          count++;
        }
      }
    }
  }

  cout << count << endl;
}


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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;

  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A') {
      if (s.at(i + 1) == 'B') {
        if (s.at(i + 2) == 'C') {
          count++;
        }
      }
    }
  }

  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int n, x, y, arr[100001];
int pre[100001], dp[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      n++;
  }
  cout << n;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int n, x, y, arr[100001];
int pre[100001], dp[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> x;
  string s;
  cin >> s;
  for (int i = 0; i < s.size() - 2; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      n++;
  }
  cout << n;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;

typedef long long ll;

ll N;
string S;

int main() {
  cin >> N >> S;
  ll ans = 0;
  for (ll i = 0; i <= S.size() - 4; i++) {
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') {
      ans++;
    }
  }

  cout << ans << endl;
}

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

typedef long long ll;

ll N;
string S;

int main() {
  cin >> N >> S;
  ll ans = 0;
  for (ll i = 0; i <= S.size() - 3; i++) {
    // cout << i << endl;
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') {
      ans++;
    }
  }

  cout << ans << endl;
}
Problem p02812 (C++)

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

int main() {
  int n;

  string s;

  cin >> n >> s;

  int flag = 0;

  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      flag++;
  }

  cout << flag;
}

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

int main() {
  int n;

  string s;

  cin >> n >> s;

  int flag = 0;

  for (int i = 0; i <= n - 3; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      flag++;
  }

  cout << flag;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  string s;
  cin >> s;
  rep(i, n) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  string s;
  cin >> s;
  rep(i, n - 2) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, count;
  string S;
  cin >> N >> S;
  count = 0;

  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
}

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

int main() {
  int N, count;
  string S;
  cin >> N >> S;
  count = 0;

  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int i = 0;
  int count = 0;
  while (i < n) {
    if ((s.at(i) == 'A') && (s.at(i + 1) == 'B') && (s.at(i + 2) == 'C')) {
      count++;
      i++;
    } else {
      i++;
    }
  }
  cout << count << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int i = 0;
  int count = 0;
  while (i + 2 < n) {
    if ((s.at(i) == 'A') && (s.at(i + 1) == 'B') && (s.at(i + 2) == 'C')) {
      count++;
      i++;
    } else {
      i++;
    }
  }
  cout << count << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0, i = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
}

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0, i = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      cnt++;
    }
  }
  cout << cnt << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i < s.length() - 2; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      c++;
  }
  cout << c;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i < s.length() - 2; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      c++;
  }
  cout << c;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, cnt = 0, i = 0;
  string S;
  cin >> N >> S;

  while (N > i - 1) {
    if (S.at(i) == 'A') {
      if (S.at(i + 1) == 'B') {
        if (S.at(i + 2) == 'C') {
          cnt++;
          i += 2;
        }
      }
    }
    i++;
  }

  cout << cnt << endl;
}

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

int main() {
  int N, cnt = 0, i = 0;
  string S;
  cin >> N >> S;

  while (N - 2 > i) {
    if (S.at(i) == 'A') {
      if (S.at(i + 1) == 'B') {
        if (S.at(i + 2) == 'C') {
          cnt++;
          i += 2;
        }
      }
    }
    i++;
  }

  cout << cnt << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      num++;
  }
  cout << num << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      num++;
  }
  cout << num << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;
  int A = 0;
  for (int i = 0; i < N + 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      A++;
  }
  cout << A << endl;
}


Fixed submission:
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;
  int A = 0;
  for (int i = 0; i + 2 < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C')
      A++;
  }
  cout << A << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;

  int counter = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      counter++;
  }
  cout << counter << endl;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;

  int counter = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      counter++;
  }
  cout << counter << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

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

  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      cnt++;
      i += 2;
    }
  }
  cout << cnt << endl;
}


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

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

  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      cnt++;
      i += 2;
    }
    if (i == N - 3)
      break;
  }
  cout << cnt << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main() {

  ll n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s.at(i) == 'A' and s.at(i + 1) == 'B' and s.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main() {

  ll n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < s.length() - 2; i++) {
    if (s.at(i) == 'A' and s.at(i + 1) == 'B' and s.at(i + 2) == 'C') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int answer = 0;

  for (int i = 0; i < N - 1; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      answer++;
    }
  }

  cout << answer << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int answer = 0;

  for (int i = 0; i < N - 2; i++) {
    if (S.at(i) == 'A' && S.at(i + 1) == 'B' && S.at(i + 2) == 'C') {
      answer++;
    }
  }

  cout << answer << endl;
  return 0;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
  int n, cnt = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      cnt++;
  }
  cout << cnt << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
  int n, cnt = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i <= n - 3; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C')
      cnt++;
  }
  cout << cnt << endl;
}
Problem p02812 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  int N;
  char *S;
  int i, j, count = 0;

  cin >> N;
  cin >> S;

  for (i = 0; i < N - 2; i++) {
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C')
      count++;
  }

  cout << count << endl;
  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int N;
  char S[50];
  int i, j, count = 0;

  cin >> N;
  cin >> S;

  for (i = 0; i < N - 2; i++) {
    if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C')
      count++;
  }

  cout << count << endl;
  return 0;
}