alexjercan/bugnet huggingface dataset:
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  ll a, b, c;
  cin >> a >> b >> c;

  ll k;
  cin >> k;

  while (k) {
    if (a >= b) {
      b = b * 2;
      k--;
    }
    if (a < b)
      break;
  }

  while (k) {
    if (b >= c) {
      c = c * 2;
      k--;
    }
    if (b < c)
      break;
  }

  if (a < b && b < c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  ll a, b, c;
  cin >> a >> b >> c;

  ll k;
  cin >> k;

  while (k) {
    if (a > b) {
      b = b * 2;
      k--;
    }
    if (a < b)
      break;
  }

  while (k) {
    if (b > c) {
      c = c * 2;
      k--;
    }
    if (b < c)
      break;
  }

  if (a < b && b < c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int K;
  cin >> K;
  while (K) {
    if (A >= B) {
      B *= 2;
      K--;
    } else
      break;
  }
  while (K) {
    if (B >= C) {
      C *= 2;
      K--;
    } else
      break;
  }
  if (A < B && B < C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Error: TLE

Fixed submission:

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int K;
  cin >> K;
  while (K) {
    if (A >= B) {
      B *= 2;
      K--;
    } else
      break;
  }
  while (K) {
    if (B >= C) {
      C *= 2;
      K--;
    }
  }
  if (A < B && B < C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <string>
#include <vector>

typedef long long ll;

#define vi std::vector<int>
#define vl std::vector<ll>
#define floop(n) for (int i = 0; i < n; ++i)
#define print(x) std::cout << x << std::endl;

const ll INF = 1e18;

int main() {
  int A, B, C, K, res = 0, temp;
  std::cin >> A >> B >> C;
  std::cin >> K;

  while (A >= B) {
    K--;
    B *= 2;
  }

  if (K < 0) {
    print("No");
    return 0;
  }

  while (B >= C) {
    K--;
    C *= 2;
  }

  if (K < 0) {
    print("No");
  }

  else {
    print("Yes");
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <string>
#include <vector>

typedef long long ll;

#define vi std::vector<int>
#define vl std::vector<ll>
#define floop(n) for (int i = 0; i < n; ++i)
#define print(x) std::cout << x << std::endl;

const ll INF = 1e18;

int main() {
  int A, B, C, K;
  std::cin >> A >> B >> C;
  std::cin >> K;

  while (K > 0) {
    if (A > B) {
      B *= 2;
      K--;
      continue;
    }

    if (B > C) {
      C *= 2;
      K--;
    }

    if (A < B && B < C)
      break;
  }

  if (A < B && B < C) {
    print("Yes");
  }

  else
    print("No");

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

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */

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

typedef long long ll;
class BMagic2 {
public:
  void solve(std::istream &cin, std::ostream &cout) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    for (int i = 0; i <= 999; i++) {
      int x = i;
      int d3 = x % 10;
      x = x / 10;
      int d2 = x % 10;
      x = x / 10;
      int d1 = x % 10;

      if (d3 + d2 + d1 > k) {
        continue;
      }
      int a1 = a;
      int b1 = b;
      int c1 = c;

      while (d1 > 0) {
        a1 *= 2;
        d1--;
      }
      while (d2 > 0) {
        b1 *= 2;
        d2--;
      }
      while (d3 > 0) {
        c1 *= 2;
        d3--;
      }
      if (c1 > b1 && b1 > a1) {
        cout << "Yes" << endl;
        return;
      }
    }

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

int main() {
  BMagic2 solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}


Error: TLE

Fixed submission:

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */

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

typedef long long ll;
class BMagic2 {
public:
  void solve(std::istream &cin, std::ostream &cout) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    while (k != 0) {
      while (c < b && k > 0) {
        c *= 2;
        k--;
      }
      while (b < a && k > 0) {
        b *= 2;
        k--;
      }

      if (c > b && b > a) {
        cout << "Yes" << endl;
        return;
      }
    }

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

int main() {
  BMagic2 solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP1(i, n) for (int i = 1; i < n + 1; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  int n = 0;
  int m = 0;
  REP1(i, INF) {
    if (b > a) {
      n = i;
      break;
    }
    b = b * 2;
  }
  // cout << b << endl;
  REP1(j, INF) {
    if (c > b) {
      m = j;
      break;
    }
    c = c * 2;
  }
  // cout << n << m << endl;
  if (n + m - 2 <= k)
    cout << "Yes" << endl;

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


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP1(i, n) for (int i = 1; i < n + 1; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  int n, m;
  REP1(i, INF) {
    if (pow(b, i) > a) {
      n = i;
      break;
    }
  }
  b = pow(b, n);
  REP1(j, INF) {
    if (pow(c, j) > b) {
      m = j;
      break;
    }
  }
  // cout << n << m << endl;
  if (n + m - 2 <= k)
    cout << "Yes" << endl;

  else
    cout << "No" << endl;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int k;
  cin >> k;
  while (k) {
    while (a >= b and k > 0) {
      b *= 2;
      k--;
    }
    if (k < 1) {
      break;
    }
    while (c >= b && k > 0) {
      c *= 2;
      k--;
    }
  }
  if (a < b && b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1000000007;
const ll INF = 1LL << 60;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int k;
  cin >> k;

  if (a < b && b < c) {
    cout << "Yes" << endl;
    return 0;
  }

  while (0 < k) {
    if (b <= a) {
      b *= 2;
      k--;
    }
    if (a < b)
      break;
  }

  if (a < b && b < c) {
    cout << "Yes" << endl;
    return 0;
  }

  while (0 < k) {
    if (c <= b) {
      c *= 2;
      k--;
    }
    if (b < c)
      break;
  }

  if (a < b && b < c) {
    cout << "Yes" << endl;
    return 0;
  }

  cout << "No" << endl;

  return 0;
}


Error: TLE

Fixed submission:

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1000000007;
const ll INF = 1LL << 60;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int k;
  cin >> k;

  if (a < b && b < c) {
    cout << "Yes" << endl;
    return 0;
  } else {
    while (0 < k) {
      if (c < b) {
        c *= 2;
        k--;
      }
      if (a < b && b < c) {
        cout << "Yes" << endl;
        return 0;
      }
      if (b < a) {
        b *= 2;
        k--;
      }
      if (a < b && b < c) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;

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

#include <bits/stdc++.h>
#include <cstdio>
#include <fstream>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(n);
// string p=s.substr(0,len);
// string q=s.insert(0,str);
// sort(arr, arr+n, greater<int>());
// cout<<fixed<<setprecision(9)<<pi<<endl
// const  double pi = acos(-1.0);
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll, ll>
#define mlli map<ll, ll>::iterator
#define size size()
#define endl "\\n"
#define ll long long int
#define ld long double
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

int main(void) {
  fast();
  int r, g, b;
  cin >> r >> g >> b;
  int k;
  cin >> k;
  int a[3];
  a[0] = b;
  a[1] = g;
  a[2] = r;
  while (k > 0) {
    if (a[0] > a[1] && a[1] > a[2]) {
      break;
    }

    int x = min(a[0], a[1]);

    int y = min(a[1], a[2]);

    if (x == a[0]) {
      a[0] = a[0] * 2;
      k--;
    } else if (y == a[1]) {
      a[1] = a[1] * 2;
      k--;
    }
  }

  if (a[0] > a[1] && a[1] > a[2]) {
    cout << "Yes" << endl;
  } else {
    // cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
    cout << "No" << endl;
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <cstdio>
#include <fstream>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(n);
// string p=s.substr(0,len);
// string q=s.insert(0,str);
// sort(arr, arr+n, greater<int>());
// cout<<fixed<<setprecision(9)<<pi<<endl
// const  double pi = acos(-1.0);
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll, ll>
#define mlli map<ll, ll>::iterator
#define size size()
#define endl "\\n"
#define ll long long int
#define ld long double
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

int main(void) {
  fast();
  int r, g, b;
  cin >> r >> g >> b;
  int k;
  cin >> k;
  int a[3];
  a[0] = b;
  a[1] = g;
  a[2] = r;
  while (k > 0) {
    int x = min(a[0], a[1]);

    int y = min(a[1], a[2]);

    if (x == a[0]) {
      a[0] = a[0] * 2;
      k--;
    } else if (y == a[1]) {
      a[1] = a[1] * 2;
      k--;
    }
  }
  if (a[0] > a[1] && a[1] > a[2]) {
    cout << "Yes" << endl;
  } else {
    // cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
    cout << "No" << endl;
  }
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int main() {
  int a, b, c, k;
  cin >> a >> b >> c;
  cin >> k;
  REP(i, k) {
    if (a < b && b < c)
      break;
    if (b <= a) {
      b *= 2;
      continue;
    }
    if (c <= b) {
      c *= 2;
      continue;
    }
  }

  if (a < b && b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int main() {
  int a, b, c, k;
  cin >> a >> b >> c;
  cin >> k;
  while (k > 0) {
    if (a < b && b < c)
      break;
    if (b < a) {
      b *= 2;
      k--;
    } else if (c < b) {
      c *= 2;
      k--;
    }
  }

  if (a < b && b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

// #include<bits/stdc++.h>
#include <iostream>

#define ll long long
#define uint unsigned int
#define ld long double
#define SAM                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define mod 1000000007
#define mxn 200005
#define pb push_back
#define pii pair<int, int>
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()

using namespace std;

int main() {
  SAM;
  int a, b, c, k;
  cin >> a >> b >> c >> k;

  if (c > b && b > a) {
    cout << "Yes";
    return 0;
  }

  int count = 0;
  while (b <= a) {
    b *= 2;
    count++;
  }
  while (c <= b) {
    c *= 2;
    count++;
  }

  if (count <= k)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}


Error: TLE

Fixed submission:

// #include<bits/stdc++.h>
#include <iostream>

#define ll long long
#define uint unsigned int
#define ld long double
#define SAM                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define mod 1000000007
#define mxn 200005
#define pb push_back
#define pii pair<int, int>
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()

using namespace std;

int main() {
  SAM;
  int a, b, c, k;
  cin >> a >> b >> c >> k;

  if (c > b && b > a) {
    cout << "Yes";
    return 0;
  }

  while (true) {
    if (b < a) {
      b *= 2;
      k--;
    }
    if (k == 0 || (c > b && b > a))
      break;
    if (c < b) {
      c *= 2;
      k--;
    }
    if (k == 0 || (c > b && b > a))
      break;
  }

  if (k >= 0 && c > b && b > a)
    cout << "Yes";
  else
    cout << "No";

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

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define ll long long int

int main() {
  int a, b, c;
  int k;
  cin >> a >> b >> c;
  cin >> k;
  int i = 0, x = 0;
  int flag = 0;
  while (i < k) {
    if (x == 0) {
      if (b <= a) {
        b *= 2;
        i++;
      }
      if (b > a) {
        x = 1;
      }
    } else if (x == 1) {
      if (c <= b) {
        c *= 2;
        i++;
      }
      if (c > b) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define ll long long int

int main() {
  int a, b, c;
  int k;
  cin >> a >> b >> c;
  cin >> k;
  int i = 0, x = 0;
  int flag = 0;
  while (i < k) {
    if (x == 0) {
      if (b <= a) {
        b *= 2;
        i++;
      }
      if (b > a) {
        x = 1;
      }
    } else if (x == 1) {
      if (c <= b) {
        c *= 2;
        i++;
      }
      if (c > b) {
        flag = 1;
      }
    }
  }
  if (flag == 1)
    cout << "Yes";
  else
    cout << "No";

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

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

using namespace std;

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

  while (true) {
    if (K == 0)
      break;
    if (A >= B) {
      B *= 2;
      K--;
    }

    if (K == 0)
      break;
    if (B >= C) {
      C *= 2;
      K--;
    }
    if (A < B && B < C)
      break;
  }

  if (A < B && B < C)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}

Error: TLE

Fixed submission:

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

using namespace std;

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

  while (true) {
    if (K == 0)
      break;
    if (A > B) {
      B *= 2;
      K--;
    }
    if (K == 0)
      break;
    if (B > C) {
      C *= 2;
      K--;
    }
    if (A < B && B < C)
      break;
  }

  if (A < B && B < C)
    cout << "Yes";
  else
    cout << "No";

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

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

int flag = 0;

int check(int red, int green, int blue, int count, int limit) {
  if (red < green && green < blue) {
    flag = 1;
    return flag;
  }

  if (count <= limit && flag == 0)
    check(red * 2, green, blue, count + 1, limit);
  if (count <= limit && flag == 0)
    check(red, green * 2, blue, count + 1, limit);
  if (count <= limit && flag == 0)
    check(red, green, blue * 2, count + 1, limit);

  return flag;
}

int main(void) {
  int count = 0;
  int red, green, blue;
  int limit;
  cin >> red >> green >> blue;
  cin >> limit;
  flag = check(red, green, blue, count + 1, limit);
  if (flag == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Error: -11

Fixed submission:

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

int check(int red, int green, int blue, int count, int limit, int flag) {
  if (count == limit && green > red && blue > green) {
    flag = 1;
    cout << "Yes" << endl;
  }
  if (count != limit)
    check(red * 2, green, blue, count++, limit, flag);
  if (count != limit)
    check(red, green * 2, blue, count++, limit, flag);
  if (count != limit)
    check(red, green, blue * 2, count++, limit, flag);

  return flag;
}

int main(void) {
  int count = 0;
  int flag = 0;
  int red, green, blue;
  int limit;
  cin >> red >> green >> blue;
  cin >> limit;
  if (check(red, green, blue, count, limit, flag) == 0)
    cout << "No" << endl;
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <vector>
using namespace std;
#define rep(N) for (int i = 0; i < N; i++)
#define p(num) printf("%d", num)
#define s(in) scanf("%d", &in)

int main() {
  int A, B, C, K, c = 0;
  bool judge = false;
  cin >> A >> B >> C >> K;
  for (; c < K;) {

    if (C >= B) {
      if (C == B) {
        C *= 2;
        c++;
      } else if (B <= A) {
        B *= 2;
        c++;
      }
    } else if (B > C) {
      C *= 2;
      c++;
    } else if (B < A) {
      B *= 2;
      c++;
    }

    if (B > A && C > B) {
      cout << "Yes" << endl;
      judge = true;
      break;
    }
  }
  if (!judge)
    cout << "No" << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <vector>
using namespace std;
#define rep(N) for (int i = 0; i < N; i++)
#define p(num) printf("%d", num)
#define s(in) scanf("%d", &in)

int main() {
  int A, B, C, K, c = 0;
  bool judge = false;
  cin >> A >> B >> C >> K;
  for (; c < K;) {

    if (C > B) {
      if (B <= A)
        B *= 2;
      c++;

    } else if (B > C) {
      C *= 2;
      c++;
    } else if (B < A) {
      B *= 2;
      c++;
    }

    if (B > A && C > B) {
      cout << "Yes" << endl;
      judge = true;
      break;
    }
  }
  if (!judge)
    cout << "No" << endl;
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

int main() {
  int a, b, c, k;

  cin >> a >> b >> c >> k;

  while (k > 0) {
    if (c <= b || c <= a) {
      c *= 2;
      k--;
    }

    else if (b <= a) {
      b *= 2;
      k--;
    } else if (c > b && b > a) {
      break;
    }
  }

  (c > b && b > a) ? cout << "Yes" << endl : cout << "No" << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  int a, b, c, k;

  cin >> a >> b >> c >> k;

  while (k > 0) {
    if (c <= b || c <= a) {
      c *= 2;
      k--;
    }

    else if (b <= a) {
      b *= 2;
      k--;
    }
  }

  (c > b && b > a) ? cout << "Yes" << endl : cout << "No" << endl;

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

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main(void) {
  int a, b, c;
  cin >> a >> b >> c;

  int k;
  cin >> k;

  while (a >= b) {
    k--;
    b = b * 2;
    if (b > a)
      break;
  }

  while (b >= c) {
    k--;
    c = 2 * c;

    if (c > b)
      break;
  }

  if (k >= 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Error: -8

Fixed submission:

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main(void) {
  long long n, k;
  cin >> n >> k;

  long long temp = 1;
  vector<long long> a(n);
  for (int i = 0; i < n; i++)
    cin >> a[i];
  vector<long long> record(n);

  for (int i = 0; i < k; i++)
    temp = temp * a[i];

  record[k - 1] = temp;

  for (int i = k; i < n; i++) {
    temp = temp / a[i - k];
    temp = temp * a[i];
    record[i] = temp;

    if (record[i - 1] < record[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}