Problem p02723 (C++) — buggy submission, verdict: Runtime Error

/*
h3110_fr13nd,

AUTHOR : @sam_jn
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
// typedef tree<pair<int, int>, null_type, less_equal<pair<int, int>>,
// rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define ll long long
#define MOD 1000000007
#define pb push_back
#define ff first
#define ss second
#define in(a, n)                                                               \\
  for (int i = 0; i < n; i++)                                                  \\
    cin >> a[i];
#define ot1(a, n)                                                              \\
  for (int i = 0; i < n; i++)                                                  \\
    cout << a[i] << " ";                                                       \\
  cout << endl;
#define ot2(a, n)                                                              \\
  for (int i = 0; i < n; i++)                                                  \\
    cout << a[i] << "\\n";
ll pwr(ll a, ll b);
ll pwr(ll a, ll b, ll m);
int baap[200002];
int find(int i);
bool Union(int x, int y);
ll inv(ll x) { return pwr(x, MOD - 2, MOD); }

//----------------------------------SOLUTION-BELOW-------------------------------------------//
void solve() {

  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes";
  else
    cout << "No";
}
int main() {
  // #ifndef ONLINE_JUDGE
  // freopen("../input", "r", stdin);
  // freopen("../output", "w", stdout);
  // #else
  // // online submission
  // #endif
  boost int _ = 1;
  // cout << 0 << endl;
  // cin >> _;
  while (_--) {
    solve();
    cout << endl;
  }
}

//--------------------------------------DEFININTIONS---------------------------------------
ll pwr(ll a, ll b) {
  if (b == 0)
    return 1;
  ll c = pwr(a, b / 2);
  c = c * c;
  if (b % 2)
    return c * a;
  return c;
}
ll pwr(ll a, ll b, ll m) {
  if (b == 0)
    return 1;
  ll c = pwr(a, b / 2, m) % m;
  c = (c * c) % m;
  if (b % 2)
    return (c * a % m) % m;
  return c;
}
int find(int i) {
  if (baap[i] != i)
    baap[i] = find(baap[i]);

  return baap[i];
}

bool Union(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y)
    return false;
  baap[x] = y;
  return true;
}

Error: WA

Fixed submission:

/*
h3110_fr13nd,

AUTHOR : @sam_jn
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
// typedef tree<pair<int, int>, null_type, less_equal<pair<int, int>>,
// rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define ll long long
#define MOD 1000000007
#define pb push_back
#define ff first
#define ss second
#define in(a, n)                                                               \\
  for (int i = 0; i < n; i++)                                                  \\
    cin >> a[i];
#define ot1(a, n)                                                              \\
  for (int i = 0; i < n; i++)                                                  \\
    cout << a[i] << " ";                                                       \\
  cout << endl;
#define ot2(a, n)                                                              \\
  for (int i = 0; i < n; i++)                                                  \\
    cout << a[i] << "\\n";
ll pwr(ll a, ll b);
ll pwr(ll a, ll b, ll m);
int baap[200002];
int find(int i);
bool Union(int x, int y);
ll inv(ll x) { return pwr(x, MOD - 2, MOD); }

//----------------------------------SOLUTION-BELOW-------------------------------------------//
void solve() {

  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes";
  else
    cout << "No";
}
int main() {
#ifndef ONLINE_JUDGE
  freopen("../input", "r", stdin);
  freopen("../output", "w", stdout);
#else
// online submission
#endif
  boost int _ = 1;
  // cout << 0 << endl;
  // cin >> _;
  while (_--) {
    solve();
    cout << endl;
  }
}

//--------------------------------------DEFININTIONS---------------------------------------
ll pwr(ll a, ll b) {
  if (b == 0)
    return 1;
  ll c = pwr(a, b / 2);
  c = c * c;
  if (b % 2)
    return c * a;
  return c;
}
ll pwr(ll a, ll b, ll m) {
  if (b == 0)
    return 1;
  ll c = pwr(a, b / 2, m) % m;
  c = (c * c) % m;
  if (b % 2)
    return (c * a % m) % m;
  return c;
}
int find(int i) {
  if (baap[i] != i)
    baap[i] = find(baap[i]);

  return baap[i];
}

bool Union(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y)
    return false;
  baap[x] = y;
  return true;
}