Problem p02602 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define ll long long
#define ld long double
#define pll pair<ll, ll>
#define vll vector<pll>
#define vl vector<ll>
#define f first
#define s second
#define N 50000
#define pb push_back
#define MAP map<ll, ll>
#define MAPs map << ll, sl >
#define MAPv map<ll, vl>
#define mset(x, val) memset(x, val, sizeof(x))
#define mod 1000000007
#define foo(i, a, b) for (ll i = (a); i <= (b); i++)
#define rep(i, a, b) for (ll i = (a); i >= (b); i--)
#define FOR(i, v) for (auto &(i) : (v))
#define sl set<ll>
#define sll set<pll>
#define ub upper_bound
#define lb lower_bound
using namespace std;

const ll INF = 0x7f7f7f7f7f7f7f7f;
const ll NINF = -INF;
const ll MAXN = 1e+6 + 8;

int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
//<<-----Declare Variable Here------->>//
ll n, k, a[200005];
//<<-----Implement Functions Here---->>//

//<<-----Start of Main--------------->>//
void MAIN() {
  cin >> n >> k;
  foo(i, 1, n) cin >> a[i];

  vl v;
  foo(i, k + 1, n) {
    if (a[i] > a[i - k]) {
      cout << "Yes\\n";
    } else
      cout << "No\\n";
  }
}

int main() {
  fastio;
  ll t = 1;
  // cin>>t;
  while (t--) {
    MAIN();
  }

  // #ifndef ONLINE_JUDGE
  // cout<<"\\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\\n";
  // #endif
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define ll long long
#define ld long double
#define pll pair<ll, ll>
#define vll vector<pll>
#define vl vector<ll>
#define f first
#define s second
#define N 50000
#define pb push_back
#define MAP map<ll, ll>
#define MAPs map << ll, sl >
#define MAPv map<ll, vl>
#define mset(x, val) memset(x, val, sizeof(x))
#define mod 1000000007
#define foo(i, a, b) for (ll i = (a); i <= (b); i++)
#define rep(i, a, b) for (ll i = (a); i >= (b); i--)
#define FOR(i, v) for (auto &(i) : (v))
#define sl set<ll>
#define sll set<pll>
#define ub upper_bound
#define lb lower_bound
using namespace std;

const ll INF = 0x7f7f7f7f7f7f7f7f;
const ll NINF = -INF;
const ll MAXN = 1e+6 + 8;

int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
//<<-----Declare Variable Here------->>//
ll n, k, a[200005];
//<<-----Implement Functions Here---->>//

//<<-----Start of Main--------------->>//
void MAIN() {
  cin >> n >> k;
  foo(i, 1, n) cin >> a[i];

  vl pref(n + 1, 1);
  foo(i, 1, n) { pref[i] = pref[i - 1] * a[i]; }

  vl v;
  foo(i, k, n) { v.pb(pref[i] / pref[i - k]); }

  foo(i, 1, v.size() - 1) { cout << (v[i] > v[i - 1] ? "Yes\\n" : "No\\n"); }
}

int main() {
  fastio;
  ll t = 1;
  // cin>>t;
  while (t--) {
    MAIN();
  }

  // #ifndef ONLINE_JUDGE
  // cout<<"\\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\\n";
  // #endif
}