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

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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end())
#define printArray(arr)                                                        \\
  for (int i = 0; i < size(arr); i++)                                          \\
    cout << arr[i] << " ";                                                     \\
  cout << '\\n'
#define printVerdict(verdict) cout << (verdict ? "Yes" : "No") << '\\n'
#define printDecimal(d) printf("%.9f\\n", d)
#define inrange(val, start, end) (val >= start && val <= end)

const ll inf = 0x3f3f3f3f;

template <class T1, class T2, class T3> void printTuple(tuple<T1, T2, T3> t) {
  cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\\n';
}
template <class T1, class T2> void printPair(pair<T1, T2> p) {
  cout << p.first << " " << p.second << '\\n';
}

int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  ll a[n];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  int ptr1 = 0;
  ll prod = 1;
  for (int i = 0; i < k; i++)
    prod *= a[i];
  for (int i = k; i < n; i++) {
    bool verdict = a[i] > a[ptr1];
    printVerdict(verdict);
    prod = prod / a[ptr1] * a[i];
    ptr1++;
  }
}


Error: 0

Fixed submission:

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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end())
#define printArray(arr)                                                        \\
  for (int i = 0; i < size(arr); i++)                                          \\
    cout << arr[i] << " ";                                                     \\
  cout << '\\n'
#define printVerdict(verdict) cout << (verdict ? "Yes" : "No") << '\\n'
#define printDecimal(d) printf("%.9f\\n", d)
#define inrange(val, start, end) (val >= start && val <= end)

const ll inf = 0x3f3f3f3f;

template <class T1, class T2, class T3> void printTuple(tuple<T1, T2, T3> t) {
  cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\\n';
}
template <class T1, class T2> void printPair(pair<T1, T2> p) {
  cout << p.first << " " << p.second << '\\n';
}

int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  ll a[n], pref[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (!i)
      pref[i] = a[i];
    else
      pref[i] = a[i] * pref[i - 1];
  }
  vector<ll> ret;
  ret.push_back(pref[k - 1]);
  for (int i = k; i < n; i++) {
    ll temp = pref[i] / pref[i - k];
    printVerdict(temp > ret.back());
    ret.push_back(temp);
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <assert.h>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string.h>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
const int mxn = 2e5 + 10;
int a[mxn];

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> a[i];

  for (int i = k + 1; i <= n; i++) {
    if (a[i] > a[i - k])
      cout << "Yes\\n";
    else
      cout << "No\\n";
  }

  return 0;
}

Error: 0

Fixed submission:

#include <algorithm>
#include <assert.h>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string.h>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
const int mxn = 1e5 + 10;
int a[mxn];

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> a[i];

  for (int i = k + 1; i <= n; i++) {
    if (a[i] > a[i - k])
      cout << "Yes\\n";
    else
      cout << "No\\n";
  }

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

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

int main() {

  int N, K;

  cin >> N >> K;

  vector<long long int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int i = 0; i < N - K; i++) {
    if (A[i] < A[i + K]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}


Error: 0

Fixed submission:

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

int main() {

  int N, K;

  cin >> N >> K;

  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  vector<long long int> ten(N);

  for (int i = 0; i < N; i++) {
    if (i < N - K - 2) {
      ten[i] = 0;
    } else {
      ten[i] = 1;
      for (int j = i; j >= i - K + 1; j--) {
        ten[i] *= A[j];
      }
    }
  }

  for (int i = K; i < N; i++) {
    if (ten[i] > ten[i - 1]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>
using namespace std;
const long long Maxn = 4000000 + 10;
long long n, k;
long long a[Maxn];
int main() {
  //	freopen("in.txt","r",stdin);
  cin >> n >> k;
  for (long long i = 1; i <= n; ++i)
    cin >> a[i];
  for (long long i = k + 1; i <= n; ++i) {
    if (a[i - k] < a[i])
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}

Error: 0

Fixed submission:

#include <cstdio>
#include <iostream>
using namespace std;
const long long Maxn = 4000000 + 10;
long long n, k;
long long a[Maxn], s[Maxn];
int main() {
  cin >> n >> k;
  s[0] = 1;
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
    s[i] = s[i - 1] * a[i];
  }
  for (long long i = k + 1; i <= n; ++i) {
    if (s[i - 1] / s[i - k - 1] < s[i] / s[i - k])
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> v;
  int a[n], s = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - k; i++) {
    if (a[i] < a[i + k]) {
      cout << "Yes"
           << "\\n";
    } else {
      cout << "No"
           << "\\n";
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n, k;
  cin >> n >> k;
  vector<ll> v;
  ll x, a[n];
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll q;
  q = n - k;
  ll p = 1;
  for (ll i = 0; i < n - k + 1; i++) {
    p = 1;
    for (ll j = i; j < k + i; j++) {
      p = p + a[j];
    }
    // cout<<p<<"\\n";
    v.push_back(p);
  }
  // cout<<v.size();
  int flag = 1;
  for (ll i = 0; i < v.size() - 1; i++) {
    // cout<<v[i]<<" ";
    if (v[i + 1] > v[i]) {
      cout << "Yes"
           << "\\n";
    } else {
      cout << "No"
           << "\\n";
    }
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {

  int n, k;
  scanf("%d %d", &n, &k);

  long long int input[n];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &input[i]);
  }

  for (int i = 0; i < n - k; i++) {
    if (input[i] < input[i + k]) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}


Error: 0

Fixed submission:

#include <stdio.h>

int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int angka[10000] = {0};

  for (int i = 0; i < n; i++) {
    scanf("%d", &angka[i]);
  }
  for (int i = 0; i < n - k; i++) {
    if (angka[i] < angka[k + i]) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int n, k, flag = 0;
  scanf("%d %d", &n, &k);
  int p = k, c = n - k;
  int a[n];
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);
  for (int i = 0; i < c; i++) {
    int s1, s2;
    s1 = a[p - k];
    s2 = a[p];
    p++;

    if (s1 < s2)
      printf("Yes\\n");
    else
      printf("No\\n");
  }

  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
#include <vector>
using namespace std;
long long a[2000];
long long money = 1000;
long long num = 0;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> a[i];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (a[i] != a[i - 1]) {
      v.push_back(a[i]);
    }
  }
  int len = v.size();
  int flag;

  if (v[1] > v[0])
    flag = 1;
  else
    flag = -1;

  if (flag == 1) {
    num = 1000 / v[0];
    money = 1000 - num * v[0];
  }
  bool f = true;
  for (int i = 1; i < len; i++) {
    int temp;
    if (v[i] > v[i - 1]) {
      temp = 1;
    } else {
      temp = -1;
    }
    if (temp != flag) {
      f = false;
      if (flag == 1) { // 卖
        money += num * v[i - 1];
        num = 0;
      }
      if (flag == -1) { // 买
        num = money / v[i - 1];
        money = money - num * v[i - 1];
      }
      flag = -flag;
    }
  }
  if (f == true) {
    if (flag == 1)
      cout << 1000 - 1000 / v[0] * v[0] + 1000 / v[0] * v[len - 1] << endl;
    if (flag == -1)
      cout << 1000 << endl;
  } else {
    if (flag == 1)
      money += num * v[len - 1];
    cout << money << endl;
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

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

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


Error: -11

Fixed submission:

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

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

#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#define ll long long
int main() {
  ll n, k;
  cin >> n >> k;
  ll a[n];
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (ll i = 0; i < n - k; i++) {
    if (a[i] < a[i + k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


Error: 0

Fixed submission:

#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#define ll long long
int main() {
  ll n, k;
  cin >> n >> k;
  ll a[n], m[n];
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      m[i] = a[i];
    else
      m[i] = a[i] * m[i - 1];
  }
  ll pre = 1;
  for (ll i = k - 1; i < n; i++) {
    if (i == k - 1) {
      pre = m[i];
    } else {
      if ((m[i] / m[i - k]) > pre)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      pre = (m[i] / m[i - k]);
    }
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

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

#define rep(i, n) for (ll i = 0; i < n; i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define REP(i, n) for (ll i = 1; i < n; i++)
#define PER(i, n) for (ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\\n" : "No\\n")
#define endl '\\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 62) - 1;
ll ceil(const ll &a, const ll &b) { return ((a) + (b)-1) / b; }
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;
}

int main() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  rep(i, n) cin >> a[i];
  for (int i = k; i < n; i++) {
    YesorNo(a[i - k] < a[i]);
  }
}

Error: WA

Fixed submission:

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

#define rep(i, n) for (ll i = 0; i < n; i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define REP(i, n) for (ll i = 1; i < n; i++)
#define PER(i, n) for (ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\\n" : "No\\n")
#define endl '\\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 62) - 1;
ll ceil(const ll &a, const ll &b) { return ((a) + (b)-1) / b; }
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;
}

int main() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  rep(i, n) cin >> a[i];
  for (int i = k; i < n; i++) {
    YesorNo(a[k - i] < a[i]);
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int N, K, i, left, right, dropped;
  cin >> N >> K;
  left = 1;
  right = K;
  int *arr = new int[N + 1];
  for (i = 1; i <= N; i += 1) {
    cin >> arr[i];
  }
  while (right < N) {
    dropped = left;
    left = left + 1;
    right = right + 1;
    if (arr[dropped] < arr[right]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Error: -6
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc


Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int N, K, i, left, right, dropped;
  int *arr = new int[N + 1];
  cin >> N >> K;
  left = 1;
  right = K;
  for (i = 1; i <= N; i += 1) {
    cin >> arr[i];
  }
  while (right < N) {
    dropped = left;
    left = left + 1;
    right = right + 1;
    if (arr[dropped] < arr[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 ll;
const int inf = 1e9, mod = 1e9 + 7;
#define endl '\\n'
int a[200005];
void solve() {}

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

  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  for (int i = 1; i <= n - k; i++) {
    cout << (a[i] < a[i + k] ? "Yes\\n" : "No\\n");
  }
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9, mod = 1e9 + 7;
#define endl '\\n'
int a[20005];
void solve() {}

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

  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  for (int i = 1; i <= n - k; i++) {
    cout << (a[i] < a[i + k] ? "Yes\\n" : "No\\n");
  }
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define all(vec) vec.begin(), vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll kai(ll x, ll y, ll m) {
  ll res = 1;
  for (ll i = x - y + 1; i <= x; i++) {
    res *= i;
    res %= m;
  }
  return res;
}
ll mod_pow(ll x, ll y, ll m) {
  ll res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x % m;
    }
    x = x * x % m;
    y >>= 1;
  }
  return res;
}

ll comb(ll x, ll y, ll m) {
  if (y > x)
    return 0;
  return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, k, a[200010];

signed main() {
  cin >> n >> k;
  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;
  }
}


Error: 0

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define all(vec) vec.begin(), vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll kai(ll x, ll y, ll m) {
  ll res = 1;
  for (ll i = x - y + 1; i <= x; i++) {
    res *= i;
    res %= m;
  }
  return res;
}
ll mod_pow(ll x, ll y, ll m) {
  ll res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x % m;
    }
    x = x * x % m;
    y >>= 1;
  }
  return res;
}

ll comb(ll x, ll y, ll m) {
  if (y > x)
    return 0;
  return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, k, a[100010];

signed main() {
  cin >> n >> k;
  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;
  }
}
Problem p02602 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long N, K, L;
  cin >> N >> K;

  vector<long> A;
  for (int i = 0; i < N; i++) {
    long a;
    cin >> a;
    A.push_back(a);
  }

  for (int i = K; i < N; i++) {
    if (A[i] > A[i - K]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  long N, K, L;
  cin >> N >> K;
  L = N - K;

  vector<long> A;
  for (int i = 0; i < N; i++) {
    long a;
    cin >> a;
    A.push_back(a);
  }

  vector<long> ACC;
  for (int i = 0; i < N; i++) {
    ACC.push_back(accumulate(A.begin() + i, A.begin() + i + K, 1L,
                             [](long j, long k) { return j * k; }));
  }

  for (int i = 0; i < N - K; i++) {
    if (ACC[i] < ACC[i + 1]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

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

#include <bits/stdc++.h>
#define ll long long
#define FAST                                                                   \\
  {                                                                            \\
    ios_base::sync_with_stdio(false);                                          \\
    cin.tie(NULL);                                                             \\
  }
#define f(i, a, b) for (ll i = a; i < b; i++)
#define fr(i, a, b) for (ll i = a; i >= b; i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pll pair<ll, ll>
#define LB lower_bound
#define UB upper_bound
#define endl "\\n"
using namespace std;

int main() {
  FAST ll n, k;
  cin >> n >> k;
  ll a[n + 1];
  f(i, 1, n + 1) cin >> a[i];
  f(i, k + 1, n + 1) {
    ll curr = a[i];
    ll prev = a[i - k];
    if (curr > prev)
      cout << "Yes\\n";
    else
      cout << "No\\n";
  }
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
#define FAST                                                                   \\
  {                                                                            \\
    ios_base::sync_with_stdio(false);                                          \\
    cin.tie(NULL);                                                             \\
  }
#define f(i, a, b) for (ll i = a; i < b; i++)
#define fr(i, a, b) for (ll i = a; i >= b; i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pll pair<ll, ll>
#define LB lower_bound
#define UB upper_bound
#define endl "\\n"
using namespace std;

int main() {
  FAST ll n, k;
  cin >> n >> k;
  ll a[n + 1];
  f(i, 1, n + 1) cin >> a[i];
  ll pre[n + 1];
  pre[0] = 1;
  f(i, 1, n + 1) pre[i] = (a[i] * pre[i - 1]);
  f(i, k + 1, n + 1) {
    ll curr = pre[i] / pre[i - k];
    ll prev = pre[i - 1] / pre[i - k - 1];
    if (curr > prev)
      cout << "Yes\\n";
    else
      cout << "No\\n";
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
bool cmp(long long int x, long long int y) { return x > y; }
int main(void) {
  long long int t, n, m, k, x, y, a[200001];
  vector<long long int> v, v1, v2;
  vector<pair<long long int, long long int>> p, p1, p2;
  set<long long int> st;
  priority_queue<long long int> pq;
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      lpq;
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int>>,
                 greater<pair<long long int, long long int>>>
      plpq;
  string s;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = k; i < n; i++) {
    if (a[i] > a[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
bool cmp(long long int x, long long int y) { return x > y; }
int main(void) {
  long long int t, n, m, k, x, y, a[100001];
  vector<long long int> v, v1, v2;
  vector<pair<long long int, long long int>> p, p1, p2;
  set<long long int> st;
  priority_queue<long long int> pq;
  priority_queue<long long int, vector<long long int>, greater<long long int>>
      lpq;
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int>>,
                 greater<pair<long long int, long long int>>>
      plpq;
  string s;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = k; i < n; i++) {
    if (a[i] > a[i - k])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}