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

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい
// for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(), (a).end()) // ソートのマクロ
#define Re(a) reverse((a).begin(), (a).end())
#define YN(a)                                                                  \
  if (a) {                                                                     \
    cout << "Yes" << endl;                                                     \
  } else                                                                       \
    cout << "No" << endl; // 条件によってYes、Noを出力する

int main() {
  int64_t n;
  cin >> n;
  int64_t count = 0;
  set<int64_t> s;
  s.insert(n);
  s.insert(n - 1);
  for (int64_t i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      s.insert(i);
      s.insert(n / i);
    }
  }
  for (int64_t i = 2; i * i <= n; i++) {
    if ((n - 1) % i == 0) {
      s.insert(i);
      s.insert((n - 1) / i);
    }
  }
  for (auto c : s) {
    // cout<<c<<endl;
    int64_t k = c;
    int64_t N = n;
    if (N % k == 0) {
      while (N % k == 0) {
        N = N / k;
      }
      if (N % k == 1) {
        count++;
      }
    } else if (N % k == 1) {
      count++;
    }
  }
  // cout<<count<<endl;
  cout << count << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい
// for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(), (a).end()) // ソートのマクロ
#define Re(a) reverse((a).begin(), (a).end())
#define YN(a)                                                                  \
  if (a) {                                                                     \
    cout << "Yes" << endl;                                                     \
  } else                                                                       \
    cout << "No" << endl; // 条件によってYes、Noを出力する

int main() {
  int64_t n;
  cin >> n;
  int64_t count = 0;
  set<int64_t> s;
  s.insert(n);
  if (n >= 3) {
    s.insert(n - 1);
  }
  for (int64_t i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      s.insert(i);
      s.insert(n / i);
    }
  }
  for (int64_t i = 2; i * i <= n; i++) {
    if ((n - 1) % i == 0) {
      s.insert(i);
      s.insert((n - 1) / i);
    }
  }
  for (auto c : s) {
    // cout<<c<<endl;
    int64_t k = c;
    int64_t N = n;
    if (N % k == 0) {
      while (N % k == 0) {
        N = N / k;
      }
      if (N % k == 1) {
        count++;
      }
    } else if (N % k == 1) {
      count++;
    }
  }
  // cout<<count<<endl;
  cout << count << endl;
}
Problem p02722 (C++)

Buggy submission (status: Runtime Error):

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

int yakusuu(long long a) {
  int count = 0;
  for (int i = 2; i <= sqrt(a); i++) {
    if (a % i == 0) {
      if (i == sqrt(a))
        count++;
      else
        count += 2;
    }
  }
  count++;
  return count;
}

int main() {
  long long n;
  cin >> n;
  long long count = 0;
  count += yakusuu(n - 1);
  if (n == 2) {
    cout << 1;
    return 1;
  }
  for (int i = 2; i <= sqrt(n); i++) {
    long long a = n;
    while (a % i == 0) {
      a /= i;
      if (a == 1) {
        count++;
        break;
      }
    }
  }
  for (int i = 2; i <= sqrt(n); i++) {
    long long a = n;

    if (a % i != 0)
      continue;
    while (a % i == 0) {
      a /= i;
    }
    if (a == 1)
      continue;
    if ((a - 1) % i == 0)
      count++;
  }
  cout << count + 1;
  return 0;
}

Fixed submission:

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

int yakusuu(long long a) {
  int count = 0;
  for (int i = 2; i <= sqrt(a); i++) {
    if (a % i == 0) {
      if (i == sqrt(a))
        count++;
      else
        count += 2;
    }
  }
  count++;
  return count;
}

int main() {
  long long n;
  cin >> n;
  long long count = 0;
  count += yakusuu(n - 1);
  if (n == 2) {
    cout << 1;
    return 0;
  }
  for (int i = 2; i <= sqrt(n); i++) {
    long long a = n;
    while (a % i == 0) {
      a /= i;
      if (a == 1) {
        count++;
        break;
      }
    }
  }
  for (int i = 2; i <= sqrt(n); i++) {
    long long a = n;

    if (a % i != 0)
      continue;
    while (a % i == 0) {
      a /= i;
    }
    if (a == 1)
      continue;
    if ((a - 1) % i == 0)
      count++;
  }
  cout << count + 1;
  return 0;
}
Problem p02722 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (int i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
ll calc(ll n, ll k) {
  if (n % k == 0)
    return n / k;
  else
    return n - k;
}
vector<ll> divisor(ll n) {
  vector<ll> div;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (i != 1)
        div.push_back(i);
      if (i * i != n)
        div.push_back(n / i);
    }
  }
  return div;
}
void Main() {
  ll n;
  cin >> n;
  vector<ll> div1 = divisor(n);
  vector<ll> div2 = divisor(n - 1);
  for (auto i : div1) {
    ll n2 = n;
    while (n2 >= i) {
      n2 = calc(n2, i);
      if (n2 % i == 1) {
        ans++;
        break;
      }
    }
  }
  ans += div2.size();
  cout << ans << endl;
}
int main() {
  Main();
  /*
  東方風神録は神が出てくるので当然神ゲー
  */
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (int i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
ll calc(ll n, ll k) {
  if (n % k == 0)
    return n / k;
  else
    return n - k;
}
vector<ll> divisor(ll n) {
  vector<ll> div;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (i != 1)
        div.push_back(i);
      if (i * i != n)
        div.push_back(n / i);
    }
  }
  return div;
}
void Main() {
  ll n;
  cin >> n;
  vector<ll> div1 = divisor(n);
  vector<ll> div2 = divisor(n - 1);
  for (auto i : div1) {
    ll n2 = n;
    while (n2 >= i) {
      n2 = calc(n2, i);
      if (n2 % i == 1) {
        ans++;
        break;
      }
      if (n2 % i > 1) {
        break;
      }
    }
  }
  ans += div2.size();
  cout << ans << endl;
}
int main() {
  Main();
  /*
  東方風神録は神が出てくるので当然神ゲー
  */
  return 0;
}
Problem p02722 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define N 400050
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;
ll n, ans;
set<ll> pr;
ll che(ll x) {
  ll m = n;
  while ((m % x) == 0) {
    m /= x;
  }
  m %= x;
  if (m == 1)
    return 1;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  ll val = n - 1;
  for (ll i = 2; i * i <= val; i++) {
    if (val % i)
      continue;
    pr.insert(i);
    pr.insert(val / i);
  }
  pr.insert(n);
  pr.insert(n - 1);
  for (ll i = 2; i * i <= n; i++) {
    if (n % i)
      continue;
    pr.insert(i);
    ll j = n / i;
    pr.insert(j);
  }
  for (auto ch : pr)
    if (che(ch))
      ans++;
  cout << ans;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define N 400050
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;
ll n, ans;
set<ll> pr;
bool che(int x) {
  if (x < 2 || x > n)
    return 0;
  ll m = n;
  while ((m % x) == 0) {
    m /= x;
  }
  m %= x;
  if (m == 1)
    return 1;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  ll val = n - 1;
  for (ll i = 2; i * i <= val; i++) {
    if (val % i)
      continue;
    pr.insert(i);
    pr.insert(val / i);
  }
  pr.insert(n);
  pr.insert(n - 1);
  for (ll i = 2; i * i <= n; i++) {
    if (n % i)
      continue;
    pr.insert(i);
    ll j = n / i;
    pr.insert(j);
  }
  for (auto ch : pr)
    if (che(ch))
      ans++;
  cout << ans;
  return 0;
}
Problem p02722 (C++)

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

bool check(ll n, ll a) {
  ll c = n;
  while (c >= a) {
    if (c % a == 0)
      c /= a;
    else
      c %= a;
  }
  return (c == 1);
}

int main() {
  ll n;
  cin >> n;
  vector<ll> v;
  v.push_back(n);
  v.push_back(n - 1);
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      v.push_back(n / i);
    }
  }
  for (ll i = 2; i * i <= n - 1; i++) {
    if ((n - 1) % i == 0) {
      v.push_back(i);
      v.push_back((n - 1) / i);
    }
  }
  set<int> s;
  for (auto x : v) {
    if (check(n, x))
      s.insert(x);
  }
  cout << s.size() << endl;
  return 0;
}


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

bool check(ll n, ll a) {
  ll c = n;
  while (c >= a) {
    if (c % a == 0)
      c /= a;
    else
      c %= a;
  }
  return (c == 1);
}

int main() {
  ll n;
  cin >> n;
  vector<ll> v;
  v.push_back(n);
  if (n != 2)
    v.push_back(n - 1);
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      v.push_back(n / i);
    }
  }
  for (ll i = 2; i * i <= n - 1; i++) {
    if ((n - 1) % i == 0) {
      v.push_back(i);
      v.push_back((n - 1) / i);
    }
  }
  set<int> s;
  for (auto x : v) {
    if (check(n, x))
      s.insert(x);
  }
  cout << s.size() << endl;
  return 0;
}
Problem p02722 (C++)

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

using namespace std;
using ll = long long;
using P = pair<int, int>;

vector<ll> Yakusu(ll n) {
  vector<ll> res;

  for (ll i = 1; i * i <= n; ++i) {
    if (n % i != 0)
      continue;
    res.push_back(i);
    if (i * i != n)
      res.push_back(n / i);
  }
  return res;
}

int main() {
  ll n;
  cin >> n;
  int ans = 0;

  for (ll x : Yakusu(n)) {
    if (x == 1)
      continue;
    ll tmp = n;
    while (tmp %= 0)
      tmp /= x;

    tmp %= x;
    if (tmp == 1)
      ++ans;
  }
  ans += Yakusu(n - 1).size() - 1;

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

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

using namespace std;
using ll = long long;
using P = pair<int, int>;

vector<ll> Yakusu(ll n) {
  vector<ll> res;

  for (ll i = 1; i * i <= n; ++i) {
    if (n % i != 0)
      continue;
    res.push_back(i);
    if (i * i != n)
      res.push_back(n / i);
  }
  return res;
}

int main() {
  ll n;
  cin >> n;
  int ans = 0;

  for (ll x : Yakusu(n)) {
    if (x == 1)
      continue;
    ll tmp = n;
    while (tmp % x == 0)
      tmp /= x;

    tmp %= x;
    if (tmp == 1)
      ++ans;
  }
  ans += Yakusu(n - 1).size() - 1;

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

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

using namespace std;

int main() {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << "1\n";
    return 1;
  }
  double level = sqrt(n);
  long long count = 2;
  long long work;
  long long j;
  for (long long i = 2; i <= level; i++) {
    if (n % i == 0) {
      work = n;
      while (work >= i) {
        if (work % i == 0)
          work /= i;
        else
          work %= i;
      }
      if (work == 1)
        count++;
      if ((double)i != level) {
        work = n;
        j = n / i;
        while (work >= j) {
          if (work % j == 0)
            work /= j;
          else
            work %= j;
        }
        if (work == 1)
          count++;
      }
    }
    if ((n - 1) % i == 0) {
      if ((double)i == sqrt(n - 1))
        count++;
      else
        count += 2;
    }
  }
  cout << count << "\n";
}


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

using namespace std;

int main() {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << "1\n";
    return 0;
  }
  double level = sqrt(n);
  long long count = 2;
  long long work;
  long long j;
  for (long long i = 2; i <= level; i++) {
    if (n % i == 0) {
      work = n;
      while (work >= i) {
        if (work % i == 0)
          work /= i;
        else
          work %= i;
      }
      if (work == 1)
        count++;
      if ((double)i != level) {
        work = n;
        j = n / i;
        while (work >= j) {
          if (work % j == 0)
            work /= j;
          else
            work %= j;
        }
        if (work == 1)
          count++;
      }
    }
    if ((n - 1) % i == 0) {
      if ((double)i == sqrt(n - 1))
        count++;
      else
        count += 2;
    }
  }
  cout << count << "\n";
}
Problem p02722 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> p;
typedef long long ll;
typedef pair<ll, ll> pll;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const ll INF = 2e9;
const ll MOD = 1e9 + 7;
struct edge {
  int to;
  int cost;
};
vector<ll> diviser(ll X) {
  vector<ll> res;
  for (int i = 1; i * i <= X; ++i) {
    if (X % i == 0) {
      res.push_back(i);
      if (i != X / i)
        res.push_back(X / i);
    }
  }
  sort(res.begin(), res.end());
  return res;
}
int main() {
  ll N;
  cin >> N;
  auto res1 = diviser(N - 1);
  auto res2 = diviser(N);
  ll ans = (int)res1.size() - 1;
  for (auto it : res2) {
    if (it == 1)
      continue;
    ll M = N;
    while (M % it == 0)
      M /= it;
    if (M % it == 1)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> p;
typedef long long ll;
typedef pair<ll, ll> pll;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const ll INF = 2e9;
const ll MOD = 1e9 + 7;
struct edge {
  int to;
  int cost;
};
vector<ll> diviser(ll X) {
  vector<ll> res;
  for (ll i = 1; i * i <= X; ++i) {
    if (X % i == 0) {
      res.push_back(i);
      if (i != X / i)
        res.push_back(X / i);
    }
  }
  sort(res.begin(), res.end());
  return res;
}
int main() {
  ll N;
  cin >> N;
  auto res1 = diviser(N - 1);
  auto res2 = diviser(N);
  ll ans = (int)res1.size() - 1;
  for (auto it : res2) {
    if (it == 1)
      continue;
    ll M = N;
    while (M % it == 0)
      M /= it;
    if (M % it == 1)
      ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p02722 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 7;
ll ans = 0, n;
map<ll, bool> m1;
void check(ll x) {
  if (x == 0)
    return;
  ll m = n;
  while (m % x == 0)
    m = m / x;
  m = m % x;
  if (m == 1) {
    if (!m1[x]) {
      ans++;
      m1[x] = 1;
    }
  }
}
void judge(ll x) {
  for (ll i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      check(i);
      check(x / i);
    }
  }
}

int main() {

  cin >> n;
  judge(n - 1);
  judge(n);
  cout << ans << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 7;
ll ans = 0, n;
map<ll, bool> m1;
void check(ll x) {
  if (x == 1)
    return;
  ll m = n;
  while (m % x == 0)
    m = m / x;
  m = m % x;
  if (m == 1) {
    if (!m1[x]) {
      ans++;
      m1[x] = 1;
    }
  }
}
void judge(ll x) {
  for (ll i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      check(i);
      check(x / i);
    }
  }
}

int main() {

  cin >> n;
  judge(n - 1);
  judge(n);
  cout << ans << endl;
  return 0;
}
Problem p02722 (C++)

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

vector<long long> div(long long n) {
  vector<long long> a;

  for (int i = 1; i * i <= n; ++i) {
    if (n % i != 0)
      continue;
    a.push_back(i);
    if (i * i != n)
      a.push_back(n / i);
  }

  return a;
}

int main() {
  long long n;
  cin >> n;

  long long ans = 0;
  for (long long x : div(n)) {
    if (x == 1)
      continue;
    long long k = n;
    while (k % x == 0)
      k /= x;
    if (k % x == 1)
      ans++;
  }
  ans += div(n - 1).size() - 1;

  cout << ans << endl;
}

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

vector<long long> div(long long n) {
  vector<long long> a;

  for (long long i = 1; i * i <= n; ++i) {
    if (n % i != 0)
      continue;
    a.push_back(i);
    if (i * i != n)
      a.push_back(n / i);
  }

  return a;
}

int main() {
  long long n;
  cin >> n;

  long long ans = 0;
  for (long long x : div(n)) {
    if (x == 1)
      continue;
    long long k = n;
    while (k % x == 0)
      k /= x;
    if (k % x == 1)
      ans++;
  }
  ans += div(n - 1).size() - 1;

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

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;

using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using umap = unordered_map<T, U>;
template <class T> using uset = unordered_set<T>;

template <class T> bool ChangeMax(T &a, const T &b) {
  if (a >= b)
    return false;
  a = b;
  return true;
}

template <class T> bool ChangeMin(T &a, const T &b) {
  if (a <= b)
    return false;
  a = b;
  return true;
}

template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
  fill((U *)a, (U *)(a + N), v);
}

template <class T> istream &operator>>(istream &is, vector<T> &v) {
  for (auto &e : v)
    is >> e;
  return is;
}

int main() {
  ll n;
  cin >> n;
  set<ll> d;
  d.insert(n);
  if (n > 2)
    d.insert(n - 1);
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0)
      d.insert(i);
    if ((n - 1) % i == 0) {
      d.insert(i);
      if ((n - 1) / i > 1)
        d.insert((n - 1) / i);
    }
  }
  int cnt = 0;
  for (auto e : d) {
    ll x = n;
    while (x % e == 0)
      x /= e;
    cnt += x % e == 1;
  }
  cout << cnt << endl;
  return 0;
}


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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;

using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using umap = unordered_map<T, U>;
template <class T> using uset = unordered_set<T>;

template <class T> bool ChangeMax(T &a, const T &b) {
  if (a >= b)
    return false;
  a = b;
  return true;
}

template <class T> bool ChangeMin(T &a, const T &b) {
  if (a <= b)
    return false;
  a = b;
  return true;
}

template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
  fill((U *)a, (U *)(a + N), v);
}

template <class T> istream &operator>>(istream &is, vector<T> &v) {
  for (auto &e : v)
    is >> e;
  return is;
}

int main() {
  ll n;
  cin >> n;
  set<ll> d;
  d.insert(n);
  if (n > 2)
    d.insert(n - 1);
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0)
      d.insert(i);
    if ((n - 1) % i == 0) {
      d.insert(i);
      if ((n - 1) / i > 1)
        d.insert((n - 1) / i);
    }
  }
  int cnt = 0;
  for (auto e : d) {
    ll x = n;
    while (x % e == 0)
      x /= e;
    cnt += x % e == 1;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02722 (C++)

Buggy submission (status: Time Limit Exceeded):
#include "bits/stdc++.h"
using namespace std;

int main() {
  long long N;
  cin >> N;
  vector<long long> ANS;
  for (long long i = 2; i * i <= N; i++) {
    if (N % i == 0) {
      ANS.push_back(i);
      if (i * i != N)
        ANS.push_back(N / i);
    } else if ((N - 1) % i == 0) {
      ANS.push_back(i);
      if (i * i + 1 != N)
        ANS.push_back((N - 1) / i);
    }
  }
  ANS.push_back(N - 1);
  ANS.push_back(N);
  sort(ANS.begin(), ANS.end());
  ANS.erase(unique(ANS.begin(), ANS.end()), ANS.end());
  long long COUNT = 0;
  for (int i = 0; i < ANS.size(); i++) {
    long long NOW = N;
    while (NOW % ANS[i] == 0)
      NOW /= ANS[i];
    if (NOW % ANS[i] == 1)
      COUNT++;
  }
  cout << COUNT << endl;
}

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

int main() {
  long long N;
  cin >> N;
  vector<long long> ANS;
  for (long long i = 2; i * i <= N; i++) {
    if (N % i == 0) {
      ANS.push_back(i);
      if (i * i != N)
        ANS.push_back(N / i);
    } else if ((N - 1) % i == 0) {
      ANS.push_back(i);
      if (i * i + 1 != N)
        ANS.push_back((N - 1) / i);
    }
  }
  ANS.push_back(N - 1);
  ANS.push_back(N);
  sort(ANS.begin(), ANS.end());
  ANS.erase(unique(ANS.begin(), ANS.end()), ANS.end());
  long long COUNT = 0;
  for (int i = 0; i < ANS.size(); i++) {
    if (ANS[i] == 1)
      continue;
    long long NOW = N;
    while (NOW % ANS[i] == 0)
      NOW /= ANS[i];
    if (NOW % ANS[i] == 1)
      COUNT++;
  }
  cout << COUNT << endl;
}
Problem p02722 (C++)

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

#define pb push_back
#define all(a) (a).begin(), (a).end()

using ll = long long;
using pii = pair<int, int>;

bool check(ll n, ll x) {
  while (n % x == 0)
    n /= x;
  return (n % x == 1);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  set<ll> ans;
  ll t = n - 1;
  ans.insert(n - 1);
  for (ll i = 2; i * i <= t; ++i) {
    if (t % i == 0) {
      ans.insert(i);
      ans.insert(t / i);
    }
  }

  ans.insert(n);
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      if (check(n, i))
        ans.insert(i);
      if (check(n, n / i))
        ans.insert(n / i);
    }
  }
  assert(!ans.count(1));
  cout << ans.size() << '\n';
}

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

#define pb push_back
#define all(a) (a).begin(), (a).end()

using ll = long long;
using pii = pair<int, int>;

bool check(ll n, ll x) {
  while (n % x == 0)
    n /= x;
  return (n % x == 1);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  if (n == 2) {
    cout << 1;
    return 0;
  }
  set<ll> ans;
  ll t = n - 1;
  ans.insert(n - 1);
  for (ll i = 2; i * i <= t; ++i) {
    if (t % i == 0) {
      ans.insert(i);
      ans.insert(t / i);
    }
  }

  ans.insert(n);
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      if (check(n, i))
        ans.insert(i);
      if (check(n, n / i))
        ans.insert(n / i);
    }
  }
  assert(!ans.count(1));
  cout << ans.size() << '\n';
}
Problem p02723 (C++)

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

int main() {
  string s;
  cin >> s;
  if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M = 1000000007;

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";
}

Fixed submission:
/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M = 1000000007;

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // #endif
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include "stdio.h"
#include <iostream>
#include <string.h>

using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.length() < 6)
    cout << "No";
  else if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
  return 1;
}

Fixed submission:
#include "stdio.h"
#include <iostream>
#include <string.h>

using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.length() < 6)
    cout << "No";
  else if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

int main() {
  string S;
  cin >> S;
  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string S;
  cin >> S;
  if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (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::sync_with_stdio(0);
  cin.tie(0);
  // Write from here.

  char s[6];
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }

  return 0;
}

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

int main() {

  char s[6];
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }

  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define MAX 100005
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define T                                                                      \
  int t;                                                                       \
  cin >> t;                                                                    \
  while (t--)
#define loop(i, a, b) for (int i = a; i < b; i++)
#define umi unordered_map<int, int>
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int>>
#define inp(n) for (int i = 0; i < n; i++)
#define N 200005
#define mxN 2000005
#define all(v) v.begin(), v.end()
#define lb(v, val) (int)(lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (int)(upper_bound(v.begin(), v.end(), val) - v.begin())
using namespace std;
using namespace std::chrono;

int v[N];

void solve() {
  string s;
  cin >> s;
  if (s.length() < 6) {
    cout << "Yes";
  } else {
    if (s[2] == s[3] && s[4] == s[5])
      cout << "Yes";
    else
      cout << "No";
  }
}

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

  int t = 1, tt = 0;
  // cin >> t;
  while (t--) {
    tt++;
    // cout << "Case #" <<tt<<": ";
    solve();
    cout << "\n";
  }
}


Fixed submission:
#include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define MAX 100005
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define T                                                                      \
  int t;                                                                       \
  cin >> t;                                                                    \
  while (t--)
#define loop(i, a, b) for (int i = a; i < b; i++)
#define umi unordered_map<int, int>
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int>>
#define inp(n) for (int i = 0; i < n; i++)
#define N 200005
#define mxN 2000005
#define all(v) v.begin(), v.end()
#define lb(v, val) (int)(lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (int)(upper_bound(v.begin(), v.end(), val) - v.begin())
using namespace std;
using namespace std::chrono;

int v[N];

void solve() {
  string s;
  cin >> s;
  if (s.length() < 6) {
    cout << "Yes";
  } else {
    if (s[2] == s[3] && s[4] == s[5])
      cout << "Yes";
    else
      cout << "No";
  }
}

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

  int t = 1, tt = 0;
  // cin >> t;
  while (t--) {
    tt++;
    // cout << "Case #" <<tt<<": ";
    solve();
    cout << "\n";
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.at(3) == s.at(4) && s.at(5) == s.at(6))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02723 (C++)

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

int main() {
  string S;
  cin >> S;
  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string S;
  cin >> S;
  if (S.at(2) == S.at(3) && S.at(5) == S.at(4)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define mp make_pair
#define pii pair<int, int>
#define mset(a, f) memset(a, f, sizeof(a))
#define pb push_back
const int N = 2e6 + 6;
const int M = 1e9 + 7;
int A[N];
int n;

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

  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
}

int32_t main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

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


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

#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define mp make_pair
#define pii pair<int, int>
#define mset(a, f) memset(a, f, sizeof(a))
#define pb push_back
const int N = 2e6 + 6;
const int M = 1e9 + 7;
int A[N];
int n;

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

  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
}

int32_t main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  ll x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  vector<ll> p(a), q(b), r(c);
  vector<pair<ll, int>> all;
  for (int i = 0; i < a; i++)
    cin >> p[i], all.push_back({p[i], 0});
  for (int i = 0; i < b; i++)
    cin >> q[i], all.push_back({q[i], 1});
  for (int i = 0; i < c; i++)
    cin >> r[i], all.push_back({r[i], 2});
  sort(all.begin(), all.end(), greater<pair<ll, int>>());

  int ux = 0, uy = 0, uz = 0;
  int ans = 0;
  for (int i = 0; i < all.size(); i++) {
    int nowf = all[i].first;
    int nows = all[i].second;
    if (nows == 0 && ux < x) {
      ux++;
      ans += nowf;
    } else if (nows == 1 && uy < y) {
      uy++;
      ans += nowf;
    } else if (nows == 2) {
      uz++;
      ans += nowf;
    }
    if (ux + uy + uz == x + y)
      break;
  }
  cout << ans << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}
Problem p02723 (C++)

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

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

  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes" << endl;
  }

  else {
    cout << "No" << endl;
  }
}

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

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

  if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
    cout << "Yes" << endl;
  }

  else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string R;
  cin >> R;
  if (R.at(3) == R.at(4) && R.at(5) == R.at(6))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string R;
  cin >> R;
  if (R.at(2) == R.at(3) && R.at(4) == R.at(5))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
/**
 * abc 160 a
 * Kartikeya (doomsday861)
 **/
#include <bits/stdc++.h>
#include <time.h>
#define ll long long
#define testcase                                                               \
  ll t;                                                                        \
  cin >> t;                                                                    \
  while (t--)
#define timeb auto start = high_resolution_clock::now();
#define timee                                                                  \
  auto stop = high_resolution_clock::now();                                    \
  auto duration = duration_cast<seconds>(stop - start);                        \
  cout << "Time taken by function: " << duration.count() << "seconds" << endl;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  freopen("output.ans", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  using namespace std::chrono;
  // timeb
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  // timee
  return 0;
}

Fixed submission:
/**
 * abc 160 a
 * Kartikeya (doomsday861)
 **/
#include <bits/stdc++.h>
#include <time.h>
#define ll long long
#define testcase                                                               \
  ll t;                                                                        \
  cin >> t;                                                                    \
  while (t--)
#define timeb auto start = high_resolution_clock::now();
#define timee                                                                  \
  auto stop = high_resolution_clock::now();                                    \
  auto duration = duration_cast<seconds>(stop - start);                        \
  cout << "Time taken by function: " << duration.count() << "seconds" << endl;
using namespace std;
int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  using namespace std::chrono;
  // timeb
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  // timee
  return 0;
}
Problem p02723 (C++)

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

int main() {

  string a;
  cin >> a;

  if (a.at(3) == a.at(4) || a.at(5) == a.at(6)) {

    cout << "Yes" << endl;

  }

  else {

    cout << "No" << endl;
  }
}


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

int main() {

  string a;
  cin >> a;

  if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {

    cout << "Yes" << endl;

  }

  else {

    cout << "No" << endl;
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
  char x[5];
  int f = 0;
  int e = 0;
  for (int i = 0; i < 6; i++)
    cin >> x[i];
  // for(int i = 0; i < 6; i++) cout << x[i] << endl;
  if (x[3] == x[2] and x[5] == x[4])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
  char x[6];
  for (int i = 0; i < 6; i++)
    cin >> x[i];
  // for(int i = 0; i < 6; i++) cout << x[i] << endl;
  if (x[3] == x[2] and x[5] == x[4])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):

#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);

#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
  string s;
  cin >> s;
  bool coffe = s.size() >= 5 && (s[2] == s[3]) && (s[4] == s[5]);
  cout << (coffe ? "Yes\n" : "No");

  return 0;
}


Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);

#ifndef ONLINE_JUDGE
  //        freopen("in.txt", "r", stdin);
  //        freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
  string s;
  cin >> s;
  bool coffe = s.size() >= 5 && (s[2] == s[3]) && (s[4] == s[5]);
  cout << (coffe ? "Yes\n" : "No");

  return 0;
}
Problem p02723 (C++)

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

int main() {
  string str;
  if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string str;
  cin >> str;
  if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;

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

  string s;
  cin >> s;

  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";

  return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;

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

  string s;
  cin >> s;

  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";

  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define F first
#define S second

int main() {

#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input1.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output1.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (s.length() == 6 and s[2] == s[3] and s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define F first
#define S second

int main() {

  // #ifndef ONLINE_JUDGE
  //  for getting input from input.txt
  // freopen("input1.txt", "r", stdin);
  //  for writing output to output.txt
  // freopen("output1.txt", "w", stdout);
  // #endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (s.length() == 6 and s[2] == s[3] and s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";

  return 0;
}
Problem p02723 (C++)

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

  string S;
  cin >> S;

  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

  string S;
  cin >> S;

  if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

int main() {
  string s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p02723 (C++)

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

int main() {
  string S;
  int YesFlag = 0;
  if (S.at(2) == S.at(3)) {
    YesFlag++;
  }
  if (S.at(4) == S.at(5)) {
    YesFlag++;
  }
  if (YesFlag == 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

int main() {
  string S;
  cin >> S;
  int YesFlag = 0;
  if (S.at(2) == S.at(3)) {
    YesFlag++;
  }
  if (S.at(4) == S.at(5)) {
    YesFlag++;
  }
  if (YesFlag == 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (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

  string s;
  cin >> s;
  assert((int)s.size() == 6);
  if (s[2] == s[3] and s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
}

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

using namespace std;

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

  string s;
  cin >> s;
  assert((int)s.size() == 6);
  if (s[2] == s[3] and s[4] == s[5]) {
    cout << "Yes";
  } else
    cout << "No";
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string a;
  if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string a;
  cin >> a;
  if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
Problem p02723 (C++)

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

int main() {
  string ch;
  cin >> ch;
  bool ans = false;
  if (ch.at(3) == ch.at(4) && ch.at(5) == ch.at(6)) {
    ans == true;
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

int main() {
  string ch;
  cin >> ch;
  if (ch.at(2) == ch.at(3) && ch.at(4) == ch.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

int main() {

  // 文字列
  string str;
  cin >> str;

  if (str.at(3) == str.at(4) && str.at(5) == str.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {

  // 文字列
  string str;
  cin >> str;

  if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  if ((s.at(3) == s.at(4)) && (s.at(5) == s.at(6)))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  if ((s.at(2) == s.at(3)) && (s.at(4) == s.at(5)))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02723 (C++)

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

int main() {
  string mozi;
  for (int i = 0; i < 6; i++) {
    cin >> mozi.at(i);
  }
  if (mozi.at(2) == mozi.at(3) && mozi.at(4) == mozi.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string mozi;
  cin >> mozi;
  if (mozi.at(2) == mozi.at(3) && mozi.at(4) == mozi.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

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

int main() {

  vector<string> S(6);
  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {

  string S;
  cin >> S;

  if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
    cout << "Yes";
  }

  else {
    cout << "No";
  }
}