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

Buggy submission (status: Runtime Error):
/******************************************
/@Author: LeafBelief
/@Date: 2020-04-04
/@Remark:
/@FileName: coffeestring
******************************************/
#include <bits/stdc++.h>
#define CSE(x, y) memset(x, y, sizeof(x))
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
#define FAST                                                                   \
  ios::sync_with_stdio(false);                                                 \
  cin.tie(0);
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int maxn = 111;
char str[maxn];

int main() {
#ifndef ONLINE_JUDGE
  freopen("in.in", "r", stdin);
#endif
  FAST;
  while (cin >> str) {
    if (str[2] == str[3] && str[4] == str[5]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}

Fixed submission:
/******************************************
/@Author: LeafBelief
/@Date: 2020-04-04
/@Remark:
/@FileName: coffeestring
******************************************/
#include <bits/stdc++.h>
#define CSE(x, y) memset(x, y, sizeof(x))
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
#define FAST                                                                   \
  ios::sync_with_stdio(false);                                                 \
  cin.tie(0);
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int maxn = 111;
char str[maxn];

int main() {
  FAST;
  while (cin >> str) {
    if (str[2] == str[3] && str[4] == str[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;
  S.size() == 6;
  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;
  S.size() == 6;
  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;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)

typedef unsigned long long ull;
typedef long long ll;

const int INF = 1001001001;

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

  string ans = (s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No";
  cout << ans << endl;
  return 1;
}

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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)

typedef unsigned long long ull;
typedef long long ll;

const int INF = 1001001001;

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

  string ans = (s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No";
  cout << ans << endl;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
// Deep Godhani
// DAIICT

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

#define N 100000000000
#define PI acos(-1)
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define ll long long int
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define FAST                                                                   \
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);                   \
  srand(time(NULL))

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

const ll M = 1e9 + 7;

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

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

  FAST;
  ll t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}


Fixed submission:
// Deep Godhani
// DAIICT

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

#define N 100000000000
#define PI acos(-1)
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define ll long long int
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define FAST                                                                   \
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);                   \
  srand(time(NULL))

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

const ll M = 1e9 + 7;

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

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

  FAST;
  ll t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  char c[6];
  scanf("%c%c%c%c%c%c", &c[0], &c[1], &c[2], &c[3], &c[4], c[5]);
  if (c[4] == c[5] && c[2] == c[3])
    printf("Yes");
  else
    printf("No");
  return 0;
}

Fixed submission:
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  char c[6];
  scanf("%c%c%c%c%c%c", &c[0], &c[1], &c[2], &c[3], &c[4], &c[5]);
  if (c[4] == c[5] && c[2] == c[3])
    printf("Yes");
  else
    printf("No");
  return 0;
}
Problem p02723 (C++)

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

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

  bool answer = false;

  if (s.at(3) == s.at(4))
    answer = true;
  if (s.at(5) == s.at(6))
    answer = true;

  if (answer)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

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

  bool answer = false;

  if ((s.at(2) == s.at(3)) && (s.at(4) == s.at(5)))
    answer = true;

  if (answer)
    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;
  cout << (S.at(3) == S.at(4) && S.at(5) == S.at(6) ? "Yes" : "No") << endl;
}


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

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

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

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

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

int main() {
  string S;
  cin >> S;
  char a = S.at(2);
  char b = S.at(3);
  char c = S.at(4);
  char d = S.at(5);
  if (a == b && c == d) {
    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;
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i++)
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define mod 1000000007
// int max(int a, int b, int c){ if(a>b){if(a>c) return a; else return
// c;}else{if(b>c)return b;else return c;}}
int power(int a, int b) {
  int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1)
      res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int32_t main() {
  IOS;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  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;
  cin >> s;
  if (s.at(6) == 'e' && s.at(3) == 'f' && s.at(4) == 'f' && s.at(5) == 'e')
    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(5) == s.at(4) && s.at(2) == s.at(3))
    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";
  } else {
    cout << "No";
  }
}

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";
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
/*   CREATED BY
       STREAM_CIPHER
       28-03-2020
  */
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long int ll;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  string a;
  cin >> a;
  if (a[2] == a[3] && a[4] == a[5])
    cout << "Yes\n";
  else
    cout << "No\n";
}

Fixed submission:
/*   CREATED BY
       STREAM_CIPHER
       28-03-2020
  */
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long int ll;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  string a;
  cin >> a;
  if (a[2] == a[3] && a[4] == a[5])
    cout << "Yes\n";
  else
    cout << "No\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;
  }
}


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

int main() {
  string S;
  cin >> S;
  int count = 0;
  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;

typedef long long ll;

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

  string s;
  cin >> s;

  return s[2] == s[3] && s[4] == s[5];
}


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

typedef long long ll;

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

  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 <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(void) {
  string s;
  cin >> s;
  if (s.length() == 6) {
    char x[6];
    strcpy(x, s.c_str());
    bool b = 0;
    for (int i = 0; i < 2; i++) {
      if (int(x[i]) < 97 || int(x[i]) > 122) {
        b = 1;
        break;
      }
    }
    if (b == 0 && x[2] == x[3] && x[4] == x[5])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  if (s.length() == 6) {
    char x[7];
    strcpy(x, s.c_str());
    bool b = 0;
    for (int i = 0; i < 2; i++) {
      if (int(x[i]) < 97 || int(x[i]) > 122) {
        b = 1;
        break;
      }
    }
    if (b == 0 && x[2] == x[3] && x[4] == x[5])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}
Problem p02723 (C++)

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

#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int, int>
#define all(x) begin(x), end(x)
#define loop(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b, c) for (int i = a; i < b; i += c)
#define brep(i, a, b, c) for (int i = a; i > b; i -= c)
#define tc(t)                                                                  \
  int t;                                                                       \
  cin >> t;                                                                    \
  while (t--)
#define sz(v) int((v).size())
#define pb push_back

using namespace std;

int main() {

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

  IOS;

  string s;
  cin >> s;

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

  return 0;
}

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

#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int, int>
#define all(x) begin(x), end(x)
#define loop(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b, c) for (int i = a; i < b; i += c)
#define brep(i, a, b, c) for (int i = a; i > b; i -= c)
#define tc(t)                                                                  \
  int t;                                                                       \
  cin >> t;                                                                    \
  while (t--)
#define sz(v) int((v).size())
#define pb push_back

using namespace std;

int main() {

  IOS;

  string s;
  cin >> s;

  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;
  cin >> s;
  if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}


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";
  } else {
    cout << "No";
  }
}
Problem p02723 (C++)

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

#define maxn 6
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;

char buf[maxn];

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
#ifdef ONLINE_JUDGE
#else
  freopen("C:\\Users\\Fish_Brother\\Desktop\\in", "r", stdin);
  freopen("C:\\Users\\Fish_Brother\\Desktop\\out", "w", stdout);
#endif
  slove();

  return 0;
}

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

#define maxn 6
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;

char buf[maxn];

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

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

  slove();

  return 0;
}
Problem p02723 (C++)

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

#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define ll long long
#define pb push_back
#define endl "\n"
#define mp map<int, int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007

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

int main() {
  c_p_c();

  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;

#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define ll long long
#define pb push_back
#define endl "\n"
#define mp map<int, int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007

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

int main() {
  c_p_c();

  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>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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() {
  vector<char> S(6);
  for (int i = 0; i < 6; i++) {
    cin >> S.at(i);
  }
  if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}


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

int main() {
  vector<char> S(6);
  for (int i = 0; i < 6; i++) {
    cin >> S.at(i);
  }
  if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
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(3) == a.at(2)) && (a.at(5) == a.at(4))) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
// coffee と似ているかを判定
#include <iostream>

int main(int argc, char const *argv[]) {
  std::string input;
  std::cin >> input;

  if (input.at(3) == input.at(4) && input.at(5) == input.at(6)) {
    std::cout << "Yes\n";
  } else {
    std::cout << "No\n";
  }

  return 0;
}


Fixed submission:
// coffee と似ているかを判定
#include <iostream>

int main(int argc, char const *argv[]) {
  std::string input;
  std::cin >> input;

  if (input.at(2) == input.at(3) && input.at(4) == input.at(5)) {
    std::cout << "Yes\n";
  } else {
    std::cout << "No\n";
  }

  return 0;
}
Problem p02723 (C++)

Buggy submission (status: Runtime Error):

#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a, val) memset(a, val, sizeof(a))
#define eb emplace_back
#define f first
#define s second

using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif
  // cin>>T;
  // // cin.ignore(); must be there when using getline(cin, s)
  // while(T--)
  // {

  // }
  // return 0;
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) {

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


Fixed submission:

#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a, val) memset(a, val, sizeof(a))
#define eb emplace_back
#define f first
#define s second

using namespace std;
int main() {
  // std::ios::sync_with_stdio(false);
  // #ifndef ONLINE_JUDGE
  //   // for getting input from input.txt
  //    freopen("input.txt", "r", stdin);
  //    // for writing output to output.txt
  //    freopen("output.txt", "w", stdout);
  // #endif
  // cin>>T;
  // // cin.ignore(); must be there when using getline(cin, s)
  // while(T--)
  // {

  // }
  // return 0;
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) {

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

Buggy submission (status: Runtime Error):
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

#define ll long long
#define test(t)                                                                \
  ll int t;                                                                    \
  cin >> t;                                                                    \
  while (t--)
#define F(i, L, R) for (ll int i = L; i < R; i++)
#define F2(i, L, R) for (ll int i = L; i >= R; i--)
#define get1(a)                                                                \
  ll int a;                                                                    \
  cin >> a;
#define get2(a, b)                                                             \
  ll int a, b;                                                                 \
  cin >> a >> b;
#define get3(a, b, c)                                                          \
  ll int a, b, c;                                                              \
  cin >> a >> b >> c;
#define pb push_back
#define mp make_pair
#define MAX 1000000001
using namespace std;

int main() {

  ios_base::sync_with_stdio(0);

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

  string s;
  cin >> s;

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

  return 0;
}

Fixed submission:
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

#define ll long long
#define test(t)                                                                \
  ll int t;                                                                    \
  cin >> t;                                                                    \
  while (t--)
#define F(i, L, R) for (ll int i = L; i < R; i++)
#define F2(i, L, R) for (ll int i = L; i >= R; i--)
#define get1(a)                                                                \
  ll int a;                                                                    \
  cin >> a;
#define get2(a, b)                                                             \
  ll int a, b;                                                                 \
  cin >> a >> b;
#define get3(a, b, c)                                                          \
  ll int a, b, c;                                                              \
  cin >> a >> b >> c;
#define pb push_back
#define mp make_pair
#define MAX 1000000001
using namespace std;

int main() {

  ios_base::sync_with_stdio(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
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif

  string s;
  cin >> s;
  bool flag = 0;
  if (s[2] == s[3] && s[4] == s[5])
    flag = 1;
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
#endif

  string s;
  cin >> s;
  bool flag = 0;
  if (s[2] == s[3] && s[4] == s[5])
    flag = 1;
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02723 (C++)

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

int main() {
  string s;
  cin >> s;
  int i = 0;
  for (int i = 0; i < s.length(); i++) {
    /* code */
    if (s[2] == s[3] and s[4] == s[5]) {
      cout << "Yes" << endl;
      i = 1;
    }
  }
  if (i != 1) {
    cout << "No" << endl;
  }
}

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

int main() {
  string s;
  cin >> s;
  int i = 0;
  if (s[2] == s[3] and s[4] == s[5]) {
    cout << "Yes" << endl;
    i = 1;
  }
  if (i != 1) {
    cout << "No" << endl;
  }
}
Problem p02723 (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++)
typedef long long ll;
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;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
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):
// HE WHO TRAVELS THE FASTEST, TRAVELS ALONE
#include <bits/stdc++.h>
#include <stack>
using namespace std;
#define ORIGAMI ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pb push_back
#define INF 1e18LL
#define ll long long int

vector<ll> adj[100000];
vector<bool> vis(100000, false);
ll mod = 998244353;

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

ll po(ll a, ll b) {
  ll mod = 100;
  a %= mod;
  b %= mod;
  ll res = 1;
  while (b > 0) {
    if (b & 1)
      res = (res * a) % mod;
    a = a * a % mod;
    b /= 2;
  }
  return res;
}

void dfs(ll x) {
  vis[x] = true;
  cout << x << " ";
  for (auto u : adj[x]) {
    if (!vis[u])
      dfs(u);
  }
}

bool isprime(ll x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0)
      return false;
  }
  return true;
}

bool solve(ll x) {
  ll s = 1;
  for (int i = x / 2; i > 1; i--) {
    if (x % i == 0) {
      s += i;
    }
  }
  if (s == x)
    return true;
  return false;
}

int main() {
  ORIGAMI
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5])
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}

Fixed submission:
// HE WHO TRAVELS THE FASTEST, TRAVELS ALONE
#include <bits/stdc++.h>
#include <stack>
using namespace std;
#define ORIGAMI ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pb push_back
#define INF 1e18LL
#define ll long long int

vector<ll> adj[100000];
vector<bool> vis(100000, false);
ll mod = 998244353;

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

ll po(ll a, ll b) {
  ll mod = 100;
  a %= mod;
  b %= mod;
  ll res = 1;
  while (b > 0) {
    if (b & 1)
      res = (res * a) % mod;
    a = a * a % mod;
    b /= 2;
  }
  return res;
}

void dfs(ll x) {
  vis[x] = true;
  cout << x << " ";
  for (auto u : adj[x]) {
    if (!vis[u])
      dfs(u);
  }
}

bool isprime(ll x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0)
      return false;
  }
  return true;
}

bool solve(ll x) {
  ll s = 1;
  for (int i = x / 2; i > 1; i--) {
    if (x % i == 0) {
      s += i;
    }
  }
  if (s == x)
    return true;
  return false;
}

int main() {
  ORIGAMI
  // #ifndef ONLINE_JUDGE
  // 	freopen("input.txt","r",stdin);
  // 	freopen("output.txt","w",stdout);
  // #endif
  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 <stdio.h>

int main() {

  char s[6];
  int i;
  for (i = 0; i < 6; i++) {
    scanf("%s", s[i]);
  }
  if (s[2] == s[3] && s[4] == s[5]) {
    printf("Yes");
  } else {
    printf("No");
  }

  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {

  char s[6];
  int i;
  for (i = 0; i < 6; i++) {
    scanf("%s", &s[i]);
  }
  if (s[2] == s[3] && s[4] == s[5]) {
    printf("Yes");
  } else {
    printf("No");
  }

  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(4) == s.at(5)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02723 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>

int main(void) {
  char moji[100];

  do {
    scanf("%s", moji);
  } while (sizeof(moji) != 6);

  if (moji[2] == moji[3] && moji[4] == moji[5])
    puts("Yes");
  else
    puts("No");

  return 0;
}

Fixed submission:
#include <stdio.h>

int main(void) {
  char moji[100];

  scanf("%s", moji);

  if (moji[2] == moji[3] && moji[4] == moji[5])
    puts("Yes");
  else
    puts("No");

  return 0;
}
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;
  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 (Python)

Buggy submission (status: Runtime Error):
s = input()
if s[3] == s[4] and s[5] == s[6]:
    print("Yes")
else:
    print("No")


Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Problem p02723 (Python)

Buggy submission (status: Runtime Error):
S = input()
print("Yes" if S[3] == S[4] and S[5] == S[6] else "No")


Fixed submission:
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
Problem p02723 (Python)

Buggy submission (status: Runtime Error):
s = input().split()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")


Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Problem p02723 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll modularExponentiation(ll x, ll n, ll M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modularExponentiation((x * x) % M, n / 2, M);
  return (x * modularExponentiation((x * x) % M, (n - 1) / 2, M)) % M;
}
ll binaryExponentiation(ll x, ll n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return binaryExponentiation(x * x, n / 2);
  else
    return x * binaryExponentiation(x * x, (n - 1) / 2);
}
ll GCD(ll A, ll B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
ll extended_GCD(ll a, ll b, ll &x, ll &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  ll x1, y1;
  ll gcd = extended_GCD(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return gcd;
}
ll modinv(ll a, ll mod) {
  ll x, y;
  extended_GCD(a, mod, x, y);
  if (x < 0)
    x += mod;
  return x;
}
ll modPrimeInverse(ll A, ll M) { return modularExponentiation(A, M - 2, M); }
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "rt", stdin);
  freopen("output.txt", "wt", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

  // #ifndef ONLINE_JUDGE
  //     cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
  // #endif
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll modularExponentiation(ll x, ll n, ll M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modularExponentiation((x * x) % M, n / 2, M);
  return (x * modularExponentiation((x * x) % M, (n - 1) / 2, M)) % M;
}
ll binaryExponentiation(ll x, ll n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return binaryExponentiation(x * x, n / 2);
  else
    return x * binaryExponentiation(x * x, (n - 1) / 2);
}
ll GCD(ll A, ll B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
ll extended_GCD(ll a, ll b, ll &x, ll &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  ll x1, y1;
  ll gcd = extended_GCD(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return gcd;
}
ll modinv(ll a, ll mod) {
  ll x, y;
  extended_GCD(a, mod, x, y);
  if (x < 0)
    x += mod;
  return x;
}
ll modPrimeInverse(ll A, ll M) { return modularExponentiation(A, M - 2, M); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

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

  // #ifndef ONLINE_JUDGE
  //     cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
  // #endif
  return 0;
}
Problem p02724 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define repeq(i, n) for (int(i) = 0; (i) <= (int)(n); (i)++)
#define rep1(i, x, n) for (int(i) = (x); (i) < (int)(n); (i)++)
#define rep1eq(i, x, n) for (int(i) = (x); (i) <= (int)(n); (i)++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int, int> P;

// 少数点表示
// cout << std::fixed << std::setprecision(14) << 値

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  cin >> x;
  int amari = 0;
  int happy = 0;
  if (x == 0) {
    cout << 0;
    return 0;
  }
  int z = x / 500;
  happy += (1000 * z);
  int y = (x % (500 * z)) / 5;
  happy += (5 * y);
  cout << happy;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define repeq(i, n) for (int(i) = 0; (i) <= (int)(n); (i)++)
#define rep1(i, x, n) for (int(i) = (x); (i) < (int)(n); (i)++)
#define rep1eq(i, x, n) for (int(i) = (x); (i) <= (int)(n); (i)++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int, int> P;

// 少数点表示
// cout << std::fixed << std::setprecision(14) << 値

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  cin >> x;
  int amari = 0;
  int happy = 0;
  if (x == 0) {
    cout << 0;
    return 0;
  }
  int z = x / 500;
  happy += (1000 * z);
  int y;
  if (z != 0) {
    y = (x % (500 * z)) / 5;
  } else {
    y = x / 5;
  }
  happy += (5 * y);
  cout << happy;
}
Problem p02724 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define all(c) c.begin(), c.end()
#define mp make_pair
#define endl "\n"
#define N 998244353
#define INF 1e9

ll power(ll x, ll y, ll m) {
  if (y == 0)
    return 1;
  ll p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";

  ll n;
  cin >> n;
  ll ans = (n / 500) * 1000;
  ans += ((n % 500) / 5) * 5;
  cout << ans;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define all(c) c.begin(), c.end()
#define mp make_pair
#define endl "\n"
#define N 998244353
#define INF 1e9

ll power(ll x, ll y, ll m) {
  if (y == 0)
    return 1;
  ll p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int main() {
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  // #endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";

  ll n;
  cin >> n;
  ll ans = (n / 500) * 1000;
  ans += ((n % 500) / 5) * 5;
  cout << ans;

  return 0;
}
Problem p02724 (C++)

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

int main() {
  long long k, n;
  cin >> k >> n;
  vector<long long> data(n);
  for (long long i = 0; i < n; i++) {
    cin >> data.at(i);
  }

  long long a = data.at(n - 1) - data.at(0);
  vector<long long> table(1000000, 0);
  table.at(a) = 1;
  for (long long i = 0; i < n - 1; i++) {
    long long sum = k - data.at(i + 1) + data.at(i);
    table.at(sum) = 1;
  }
  for (long long i = 0; i < 1000000; i++) {
    if (table.at(i) == 1) {
      cout << i << endl;
      break;
    }
  }
}


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

int main() {
  int x;
  cin >> x;
  int c500 = x / 500;
  x = x % 500;
  int c5 = x / 5;
  cout << c500 * 1000 + c5 * 5 << endl;
}
Problem p02724 (C++)

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

int main(int argc, char *argv[]) {
  std::string line;
  std::cin >> line;
  int money = std::stoi(line);
  int moneyTable[6] = {500, 100, 50, 5, 1};
  int scoreTable[6] = {1000, 0, 0, 5, 0};
  int result = 0;
  for (int i = 0; i < 6; i++) {
    int div = money / moneyTable[i];
    result += div * moneyTable[i];
    money -= div * moneyTable[i];
  }
  std::cout << std::to_string(money) << std::endl;
  return 0;
}

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

int main(int argc, char *argv[]) {
  std::string line;
  std::cin >> line;
  int money = std::stoi(line);
  int div500 = money / 500;
  money -= div500 * 500;
  int div5 = money / 5;
  money -= div5 * 5;
  std::cout << std::to_string((div500 * 1000) + (div5 * 5)) << std::endl;
  return 0;
}
Problem p02724 (C++)

Buggy submission (status: Runtime Error):
/*Given an array of n numbers find the largest difference in the
starting and ending indexes of the elements of the all possible
strictly decreasing sub-sequences in the array.

Input: 21, 13, 18, 10, 7, 3, 1

Output : 4

Input: 1, 18, 17, 14, 15, 32, 16

Output: 2 */
#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 M 100001
#define endl "\n"
#define all(a) (a).begin(), (a).end()
#define lp(i, a, b) for (i = a; i < b; i++)
#define lpr(i, a, b) for (i = a; i >= b; i--)
#define F first
#define S second
#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef pair<int, int> 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 i, n;
  cin >> n;
  int r = 1000 * floor(n / 500);
  n -= 500 * (n / 500);
  r += 5 * (n / 5);
  cout << r << endl;
  return 0;
}


Fixed submission:
/*Given an array of n numbers find the largest difference in the
starting and ending indexes of the elements of the all possible
strictly decreasing sub-sequences in the array.

Input: 21, 13, 18, 10, 7, 3, 1

Output : 4

Input: 1, 18, 17, 14, 15, 32, 16

Output: 2 */
#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 M 100001
#define endl "\n"
#define all(a) (a).begin(), (a).end()
#define lp(i, a, b) for (i = a; i < b; i++)
#define lpr(i, a, b) for (i = a; i >= b; i--)
#define F first
#define S second
#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef pair<int, int> 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 i, n;
  cin >> n;
  int r = 1000 * floor(n / 500);
  n -= 500 * (n / 500);
  r += 5 * (n / 5);
  cout << r << endl;
  return 0;
}
Problem p02724 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int X;
  cin >> X;
  int A = 0;

  while (X -= 500 > 500) {
    A += 1000;
  }
  while (X -= 5 > 0) {
    A += 5;
  }
  cout << A << endl;
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int X;
  cin >> X;
  int A = 0;
  int c = X / 500;
  int d = (X % 500) / 5;
  A += c * 1000;
  A += d * 5;
  cout << A << endl;
}
Problem p02724 (C++)

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

using namespace std;

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

  int count500 = x / 500;
  int count5 = (x % (500 * count500)) / 5;
  int result = count500 * 1000 + count5 * 5;
  cout << result << endl;
}

Fixed submission:
#include <iostream>

using namespace std;

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

  int count500 = x / 500;
  int count5 = (x % 500) / 5;
  int result = count500 * 1000 + count5 * 5;
  cout << result << endl;
}
Problem p02724 (C++)

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

int main() {
  ll n;
  cin >> n;
  ll x = n / 500;
  n -= x * 500;
  ll y = n / 5;
  ll ans = 0;
  ans += x * 500 * 2;
  ans += y * 5;
  return ans;
}

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

int main() {
  ll n;
  cin >> n;
  ll x = n / 500;
  n -= x * 500;
  ll y = n / 5;
  ll ans = 0;
  ans += x * 500 * 2;
  ans += y * 5;
  cout << ans;
  return 0;
}
Problem p02724 (C++)

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

#define ll long long
#define endl "\n"

void solve() {
  ll ans = 0;
  ll n;
  cin >> n;
  while (n > 0) {
    if (n >= 500) {
      ans += 1000;
      n -= 500;
    } else if (n >= 5) {
      ans += 5;
      n -= 5;
    }
  }
  cout << ans << endl;
}

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


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

#define ll long long
#define endl "\n"

void solve() {
  ll ans = 0;
  ll n;
  cin >> n;
  ans = (1ll * 1000 * (n / 500)) + (1ll * 5 * ((n % 500) / 5));
  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}
Problem p02724 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, h = 0;
  cin >> x;
  if (x < 5) {
    cout << h << endl;
  } else {

    while (x >= 5) {
      if (x > 500) {
        h = h + (x / 500) * 1000;
      } else if (x > 5) {
        h = h + (x / 5) * 5;
      }
    }

    cout << h << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, h = 0;
  cin >> x;
  if (x < 5) {
    cout << h << endl;
  } else {
    h = h + (x / 500) * 1000;
    x = x % 500;
    h = h + (x / 5) * 5;
    cout << h << endl;
  }

  return 0;
}
Problem p02724 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i++)
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define mod 1000000007
// int max(int a, int b, int c){ if(a>b){if(a>c) return a; else return
// c;}else{if(b>c)return b;else return c;}}
int power(int a, int b) {
  int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1)
      res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int32_t main() {
  IOS;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int n;
  cin >> n;
  int ans = 0;
  while (n >= 500) {
    n -= 500;
    ans += 1000;
  }
  while (n >= 5) {
    n -= 5;
    ans += 5;
  }
  cout << ans;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  while (n >= 500) {
    n -= 500;
    ans += 1000;
  }
  while (n >= 5) {
    n -= 5;
    ans += 5;
  }
  cout << ans;
  return 0;
}