Language: Java

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;

#define F first
#define S second
#define PB push_back
#define MP make_pair

#define SQ(a) (a)*(a)
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repd(j,a,b) for(int j=a; j>=b; j--)
#define deg(x) cout<<#x<<" = "<<x<<endl;
#define MAXN 100+10
#define MAXK 100000+10

ui n, k, cnt[MAXK], ans;
ul sum;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>n>>k;
	vii a(n);
	rep(i,0,n-1){
		cin>>a[i].F;
		a[i].S = 0;
		cnt[a[i].F]++;
		sum+=a[i].F;
	}
	
	sort(a.begin(),a.end());
	
	if(sum<=k){
		n%2 ? ans=1 : ans=2;
	}
	else{
		int p = 0;
		bool f = false;
		while(1){
			f = false;
			if(p==0){
				repd(i,n-1,0){
					if(a[i].S || k<a[i].F) continue;
					else if(cnt[k-a[i].F] == 0){
							k-=a[i].F;
							a[i].S = 1;
							f = true;
							break;
					}
				}
				if(!f){
					ans = 2; 
					break;
				}	
			}
			else{
				rep(i,0,n-1){
					if(a[i].S || k<a[i].F) continue;
					else if(cnt[k-a[i].F] == 0){
							k-=a[i].F;
							a[i].S = 1;
							f = true;
							break;
					}
				}
				if(!f){
					ans = 1;
					break;
				}
			}
			p = (p+1)%2;
		}
	}
	
	cout<<ans==1?"First":"Second";
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
typedef vector<int> vi;
^
Main.java:6: error: class, interface, enum, or record expected
typedef pair<int,int> ii;
^
Main.java:7: error: class, interface, enum, or record expected
typedef vector<ii> vii;
^
Main.java:8: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:9: error: class, interface, enum, or record expected
typedef unsigned long long ul;
^
Main.java:10: error: class, interface, enum, or record expected
typedef unsigned int ui;
^
Main.java:12: error: illegal character: '#'
#define F first
^
Main.java:13: error: illegal character: '#'
#define S second
^
Main.java:14: error: illegal character: '#'
#define PB push_back
^
Main.java:15: error: illegal character: '#'
#define MP make_pair
^
Main.java:17: error: illegal character: '#'
#define SQ(a) (a)*(a)
^
Main.java:18: error: illegal character: '#'
#define rep(i,a,b) for(int i=a; i<=b; i++)
^
Main.java:18: error: class, interface, enum, or record expected
#define rep(i,a,b) for(int i=a; i<=b; i++)
                                ^
Main.java:18: error: class, interface, enum, or record expected
#define rep(i,a,b) for(int i=a; i<=b; i++)
                                      ^
Main.java:19: error: illegal character: '#'
#define repd(j,a,b) for(int j=a; j>=b; j--)
^
Main.java:19: error: class, interface, enum, or record expected
#define repd(j,a,b) for(int j=a; j>=b; j--)
                                 ^
Main.java:19: error: class, interface, enum, or record expected
#define repd(j,a,b) for(int j=a; j>=b; j--)
                                       ^
Main.java:20: error: illegal character: '#'
#define deg(x) cout<<#x<<" = "<<x<<endl;
^
Main.java:20: error: illegal character: '#'
#define deg(x) cout<<#x<<" = "<<x<<endl;
                     ^
Main.java:21: error: illegal character: '#'
#define MAXN 100+10
^
Main.java:21: error: class, interface, enum, or record expected
#define MAXN 100+10
        ^
Main.java:22: error: illegal character: '#'
#define MAXK 100000+10
^
Main.java:25: error: unnamed classes are a preview feature and are disabled by default.
ul sum;
^
  (use --enable-preview to enable unnamed classes)
Main.java:29: error: not a statement
	ios_base::sync_with_stdio(false);
	^
Main.java:32: error: not a statement
	cin>>n>>k;
	      ^
Main.java:33: error: not a statement
	vii a(n);
	      ^
Main.java:35: error: not a statement
		cin>>a[i].F;
		   ^
Main.java:85: error: not a statement
	cout<<ans==1?"First":"Second";
	            ^
Main.java:29: error: ';' expected
	ios_base::sync_with_stdio(false);
	                         ^
Main.java:33: error: ';' expected
	vii a(n);
	     ^
Main.java:33: error: ';' expected
	vii a(n);
	       ^
Main.java:34: error: ';' expected
	rep(i,0,n-1){
	            ^
Main.java:52: error: ';' expected
				repd(i,n-1,0){
				             ^
Main.java:67: error: ';' expected
				rep(i,0,n-1){
				            ^
36 errors