Language: C++

using namespace std;
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <bitset>
#include <iterator>
#include <set> 
#include <unordered_set>
#include <string>
#include <functional>
#include <limits.h>
//#include <bits/stdc++.h> 
//#include <list>
#include <stack>
#include <stdio.h>
typedef signed long long ll; //watch out ll= int*int will not become ll, rather (ll)ini*int casting will work
#include <queue>
#include <math.h>
#include <deque>
#define ffor(i,n) for(int i = 0;i < (n); ++i)
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pii>
//typedef long float lf;
#include <cmath>
#include <iomanip>
#include <numeric>
#include <stdio.h>
const long double PI = 3.141592653589793238L;
/*struct CustomCompare
{
	bool operator()(pii& p1, pii& p2)
	{
		if (p1.second - p1.first == p2.second - p2.first)
			return p1.first > p2.first;

		return p1.second - p1.first < p2.second - p2.first;
	}
};*/
int tt, n, k, inp, a, b, x,m;
void pv(vector<int> a) {
	for (auto i : a)
		cout << i<< ' ';
	cout << '\n';
}
void pp (vector<pair<int, int>> a) {
	for (auto i : a)
		cout << i.first << ' ' << i.second<<'\n';
}
long float solve(tuple<int, int, int> s,
	map <tuple <int, int, int>, long float> &memo) {
	//cout << get<0>(s) << ' '<< get<1>(s) << ' '<< get<2>(s);
	//cout << endl;
	if (memo.find(s) == memo.end()) {
		int i = get<0>(s);
		int j = get<1>(s);
		int k = get<2>(s);
		
		//cout << "FIRST";
		long float ans = 0;
		if (k>0)
		ans +=(long float) k / n * (1 + solve({ i,j + 1,k-1 }, memo));
		
		
		//cout << "SECOND";
		if (j>0)
		ans += (long float)  j / n * (1 + solve({ i + 1,j-1,k }, memo));
		
		
		//cout << "THIRD";
		if (i>0)
		ans += (long float)     i / n * (1 + solve({ i-1,j,k }, memo));
		
		//cout << "FOURTH";
		ans = (long float) n / (i + j + k) * (ans + (long float)(n - i - j - k) / n);
		
		//cout << "ANS " << ans << '\n';
		memo.insert({ s, ans });
		return ans;
	}
	else
		return memo.find(s)->second;

}
int main() {
	//vector<int> x = { 2,1,0 };
	cin >> n; cin >> k;
	vector<int> a(n); int minn = 999999;
	for (int i = 0; i < n; i++) {
		cin >> a[i]; minn = min(a[i], minn);
	}
	//cout << minn;
	vector<int> dp(k+1, 0);
	for (int i = 0; i < minn; i++) {
		dp[i] = 0;
	}
	cout << "YY";
	int cur = 0;
	pv(dp);
	while (cur < k + 1) {
		for (auto i : a) {
			if (cur + i < k + 1 && dp[cur+i]!=1)
				dp[cur + i] = !dp[cur];
		}
		pv(dp);
		cur++;}
	if (dp[cur-1] == 1)
		cout << "First";
	else
		cout << "Second";

}


/*
tuple <int, int, int> s = {0,0,0};
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] == 1)
			get<0>(s)++;
		else if (a[i]==2)
			get<1>(s)++;
		else if (a[i] == 3)
			get<2>(s)++;

	}
	map <tuple <int, int, int>, long float> memo;
	memo.insert({ {0,0,0},0.0 });
	cout << std::setprecision(11)<<solve(s, memo);
}*/

Compiler output:
a.cc:54:37: error: 'long' specified with 'float'
   54 |         map <tuple <int, int, int>, long float> &memo) {
      |                                     ^~~~
a.cc:53:1: error: 'long' specified with 'float'
   53 | long float solve(tuple<int, int, int> s,
      | ^~~~
a.cc: In function 'float solve(std::tuple<int, int, int>, std::map<std::tuple<int, int, int>, float>&)':
a.cc:63:17: error: 'long' specified with 'float'
   63 |                 long float ans = 0;
      |                 ^~~~
a.cc:65:24: error: 'long' specified with 'float'
   65 |                 ans +=(long float) k / n * (1 + solve({ i,j + 1,k-1 }, memo));
      |                        ^~~~
a.cc:70:25: error: 'long' specified with 'float'
   70 |                 ans += (long float)  j / n * (1 + solve({ i + 1,j-1,k }, memo));
      |                         ^~~~
a.cc:75:25: error: 'long' specified with 'float'
   75 |                 ans += (long float)     i / n * (1 + solve({ i-1,j,k }, memo));
      |                         ^~~~
a.cc:78:24: error: 'long' specified with 'float'
   78 |                 ans = (long float) n / (i + j + k) * (ans + (long float)(n - i - j - k) / n);
      |                        ^~~~
a.cc:78:62: error: 'long' specified with 'float'
   78 |                 ans = (long float) n / (i + j + k) * (ans + (long float)(n - i - j - k) / n);
      |                                                              ^~~~