Language: C++

#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;

int main()
{
    fast;
    ll  n,k;
    cin>>n>>k;
    vector<ll> arr(n);
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    vector<bool> dp[k+1];  /// dp[i] is true  if the first player wins if there are i stones remaining
    /// first  player is nothing but the player who is currently removing stones
    /// dp[i] is true if the opponent looses in remaining stones
    for( ll stones =0;stones<=k;++stones)
    {
        for(int j=0;j<n;j++)
        {
            if( !dp[stones-arr[j]]  &&  stones >= arr[j])
            {
                dp[stones] = true;
            }
        }
    }
    puts(dp[k] ? "FIRST" : "SECOND");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: no match for 'operator!' (operand type is 'std::vector<bool>')
   24 |             if( !dp[stones-arr[j]]  &&  stones >= arr[j])
      |                 ^~~~~~~~~~~~~~~~~~
a.cc:24:17: note: candidate: 'operator!(bool)' (built-in)
a.cc:24:17: note:   no known conversion for argument 1 from 'std::vector<bool>' to 'bool'
a.cc:26:30: error: no match for 'operator=' (operand types are 'std::vector<bool>' and 'bool')
   26 |                 dp[stones] = true;
      |                              ^~~~
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:894:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  894 |       operator=(const vector& __x)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:894:31: note:   no known conversion for argument 1 from 'bool' to 'const std::vector<bool>&'
  894 |       operator=(const vector& __x)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:926:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:926:26: note:   no known conversion for argument 1 from 'bool' to 'std::vector<bool>&&'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:952:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
  952 |       operator=(initializer_list<bool> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:952:40: note:   no known conversion for argument 1 from 'bool' to 'std::initializer_list<bool>'
  952 |       operator=(initializer_list<bool> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:30:14: error: could not convert 'dp[k]' from 'std::vector<bool>' to 'bool'
   30 |     puts(dp[k] ? "FIRST" : "SECOND");
      |          ~~~~^
      |              |
      |              std::vector<bool>