Problem p03170 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ld long double
#define ull unsigned long long int
#define ll long long int
#define SPEED                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define mod 1000000007ll
#define rep(i, L, R) for (ll i = L; i < R; i++)
#define f(n) rep(i, 0, n)
#define pll pair<ll, ll>
#define DEBUG
#ifdef DEBUG
#define deb2(args...)                                                          \
  {                                                                            \
    dbg, args;                                                                 \
    cerr << endl;                                                              \
  }
#else
#define deb2(args...)
#endif
struct debb {
  template <typename T> debb &operator,(const T &v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
#define deb1(args...)                                                          \
  do {                                                                         \
    cerr << #args << " : ";                                                    \
    dbg, args;                                                                 \
    cerr << "\n";                                                              \
  } while (0)
#define printa(a, L, R)                                                        \
  rep(i, L, R) cout << a[i] << ' ';                                            \
  cout << "\n";
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
template <typename T> T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
ll power(ll x, ll y, ll p) {
  ll res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1)
      res = ((res % p) * (x % p)) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
ll pow1(ll x, ll y) {
  ll res = 1;
  while (y > 0) {
    if (y & 1)
      res = (res * x);
    y = y >> 1;
    x = x * x;
  }
  return res;
}
#define sq(X) ((X) * (X))
#define PI 3.141592653589
const ll INF = 1e18l + 10, N = 1e5 + 1, MAX = 2e5 + 10;
// A B C D H F E I G K L M N P S O Q R J U Z Y X T V W

int main() {
  int n, k, i, j;
  cin >> n >> k;
  bitset<10001> dp;
  int a[n];
  f(n) cin >> a[i];

  for (i = 0; i <= k; i++) {
    for (j = 0; j < n; j++) {
      if (i + a[j] > k || dp[i])
        break;
      dp[i + a[j]] = 1;
    }
  }
  if (dp[k])
    cout << "First\n";
  else
    cout << "Second\n";
}

Fixed submission:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ld long double
#define ull unsigned long long int
#define ll long long int
#define SPEED                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define mod 1000000007ll
#define rep(i, L, R) for (ll i = L; i < R; i++)
#define f(n) rep(i, 0, n)
#define pll pair<ll, ll>
#define DEBUG
#ifdef DEBUG
#define deb2(args...)                                                          \
  {                                                                            \
    dbg, args;                                                                 \
    cerr << endl;                                                              \
  }
#else
#define deb2(args...)
#endif
struct debb {
  template <typename T> debb &operator,(const T &v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
#define deb1(args...)                                                          \
  do {                                                                         \
    cerr << #args << " : ";                                                    \
    dbg, args;                                                                 \
    cerr << "\n";                                                              \
  } while (0)
#define printa(a, L, R)                                                        \
  rep(i, L, R) cout << a[i] << ' ';                                            \
  cout << "\n";
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
template <typename T> T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
ll power(ll x, ll y, ll p) {
  ll res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1)
      res = ((res % p) * (x % p)) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
ll pow1(ll x, ll y) {
  ll res = 1;
  while (y > 0) {
    if (y & 1)
      res = (res * x);
    y = y >> 1;
    x = x * x;
  }
  return res;
}
#define sq(X) ((X) * (X))
#define PI 3.141592653589
const ll INF = 1e18l + 10, N = 1e5 + 1, MAX = 2e5 + 10;
// A B C D H F E I G K L M N P S O Q R J U Z Y X T V W

int main() {
  int n, k, i, j;
  cin >> n >> k;
  bitset<100001> dp;
  int a[n];
  f(n) cin >> a[i];

  for (i = 0; i <= k; i++) {
    for (j = 0; j < n; j++) {
      if (i + a[j] > k || dp[i])
        break;
      dp[i + a[j]] = 1;
    }
  }
  if (dp[k])
    cout << "First\n";
  else
    cout << "Second\n";
}