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

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (C - B <= 0) {
    cout << "Yes" << endl;
  } else if (A - D <= 0) {
    cout << "No" << endl;
  } else if (C % B == 0 && A % D != 0) {
    if (C / B <= A / D + 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (C % B != 0 && A % D == 0) {
    if (C / B + 1 <= A / D) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (C / B <= A / D) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Error: -8

Fixed submission:

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A / (A - B) < C / (C - D)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  int ct1, ct2, ct3, ct4, ct5, ct6;
  ct1 = A / D;
  ct2 = C / B;
  ct3 = A % D;
  ct4 = C % B;
  if (ct3 > 0) {
    ct3 = 1;
  }
  if (ct4 > 0) {
    ct4 = 1;
  }
  ct5 = ct1 + ct3;
  ct6 = ct2 + ct4;
  /*
  while(A>0){
      A = A-D;
      ct1++;
  }
  while(C>0){
      D = C-B;
      ct2++;
  }*/

  if (ct5 >= ct6) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  int ct1, ct2;
  ct1 = 0;
  ct2 = 0;
  while (A > 0) {
    A = A - D;
    ct1++;
  }
  while (C > 0) {
    D = C - B;
    ct2++;
  }
  if (ct1 >= ct2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C = C - B;
    if (C <= 0) {
      cout << "Yes" << endl;
      return 0;
    }
    A -= D;
    if (A <= 0) {
      cout << "No" << endl;
      return 0;
    }
  }
}

Error: TLE

Fixed submission:

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

int main() {
  long long A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C = C - B;
    A = A - D;
    if (C <= 0) {
      if (A > 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    if (A <= 0) {
      if (C > 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int count = 0;
  count = (a + d - 1) / d;
  if (b * count >= c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Error: WA

Fixed submission:

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  for (int i = 0; i < (a + c - 1) / c; i++) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <regex>
#include <set>
#include <string>
#include <vector>

using namespace std;

struct Elem {
  int x;
  int y;
};

int main() {
  int a, b, c, d;
  std::cin >> a >> b >> c >> d;

  int turn = 0;
  while (a > 0 && c > 0) {
    if (turn % 2 == 0) {
      c -= b;

    } else {
      a -= d;
    }
    turn++;
  }

  if (a > 0) {
    std::cout << "Yes";
  } else {
    std::cout << "No";
  }

  return EXIT_SUCCESS;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <regex>
#include <set>
#include <string>
#include <vector>

using namespace std;

struct Elem {
  int x;
  int y;
};

int main() {
  int a, b, c, d;
  std::cin >> a >> b >> c >> d;

  int turn = 0;
  while (a > 0 || c > 0) {
    if (turn % 2 == 0) {
      c -= b;

    } else {
      a -= d;
    }
  }

  if (a > 0) {
    std::cout << "Yes";
  } else {
    std::cout << "No";
  }

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

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int X = (A + D - 1) / D;
  int Y = (C + B - 1) / B;
  cout << (X >= Y ? "Yes" : "No") << "\\n";
}

Error: 1

Fixed submission:

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  while (true) {
    C -= B;
    if (C == 0) {
      cout << "Yes";
      return 1;
    }
    A -= D;
    if (A == 0) {
      cout << "No";
      return 1;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
  ll a, b, c, d, count = 1;
  cin >> a >> b >> c >> d;
  while (a > 0 && c > 0) {
    if (count % 2 != 0)
      c = c - b;
    else
      a = a - d;
    count++;
  }
  if (a <= 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
  ll a, b, c, d, count = 1;
  cin >> a >> b >> c >> d;
  while (a != 0 && c != 0) {
    if (count % 2 != 0)
      c = c - b;
    else
      a = a - d;
    count++;
  }
  if (a <= 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
using namespace std;

int main(void) {
  int A, B, C, D;
  scanf("%d %d %d %d", &A, &B, &C, &D);
  while (C > 0 && A > 0) {
    C = C - B;
    if (C <= 0)
      break;
    A = A - D;
    if (A <= 0)
      break;
  }
  if (C <= 0)
    printf("Yes");
  else if (A <= 0)
    printf("No");
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
using namespace std;

int main(void) {
  int A, B, C, D;
  scanf("%d %d %d %d", A, B, C, D);
  do {
    C = C - B;
    A = A - D;
  } while (C <= 0 && A <= 0);
  if (C <= A)
    printf("Yes");
  else
    printf("No");

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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define ml cout << endl

#define pii pair<ll, ll>
#define vi vector<ll>
#define vii vector<pii>
#define mi map<ll, ll>
#define all(a) (a).begin(), (a).end()

#define pb push_back
#define ff first
#define ss second
#define mod 1000000007

#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define test4(x, y, z, a)                                                      \\
  cout << "x is " << x << "		y is " << y << "		z is "              \\
       << z << "		a is " << a << endl;
#define test3(x, y, z)                                                         \\
  cout << "x is " << x << "		y is " << y << "		z is "            \\
       << z << endl;
#define test2(x, y) cout << "x is " << x << "		y is " << y << endl;
#define test1(x) cout << "x is " << x << endl;
// ll ans;

// ll dfs(vi v ,ll m ){
//   if(visited[])
// }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  // while(a!=0 && c!=0){
  //     c-=b;
  //     a-=d;
  // }
  ll ans = 0; // a/d + (a%d==0)? 0: 1 ;
  ll p = 0;   // c/b + (c%b==0)? 0: 1 ;
  while (a > 0) {
    a -= d;
    ans++;
  }
  while (c > 0) {
    c -= b;
    p++;
  }

  // test4(a,ans,c,p);
  if (ans < p) {
    no;
  } else {
    yes;
  }

  // string str;
  // cin>>str;
  // ll n= str.size();
  // ll ans=0;
  // rep(i,0,n){
  //   // test1(i);
  //     string s="";
  //     ll p=0;
  //     rep(j,i,n){
  //         s+= str[j];
  //         p = p*10 + str[j]-'0';
  //         // string w = s;
  //         // ll  p = stoi(w);
  //         // test1(p);
  //         if(p%2019==0){
  //             ++ans;
  //         }
  //     }
  // }
  // cout<<ans<<endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define ml cout << endl

#define pii pair<ll, ll>
#define vi vector<ll>
#define vii vector<pii>
#define mi map<ll, ll>
#define all(a) (a).begin(), (a).end()

#define pb push_back
#define ff first
#define ss second
#define mod 1000000007

#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define test4(x, y, z, a)                                                      \\
  cout << "x is " << x << "		y is " << y << "		z is "              \\
       << z << "		a is " << a << endl;
#define test3(x, y, z)                                                         \\
  cout << "x is " << x << "		y is " << y << "		z is "            \\
       << z << endl;
#define test2(x, y) cout << "x is " << x << "		y is " << y << endl;
#define test1(x) cout << "x is " << x << endl;
// ll ans;

// ll dfs(vi v ,ll m ){
//   if(visited[])
// }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  while (a != 0 && c != 0) {
    c -= b;
    a -= d;
  }
  if (c == 0) {
    yes;
  } else {
    no;
  }

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

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if ((A + D - 1) / D >= (C + B - 1) / B) {
    cout << "Yes" << endl;
  }

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


Error: TLE

Fixed submission:

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (true) {
    bool chokudai = false;
    for (int i = 0; i < 101; i++) {
      A -= B;
      C -= D;
      if (A < 0) {
        chokudai = true;
      }
      if (C < 0) {
        chokudai = true;
      }
      if (A < C) {
        cout << "Yes" << endl;
      } else if (A > C) {
        cout << "No" << endl;
      }
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

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

  int a, b, c, d, x, y;
  cin >> a >> b >> c >> d;

  if (a % d == 0) {

    x = a / d;

  } else {

    x = (a / d) + 1;
  }

  if (c % b == 0) {

    y = c / b;

  } else {

    y = (c / b) + 1;
  }

  if (x >= y) {

    cout << "Yes"
         << "\\n";

  } else {

    cout << "No"
         << "\\n";
  }
}


Error: TLE

Fixed submission:

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

  int a, b, c, d, x = 0;

  cin >> a >> b >> c >> d;

  while (a != 0 or c != 0) {

    x++;

    if (x % 2 != 0) {

      a = a - d;

    } else {

      c = c - b;
    }
  }

  if (c == 0) {

    cout << "Yes"
         << "\\n";

  } else {

    cout << "No"
         << "\\n";
  }
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

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

#define print(a)                                                               \\
  {                                                                            \\
    for (auto xxxxx : (a))                                                     \\
      cout << xxxxx << ' ';                                                    \\
    cout << '\\n';                                                              \\
  }
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

ll next() {
  ll x;
  cin >> x;
  return x;
}
const int maxn = 1e5 + 3, intf = 2e9;
const ll inf = 2e18, mod = 998244353;
const ld eps = 1e-6;

void solve() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  swap(a, b);
  swap(c, d);
  if ((b + c - 1) / c < (d + a - 1) / a) {
    cout << "No\\n";
  } else {
    cout << "Yes\\n";
  }
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);

  for (int t = 1; t--;) {
    solve();
  }

  return 0;
}
/*


*/


Error: 0

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

#define print(a)                                                               \\
  {                                                                            \\
    for (auto xxxxx : (a))                                                     \\
      cout << xxxxx << ' ';                                                    \\
    cout << '\\n';                                                              \\
  }
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

ll next() {
  ll x;
  cin >> x;
  return x;
}
const int maxn = 1e5 + 3, intf = 2e9;
const ll inf = 2e18, mod = 998244353;
const ld eps = 1e-6;

void solve() {
  int a, b, c, d;
  cin >> a >> b;
  swap(a, b);
  swap(c, d);
  if ((b + c - 1) / c < (d + a - 1) / a) {
    cout << "Yes\\n";
  } else {
    cout << "No\\n";
  }
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);

  for (int t = 1; t--;) {
    solve();
  }

  return 0;
}
/*


*/
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, m, i, j, k, x, y, z, sum = 0;
  cin >> n >> m >> x >> y;
  i = 0;
  if (n % y == 0) {
    k = n / y;
  } else {
    k = n / y + 1;
  }
  if (x % m == 0) {
    j = x / m;
  } else {
    j = x / m + 1;
  }
  if (k >= j) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, m, i, j, k, x, y, z, sum = 0;
  cin >> n >> m >> x >> y;
  i = 0;
  while (n != 0 && x != 0) {
    if (i % 2 == 0) {
      x = x - m;
    } else {
      n = n - y;
    }
    i++;
  }
  if (n == 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
signed main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  int x = a / d;
  if (a % d != 0) {
    x++;
  }
  int y = c / b;
  if (c % b != 0) {
    y++;
  }
  if (x >= y) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

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

  while (a != 0 or b != 0) {
    a = a - d;
    c = c - b;
  }
  if (a > c) {
    cout << "Yes" << endl;
  } else {
    cout << "No";
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (1) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      return 0;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  return 0;
}

Error: TLE

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (1) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
    }
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (true) {
    C -= B;
    if (C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    A -= D;
    if (A <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (true) {
    D -= A;
    if (C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    B -= C;
    if (A <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iomanip>
#include <iostream>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <vector>
// #include <bits/stdc++.h> all

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10, 9);
// double pi = 3.141592653589793238463;

int main(void) {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  for (int i = 0;; i++) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      a -= d;
      if (a <= 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iomanip>
#include <iostream>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <vector>
// #include <bits/stdc++.h> all

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10, 9);
// double pi = 3.141592653589793238463;

int main(void) {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  for (int i = 0;; i++) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
    } else {
      a -= d;
      if (a <= 0) {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

int main() {

  int a, b, c, d, k = 0;

  cin >> a >> b >> c >> d;

  while (1) {
    a = (a - d);
    c = (c - b);
    if (c <= 0) {
      k = 1;
      break;
    }
    if (a <= 0) {
      k = 0;
      break;
    }
  }
  if (k)
    cout << "Yes\\n";

  else
    cout << "No\\n";

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {

  int a, b, c, d, k = 0;

  cin >> a >> b >> c >> d;

  while (1) {
    a = (a - d);
    c = (c - b);
    if (a > 0 && c <= 0) {
      k = 1;
      break;
    }
    if (c > 0 && a <= 0) {
      k = 0;
      break;
    }
  }
  if (k)
    cout << "Yes\\n";

  else
    cout << "No\\n";

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (a > 0 && c > 0) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, ha, ht;
  cin >> a >> b >> c >> d;
  while (ht > 0 && ha > 0) {
    ha = (c - b);
    if (ha <= 0) {
      cout << "Yes" << endl;
      break;
    }
    ht = (a - d);
    if (ht <= 0) {
      cout << "No" << endl;
      break;
    }
  }

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

//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <numeric>
#include <sstream>
//---------------------------------------------------------------
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define SIZE 100005
#define INF 1e18
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define vec vector
using pint = pair<int, int>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const double pi = acos(-1);
//---------------------------------------------------------------

// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

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

  bool ok;
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  int f = 1;
  while (a > 0 && c > 0) {
    if (f == 1) {
      c -= b;
      f = 0;
    } else {
      a -= d;
      f = 1;
    }
    if (a <= 0) {
      ok = false;
      break;
    }
    if (c <= 0) {
      ok = true;
      break;
    }
  }

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

Error: TLE

Fixed submission:

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

  for (int c; c >= 0; c - b) {
    a = -d;
  }
  if (a > c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;

ll n, m, k, a, b, c, d;
string s, t;

int main() {
  cin >> a >> b >> c >> d;
  int cnt = 0;
  while (a > 0 && c > 0) {
    cnt % 2 == 0 ? c -= b : a -= d;
    cnt++;
  }
  cout << (cnt % 2 == 0 ? "No" : "Yes") << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;

ll n, m, k, a, b, c, d;
string s, t;

int main() {
  cin >> a >> b >> c >> d;
  int cnt = 0;
  while (a && c) {
    cnt % 2 == 0 ? c -= b : a -= d;
    cnt++;
  }
  cout << (cnt % 2 == 0 ? "No" : "Yes") << endl;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;

int main(int argc, char **argv) {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  bool t{true};

  while (1) {
    if (t)
      c -= b;
    else
      a -= d;

    if (a <= 0 || c <= 0)
      break;
    t ^= true;
  }
  std::cout << (t ? "Yes" : "No") << std::endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;

int main(int argc, char **argv) {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  bool t{true};

  while (1) {
    if (t)
      c -= b;
    else
      a -= d;

    if (a == 0 || c == 0)
      break;
    t ^= true;
  }
  std::cout << (t ? "Yes" : "No") << std::endl;
}