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

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <climits>
#include <cstdint> // int64_t, int*_t
#include <cstdio>  // printf
#include <deque>   // deque
#include <functional>
#include <iomanip> //setprecision
#include <iostream>
#include <map> // map
#include <math.h>
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <string>        // string, to_string, stoi
#include <tuple>         // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define mod 1000000007
vector<ll> to[1000005];
ll dp[2000000];
int gcd(int a, int b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
int main() {
  ll a, b;
  cin >> a >> b;
  vector<ll> c(a);
  rep(i, a) cin >> c[i];
  rep(i, a - b) {
    if (c[i] < c[i + b])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    // cout<<c[i+b];
  }
}


Error: 0

Fixed submission:

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <climits>
#include <cstdint> // int64_t, int*_t
#include <cstdio>  // printf
#include <deque>   // deque
#include <functional>
#include <iomanip> //setprecision
#include <iostream>
#include <map> // map
#include <math.h>
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <string>        // string, to_string, stoi
#include <tuple>         // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define mod 1000000007
vector<ll> to[1000005];
ll dp[2000000];
int gcd(int a, int b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
int main() {
  ll a, b;
  cin >> a >> b;
  vector<ll> c(a);
  rep(i, a) cin >> c[i];
  rep(i, b - 1) {
    if (c[i] < c[i + b])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    // cout<<c[i+b];
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int n, k;
  int a[200005];
  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: -6
terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()


Fixed submission:

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

int main() {
  int n, k;
  vector<int> a(n);
  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: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define fi first
#define se second
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
template <class T, class S> void cmin(T &a, const S &b) {
  if (a > b)
    a = b;
}
template <class T, class S> void cmax(T &a, const S &b) {
  if (a < b)
    a = b;
}
template <class A> void PR(A a, ll n) {
  rep(i, n) {
    if (i)
      cout << ' ';
    cout << a[i];
  }
  cout << "\\n";
}
ld PI = 3.14159265358979323846;

int main() {
  ll N, K;
  cin >> N >> K;
  vector<ll> A(N), S(N + 1);
  rep(i, N) { cin >> A[i]; }
  /*
  ll sum = 1;
  rep(i,K){
      sum *= A[i];
  }
  /*S[0] = 1;
  rep(i,N){
      S[i+1] = S[i]*A[i];
  }
  ll prev = S[K];*/
  for (ll i = K; i < N; 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;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define fi first
#define se second
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
template <class T, class S> void cmin(T &a, const S &b) {
  if (a > b)
    a = b;
}
template <class T, class S> void cmax(T &a, const S &b) {
  if (a < b)
    a = b;
}
template <class A> void PR(A a, ll n) {
  rep(i, n) {
    if (i)
      cout << ' ';
    cout << a[i];
  }
  cout << "\\n";
}
ld PI = 3.14159265358979323846;

int main() {
  ll N, K;
  cin >> N >> K;
  vector<ll> A(N), S(N + 1);
  rep(i, N) { cin >> A[i]; }
  S[0] = 1;
  rep(i, N) { S[i + 1] = S[i] * A[i]; }
  ll prev = S[K];
  for (ll i = K + 1; i <= N; i++) {
    if (prev < S[i] / S[i - K]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    prev = S[i] / S[i - K];
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#include <iostream>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define yesno(flg)                                                             \\
  if (flg) {                                                                   \\
    cout << "YES" << endl;                                                     \\
  } else {                                                                     \\
    cout << "NO" << endl;                                                      \\
  }
#define MAX_N 1002
#define i197 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P1;
typedef pair<int, int> Pi;
typedef pair<double, Pi> Pdi;
typedef pair<ll, int> Pli;
typedef pair<int, ll> Pil;
typedef pair<int, Pil> Piil;
typedef pair<P1, ll> P2;
typedef pair<string, string> Ps;
const ll INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
struct pos {
  // 1 変数を入れる;
  int x, y, sx, sy, cost;
};
ll a[200002];

int main() {

  ll n, k;
  cin >> n >> k;

  rep(i, n) cin >> a[i + 1];

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

  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#include <iostream>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define yesno(flg)                                                             \\
  if (flg) {                                                                   \\
    cout << "YES" << endl;                                                     \\
  } else {                                                                     \\
    cout << "NO" << endl;                                                      \\
  }
#define MAX_N 1002
#define i197 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P1;
typedef pair<int, int> Pi;
typedef pair<double, Pi> Pdi;
typedef pair<ll, int> Pli;
typedef pair<int, ll> Pil;
typedef pair<int, Pil> Piil;
typedef pair<P1, ll> P2;
typedef pair<string, string> Ps;
const ll INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
struct pos {
  // 1 変数を入れる;
  int x, y, sx, sy, cost;
};
ll a[200002];
ll d[200002] = {};

int main() {

  ll n, k;
  cin >> n >> k;

  d[0] = 1;
  rep(i, n) {
    cin >> a[i + 1];
    d[i + 1] = d[i] * a[i + 1];
  }
  for (int i = k + 1; i < n + 1; i++) {
    if (d[i - 1] / d[i - k - 1] < d[i] / d[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 rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) begin(v), end(v)
using ll = long long;

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

Error: 0

Fixed submission:

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

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

#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.at(i);
  }
  for (int i = K; i < N; i++) {
    if (A.at(i - K) < A.at(i)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)


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.at(i);
  }
  for (int i = K + 1; i <= N; i++) {
    if (A.at(i - K) < A.at(i)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
template <typename T> inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48), ch = getchar();
  x *= f;
  return;
}
template <typename T> void write(T x) {
  if (x < 0)
    putchar('-'), x = -x;
  if (x >= 10)
    write(x / 10);
  putchar(x % 10 + '0');
  return;
}
const int MAXN = 200010;
int n, k;
int a[MAXN];
int main() {
  read(n), read(k);
  for (int i = 1; i <= n; ++i)
    read(a[i]);
  for (int i = k + 1; i <= n; ++i)
    if (a[i] > a[i - k])
      printf("Yes\\n");
    else
      printf("No\\n");
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
template <typename T> inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48), ch = getchar();
  x *= f;
  return;
}
template <typename T> void write(T x) {
  if (x < 0)
    putchar('-'), x = -x;
  if (x >= 10)
    write(x / 10);
  putchar(x % 10 + '0');
  return;
}
const int MAXN = 100010;
int n, k;
int a[MAXN];
int main() {
  read(n), read(k);
  for (int i = 1; i <= n; ++i)
    read(a[i]);
  for (int i = k + 1; i <= n; ++i)
    if (a[i] > a[i - k])
      printf("Yes\\n");
    else
      printf("No\\n");
  return 0;
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define int long long
using namespace std;
signed main() {

  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (int j = 0; j < n - k; j++) {
    if (a[j] < a[j + k]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

Error: 0

Fixed submission:

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define int long long
using namespace std;
signed main() {
  int N, K;
  cin >> N >> K;

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

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


// Problem : C - Marks
// Contest : AtCoder - M-SOLUTIONS Programming Contest 2020
// URL : https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vll vector<long long int>
#define pi pair<int, int>
#define all(x) (x).begin(), (x).end()

const int MOD = 1000000007;

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

  int t = 1;
  // cin>>t;

  while (t--) {
    ull n, k, x = 1;
    cin >> n >> k;
    vector<ull> v(n + 5);
    vector<ull> dp(n + 5);

    for (int i = 0; i < n; i++)
      cin >> v[i];

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

  return 0;
}


Error: 0

Fixed submission:


// Problem : C - Marks
// Contest : AtCoder - M-SOLUTIONS Programming Contest 2020
// URL : https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vll vector<long long int>
#define pi pair<int, int>
#define all(x) (x).begin(), (x).end()

const int MOD = 1000000007;

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

  int t = 1;
  // cin>>t;

  while (t--) {
    ull n, k, x = 1;
    cin >> n >> k;
    vector<ull> v(n);
    vector<ull> u(n + 1);
    ull c = k;

    for (int i = 0; i < n; i++)
      cin >> v[i];

    for (int i = 0; i < n; i++) {
      for (int j = i; j <= k - 1 + i; j++) {
        x = x * v[j];
      }
      u[c++] = x;
      // cout<<x<<"\\n";
      x = 1;
    }

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

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i < (int)(n); i++)

typedef long long ll;
using namespace std;
int main() {
  ll n, k;
  cin >> n >> k;
  ll a[200100];
  rep(i, n) cin >> a[i];

  int start = 0;
  for (int i = 0; i < n - k; i++) {
    if (a[i] < a[i + k]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i < (int)(n); i++)

typedef long long ll;
using namespace std;
int main() {
  ll n, k;
  cin >> n >> k;
  ll a[200010];
  rep(i, n) cin >> a[i];

  ll sum[200010];
  sum[0] = 1;
  reps(i, n + 1) sum[i] = sum[i - 1] * a[i - 1];

  ll start = 0;
  for (ll i = k; i < n; i++) {
    ll tmp1 = sum[i] / sum[i - k];
    ll tmp2 = sum[i + 1] / sum[i - k + 1];
    if (tmp1 < tmp2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

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

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

int main() {
  ll N, K;
  cin >> N >> K;
  vl A(N);
  rep(i, N) { cin >> A[i]; }
  rep(i, N - K) {
    if (A[i + K] > A[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Error: 0

Fixed submission:

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

int main() {
  ll N, K;
  cin >> N >> K;
  vl A(N);
  rep(i, N) { cin >> A[i]; }
  vl a(N + 1, 1);
  rep(i, N) { a[i + 1] = a[i] * A[i]; }
  rep(i, N - K) {
    if ((a[i + 1 + K] / a[i + 1]) > (a[i + K] / a[i])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define range(a) a.begin(), a.end()
#define endl "\\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
void chmin(long long &a, long long b) {
  if (a > b)
    a = b;
}
void chmax(long long &a, long long b) {
  if (a < b)
    a = b;
}

int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  vector<ll> data;
  int N, K;
  cin >> N >> K;
  ll A;
  FOR(i, 0, N) {
    cin >> A;
    data.push_back(A);
  }

  FOR(i, 0, N - K) {
    if (data.at(i) >= data.at(i + K))
      No();
    else
      Yes();
  }

  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)


Fixed submission:

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define range(a) a.begin(), a.end()
#define endl "\\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
void chmin(long long &a, long long b) {
  if (a > b)
    a = b;
}
void chmax(long long &a, long long b) {
  if (a < b)
    a = b;
}

int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  vector<ll> data;
  int N, K;
  cin >> N >> K;
  ll A;
  FOR(i, 0, N) {
    cin >> A;
    data.push_back(A);
  }

  FOR(i, 0, N - K + 1) {
    if (data.at(i) >= data.at(i + K))
      Yes();
    else
      No();
  }

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

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

int main() {
  int i;
  int n, k;
  cin >> n >> k;
  vector<int> a(n);

  for (i = 0; i < n; i++) {
    cin >> a[i];
  }

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

int main() {
  int i;
  int n, k;
  int a[100000];

  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }

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

#include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<vector<int>>;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

const double PI = (acos(-1));

int main() {
  int n, k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i, n) { 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>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<vector<int>>;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

const double PI = (acos(-1));

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