Problem p03170 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define FLASH                                                                  \
  cin.tie(0);                                                                  \
  cout.tie(0);                                                                 \
  ios_base::sync_with_stdio(false);
#define pb push_back
#define int long long
#define fr(i, a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define FILEIO                                                                 \
  freopen("C:\\Users\\sourav\\Documents\\cp files\\input.txt", "r", stdin);    \
  freopen("C:\\Users\\sourav\\Documents\\cp files\\output.txt", "w", stdout);
#define maxn 1000000

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

signed main() {
#ifndef ONLINE_JUDGE
  FILEIO
#endif
  FLASH
  int n, k;
  cin >> n >> k;
  int arr[n];
  bool verdict[k + 2];
  for (int i = 1; i <= k; i++)
    verdict[i] = false;
  for (int i = 0; i < n; ++i) {
    /* code */
    cin >> arr[i];
    verdict[arr[i]] = true;
  }
  // sort(arr , arr + n);
  int j = 1;
  while (!verdict[j]) {
    j++;
  }
  for (int i = j + 1; i <= k; i++) {
    if (!verdict[i]) {
      int flag = 0;
      for (int a = 0; a < n; a++) {
        if (i - arr[a] >= 1) {
          if (!verdict[i - arr[a]]) {
            flag = 1;
          }
        }
      }
      if (flag == 1)
        verdict[i] = true;
    }
  }
  if (verdict[k] == true)
    cout << "First";
  else
    cout << "Second";
}

Fixed submission:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define FLASH                                                                  \
  cin.tie(0);                                                                  \
  cout.tie(0);                                                                 \
  ios_base::sync_with_stdio(false);
#define pb push_back
#define int long long
#define fr(i, a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define FILEIO                                                                 \
  freopen("C:\\Users\\sourav\\Documents\\cp files\\input.txt", "r", stdin);    \
  freopen("C:\\Users\\sourav\\Documents\\cp files\\output.txt", "w", stdout);
#define maxn 1000000

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

signed main() {

  FLASH
  int n, k;
  cin >> n >> k;
  int arr[n];
  bool verdict[k + 2];
  for (int i = 1; i <= k; i++)
    verdict[i] = false;
  for (int i = 0; i < n; ++i) {
    /* code */
    cin >> arr[i];
    verdict[arr[i]] = true;
  }
  // sort(arr , arr + n);
  int j = 1;
  while (!verdict[j]) {
    j++;
  }
  for (int i = j + 1; i <= k; i++) {
    if (!verdict[i]) {
      int flag = 0;
      for (int a = 0; a < n; a++) {
        if (i - arr[a] >= 1) {
          if (!verdict[i - arr[a]]) {
            flag = 1;
          }
        }
      }
      if (flag == 1)
        verdict[i] = true;
    }
  }
  if (verdict[k] == true)
    cout << "First";
  else
    cout << "Second";
}