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

#include <iostream>
#include <stdio.h>
// #include <bits/stdc++.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <float.h>
#include <iomanip>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

#define INF 1e9
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) <= (int)(b); i++)
#define VEC(type, c, n)                                                        \\
  std::vector<type> c(n);                                                      \\
  for (auto &i : c)                                                            \\
    std::cin >> i;
#define vec(type, n) vector<type>(n)
#define vvec(m, n) vector<vector<int>>(int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

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

const int MOD = 1e9 + 7;

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  while (k--) {
    if (c > b && b > a)
      break;
    if (a >= b)
      b *= 2;
    else if (b >= c)
      c *= 2;
    // cout << a << " " << b << " " << c << endl;
  }
  cout << (c > b && b > a ? "Yes" : "No") << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
// #include <bits/stdc++.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <float.h>
#include <iomanip>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

#define INF 1e9
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) <= (int)(b); i++)
#define VEC(type, c, n)                                                        \\
  std::vector<type> c(n);                                                      \\
  for (auto &i : c)                                                            \\
    std::cin >> i;
#define vec(type, n) vector<type>(n)
#define vvec(m, n) vector<vector<int>>(int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

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

const int MOD = 1e9 + 7;

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if (a == 0 || b == 0 || c == 0) {
    if (c > b && b > a)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  while (1) {
    if (c > b && b > a)
      break;
    if (k <= 0)
      break;
    if (a > b) {
      b *= 2;
      k--;
    }
    if (k <= 0)
      break;
    if (b > c) {
      c *= 2;
      k--;
    }
    // cout << a << " " << b << " " << c << endl;
  }
  cout << (c > b && b > a ? "Yes" : "No") << endl;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#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;
  cin >> A >> B >> C;
  int K;
  cin >> K;
  int t = 0;
  while (t < K) {
    if (B <= A) {
      B *= 2;
      ++t;
    } else
      break;
  }
  while (t < K) {
    if (C <= B) {
      C *= 2;
      ++t;
    } else
      break;
  }
  if (A < B && B < C)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#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, K;
  cin >> A >> B >> C >> K;
  int t = 0;
  while (t < K) {
    if (B <= A) {
      B *= 2;
      ++t;
      continue;
    } else if (C <= B) {
      C *= 2;
      ++t;
      continue;
    }
  }
  if (A < B && B < C)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

{
  long long a, b, c, d, e, f, g, h, i, j, k, l = 0, m, n;

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

  if (a >= b) {
    for (i = 0;; i++) {
      b = b * 2;
      l++;
      if (b > a)
        break;
    }
  }
  if (b >= c) {
    for (i = 0;; i++) {
      c = c * 2;
      l++;
      if (c > b)
        break;
    }
  }
  if (l > k)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}


Error: TLE

Fixed submission:

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

{
  long long a, b, c, d, e, f, g, h, i, j, k, l = 0, m, n, flag = 0;

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

  while (1)

  {
    if (a >= b)

    {
      b = b * 2;
      l++;
      if (b > a)
        break;
    }
  }

  while (1) {
    if (b >= c) {
      c = c * 2;
      l++;
      if (c > b)
        break;
    }
  }
  if (l <= 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, k;
  int cnt = 0;
  cin >> a >> b >> c >> k;
  while (a >= b) {
    cnt += 1;
    b *= 2;
  }
  while (b >= c) {
    cnt += 1;
    c *= 2;
  }
  if (cnt <= k)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Error: TLE

Fixed submission:

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

#include <iostream>
using namespace std;

string solve(int a, int b, int c, int k) {
  if (c > b and b > a)
    return "Yes";

  while (b <= a and k > 0) {
    b *= 2;
    k--;
  }
  while (c <= b and k > 0) {
    c *= 2;
    k--;
  }
  if (c > b and b > a)
    return "Yes";
  return "No";
}
int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  cout << solve(a, b, c, k) << "\\n";
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

string solve(int a, int b, int c, int k) {
  if (c > b and b > a)
    return "Yes";

  while (k > 0) {
    if (b < a) {
      b *= 2;
      k--;
    } else if (c < b) {
      c *= 2;
      k--;
    }
    if (a < b and b < c)
      return "Yes";
  }
  return "No";
}
int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  cout << solve(a, b, c, k) << "\\n";
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Runtime Error

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

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

#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define x first
#define y second

const int MOD = 1e9 + 7;

void setIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  //    freopen((s+".in").c_str(),"r",stdin);
  //    freopen((s+".text").c_str(),"w",stdout);
}

// ctrl q is comment
// ctrl b is run
// ctrl s is compile
// alt r is search & replace
// alt d is delete a line

int main() {
  setIO();
  int a, b, c, K;
  cin >> a >> b >> c >> K;
  int k2 = K;
  bool ok = false;
  int p2[10];
  int p = 0, m = 1;
  p2[0] = 1;
  while (p < 9) {
    ++p;
    m *= 2;
    p2[p] = m;
  }
  K = k2;
  for (int i = 0; i < 7; ++i) {
    for (int j = 0; j < 7; ++j) {
      for (int k = 0; k < 7; ++k) {
        if (i + j + k > K)
          continue;
        int ra = a * p2[i];
        int rb = b * p2[j];
        int rc = c * p2[k];
        if (rb > ra && rc > rb) {
          ok = true;
        }
      }
    }
  }
  cout << (ok ? "Yes\\n" : "No\\n");
}

Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

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

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

#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define x first
#define y second

const int MOD = 1e9 + 7;

void setIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  //    freopen((s+".in").c_str(),"r",stdin);
  //    freopen((s+".text").c_str(),"w",stdout);
}

// ctrl q is comment
// ctrl b is run
// ctrl s is compile
// alt r is search & replace
// alt d is delete a line

int main() {
  setIO();
  int a, b, c, K;
  cin >> a >> b >> c >> K;
  int k2 = K;
  bool ok = false;
  int p2[10];
  int p = 0, m = 1;
  p2[0] = 1;
  while (p < 10) {
    ++p;
    m *= 2;
    p2[p] = m;
  }
  K = k2;
  for (int i = 0; i < 7; ++i) {
    for (int j = 0; j < 7; ++j) {
      for (int k = 0; k < 7; ++k) {
        if (i + j + k > K)
          continue;
        int ra = a * p2[i];
        int rb = b * p2[j];
        int rc = c * p2[k];
        if (rb > ra && rc > rb) {
          ok = true;
        }
      }
    }
  }
  cout << (ok ? "Yes\\n" : "No\\n");
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
  int A, B, C, K;
  cin >> A >> B >> C;
  cin >> K;
  while (K > 0) {
    if (A >= B) {
      B *= 2;
      K--;
      continue;
    }
    C *= 2;
    K--;
  }
  if (A < B && B < C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
  int A, B, C, K;
  cin >> A >> B >> C;
  cin >> K;
  if (A < B && B < C) {
    cout << "Yes" << endl;
    return 0;
  }
  while (K > 0) {
    if (A > B) {
      B *= 2;
      K--;
      continue;
    }
    if (B > C) {
      C *= 2;
      K--;
      continue;
    }
  }
  if (A < B && B < C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  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++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;

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

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

  if (a < b && b < c)
    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++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;

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

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

  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;

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

  for (i = 0; i < k; i++) {
    if (a >= b) {
      b *= 2;

    } else {
      break;
    }
  }
  for (; i < k; i++) {
    if (b >= c) {
      c *= 2;
    } 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;

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

  while (1) {
    if (a > b && k > 0) {
      b *= 2;
      k--;
    }
    if (b > c && k > 0) {
      c *= 2;
      k--;
    }
    if (a < b && b < c) {
      cout << "Yes" << endl;
      break;
    }
    if (k <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

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

typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e5 + 5, mod = 1e9 + 7;

void solve() {
  int r, g, b;
  cin >> r >> g >> b;
  int k;
  cin >> k;

  while (k) {
    if (g <= r) {
      g *= 2;
      --k;
    } else if (b <= g) {
      b *= 2;
      --k;
    }
    if (g > r && b > g) {
      break;
    }
  }

  if (g > r && b > g) {
    cout << "Yes\\n";
  } else {
    cout << "No\\n";
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--)
    solve();
  return 0;
}


Error: TLE

Fixed submission:

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

typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e5 + 5, mod = 1e9 + 7;

void solve() {
  int r, g, b;
  cin >> r >> g >> b;
  int k;
  cin >> k;

  while (k) {
    if (g <= r) {
      g *= 2;
      --k;
    } else if (b <= g) {
      b *= 2;
      --k;
    }
  }

  if (g > r && b > g) {
    cout << "Yes\\n";
  } else {
    cout << "No\\n";
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--)
    solve();
  return 0;
}
Problem p02601 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define fast                                                                   \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
typedef long long int ll;
#define forn(i, p, n)                                                          \\
  ;                                                                            \\
  for (long long i = p; i < n; ++i)

void solve() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if (c > b && b > a && c > a) {
    cout << "Yes";
    return;
  }
  forn(i, 0, k) {
    if (c <= b) {
      c = c * 2;
      continue;
    }
    if (c <= a) {
      c = c * 2;
      continue;
    }
    if (b <= a) {
      b = b * 2;
      continue;
    }
  }
  if (c > b && b > a && c > a) {
    cout << "Yes";
    return;
  }
  cout << "No";
}

int main() {
  fast;
  // int test;
  // cin >> test;
  // while(test--){
  solve();
  // 	cout<<"\\n";
  // }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define fast                                                                   \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
typedef long long int ll;
#define forn(i, p, n)                                                          \\
  ;                                                                            \\
  for (long long i = p; i < n; ++i)

void solve() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if (c > b && b > a && c > a) {
    cout << "Yes";
    return;
  }
  while (k) {
    if (c < b || c < a) {
      c = c * 2;
      k--;
      continue;
    }
    if (c > b && c > a) {
      if (b < a) {
        b = b * 2;
        k--;
      }
    }
  }
  if (c > b && b > a && c > a) {
    cout << "Yes";
    return;
  }
  cout << "No";
}

int main() {
  fast;
  // int test;
  // cin >> test;
  // while(test--){
  solve();
  // 	cout<<"\\n";
  // }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n + 1);
  rep(i, n) {
    ll ai;
    cin >> ai;
    a[i + 1] = ai;
  }
  for (int i = k + 1; i <= n; i++) {
    int left = a[i - k], right = a[i];
    if (left < right)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


Error: 0

Fixed submission:

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

int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> ar(n + 1);
  ar[0] = 1;
  rep(i, n) {
    ll a;
    cin >> a;
    ar[i + 1] = ar[i] * a;
  }
  for (int i = k + 1; i <= n; i++) {
    ll left = ar[i - 1] / ar[i - k - 1];
    ll right = ar[i] / ar[i - k];
    if (left < right)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int, int> P;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < (b); i++)
#define repr(i, b, a) for (int i = int(b); i >= (a); i--)
#define all(x) x.begin(), x.end()

const ll mod = 1e9 + 7;
const ll INF = 1e9;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool valid(int lx, int ux, int ly, int uy, int x, int y) {
  return lx <= x && x < ux && ly <= y && y < uy;
}
ll power(ll x, ll p) {
  if (p == 0)
    return 1;
  ll res = power(x * x % mod, p / 2);
  if (p % 2 == 1)
    res = res * x % mod;
  return res;
}

int main() {
  int n, k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  // ll p=1LL;
  // rep(i,k)p*=a[i];

  repi(i, k, n) {
    // ll tmp=p*a[i];
    // tmp/=a[i-k];
    if (a[i] > a[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    // p=tmp;
  }
  return 0;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int, int> P;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < (b); i++)
#define repr(i, b, a) for (int i = int(b); i >= (a); i--)
#define all(x) x.begin(), x.end()

const ll mod = 1e9 + 7;
const ll INF = 1e9;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool valid(int lx, int ux, int ly, int uy, int x, int y) {
  return lx <= x && x < ux && ly <= y && y < uy;
}
ll power(ll x, ll p) {
  if (p == 0)
    return 1;
  ll res = power(x * x % mod, p / 2);
  if (p % 2 == 1)
    res = res * x % mod;
  return res;
}

int main() {
  int n, k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  vector<ll> sum(n + 1);
  sum[0] = 1LL;
  rep(i, n) sum[i + 1] = sum[i] * a[i];

  ll p = sum[k];
  repi(i, k, n) {
    if (sum[i + 1] / sum[i + 1 - k] > p)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    p = sum[i + 1] / sum[i + 1 - k];
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

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

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> ii;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(vs) (ll)(vs.size())
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define rep_(i, a, b) for (ll i = a; i > b; --i)
#define iter(i, c) for (auto i : c)
#define endl '\\n'
const ll mod = 1e9 + 7;

const ll maxn = 2e6 + 5;

ll n, k;
ll a[maxn];

void solve() {
  cin >> n >> k;
  rep(i, 0, n) cin >> a[i];
  rep(i, k, n) {
    if (a[i] > a[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

void aux() {}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(10);
  aux();
  ll _ = 1;
  // cin>>_;
  while (_--) {
    solve();
  }
  return 0;
}

Error: 0

Fixed submission:

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

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> ii;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(vs) (ll)(vs.size())
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define rep_(i, a, b) for (ll i = a; i > b; --i)
#define iter(i, c) for (auto i : c)
#define endl '\\n'
const ll mod = 1e9 + 7;

const ll maxn = 1e5;

ll n, k;
ll a[maxn];

void solve() {
  cin >> n >> k;
  rep(i, 0, n) cin >> a[i];
  rep(i, k, n) {
    if (a[i] > a[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

void aux() {}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(10);
  aux();
  ll _ = 1;
  // cin>>_;
  while (_--) {
    solve();
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long
#define pp pair<int, int>
#define ppn pair<pp, int>
#define F first
#define S second
#define N 200005
#define mod 1000000007
#define pi 3.14159265358979323846

using namespace std;

int main() {

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

  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    // if(i<k)x*=a[i];
  }
  // ll u = x;
  for (int i = k, j = 0; i < n; i++, j++) {
    // cout<<a[i]<<" "<<a[j]<<endl;

    if (a[i] > a[j])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
#define pp pair<int, int>
#define ppn pair<pp, int>
#define F first
#define S second
#define N 200005
#define mod 1000000007
#define pi 3.14159265358979323846

using namespace std;

int main() {

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

  int n, k;
  cin >> n >> k;
  ll a[n];
  ll x = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    // if(i<k)x*=a[i];
  }
  // ll u = x;
  for (int i = k, j = 0; k < n && j < k; i++, j++) {
    // cout<<a[i]<<" "<<a[j]<<endl;

    if (a[i] > a[j])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = k; i < n; ++i) {
    if (a[i - k] < a[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}

Error: 0

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  vector<ll> mul(n + 1);
  mul[0] = 1;
  mul[1] = a[1];
  for (int i = 2; i <= n; ++i) {
    mul[i] = mul[i - 1] * a[i];
  }
  for (int i = k + 1; i <= n; ++i) {
    if (mul[i - 1] / mul[i - 1 - k] < mul[i] / mul[i - k]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
int vec[200005];

int32_t main() {
  int n, k;
  cin >> n >> k;

  vec[0] = 1;
  vector<int> res;

  int a, ans = 1;

  for (int i = 1; i <= n; i++) {
    cin >> vec[i];
  }

  for (int i = k + 1; i <= n; i++) {

    // cout<<i<<" "<<i-k<<endl;
    if (vec[i] > vec[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
int vec[2000005];

int32_t main() {
  int n, k;
  cin >> n >> k;

  vec[0] = 1;
  vector<int> res;

  int a, ans = 1;

  for (int i = 1; i <= n; i++) {
    cin >> a;
    vec[i] = vec[i - 1] * a;
  }

  for (int i = k; i <= n; i++) {

    // cout<<i<<" "<<i-k<<endl;
    int temp = vec[i] / vec[i - k];
    // cout<<temp<<endl;
    res.push_back(temp);
  }

  for (int i = 1; i < res.size(); i++) {

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

  return 0;
}