Language: C++

#include <bits/stdc++.h>
using namespace std;

int Cint[7] = { 4, 6, 8, 10, 100, 1000, 10000 };
bool end = false;
bool y[7];	//4,6,8,10,100,1000,100000
//0,1,2,3, 4,   5,   6
bool now = true; // chokudai_s
int ch(int n) {
	for (int i = 6; i >= 0; i--) {
		if (n == 1) {
			end = true;
			return -1;
		}
		end = true;
		if (y[i] && n % Cint[i] != 0) {
			y[i] = false;
		}
	}
	return 0;

}
void change(bool *n, int cnt) {
	if (cnt % 2 != 0) {
		if (n)
			*n = false;
		else
			*n = true;
	}
	return;
}
void re(int n, int *ar) {
	int cn = 0, tmp;
	for (int i = 6; i >= 0; i--) {
		if (y[i]) {
			fill(y[0], y[6], true);
			for (int j = 0; j < n; j++) {
				ar[j] = ar[j] / Cint[i];
				if (ar[j] % 2 == 0) {
					ch(ar[j]);
				} else {
					cn++;
					tmp = ch(ar[j] - 1);
					if (tmp != -1) {
						ar[j]--;
					}
				}
			}
			change(&now, cn);
			return;
		}
	}
	fill(y[0], y[6], true);
	for (int j = 0; j < n; j++) {
		ar[j] = ar[j] / 2;
		if (ar[j] % 2 == 0) {
			ch(ar[j]);
		} else {
			cn++;
			tmp = ch(ar[j] - 1);
			if (tmp != -1) {
				ar[j]--;
			}
		}
	}
	change(&now, cn);
	return;

}

int main() {

	ios::sync_with_stdio(false);
	fill(y[0], y[6], true);	//clear
	int n;
	cin >> n;
	int ar[n];
	list<int> p[n];
	list<int> l;
	stack<int> ki, gu;

	int tmpCn = 0;
	for (int i = 0; i < n; ++i) {
		cin >> ar[i];
		if (ar[i] % 2 == 0) {
			ch(ar[i]);
		}

		else {
			tmpCn++;
			ch(ar[i] - 1);
			ar[i]--;
		}
	}
	change(&now, tmpCn);
	re(n, ar);
	while (true) {
		re(n, ar);
		if (end) {
			if (now)
				cout << "Second" << endl;
			else
				cout << "First" << endl;
			return 0;
		}
	}

	return 0;
}



Compiler output:
a.cc: In function 'int ch(int)':
a.cc:12:25: error: reference to 'end' is ambiguous
   12 |                         end = true;
      |                         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1265:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:5:6: note:                 'bool end'
    5 | bool end = false;
      |      ^~~
a.cc:15:17: error: reference to 'end' is ambiguous
   15 |                 end = true;
      |                 ^~~
/usr/include/c++/14/valarray:1265:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:5:6: note:                 'bool end'
    5 | bool end = false;
      |      ^~~
a.cc: In function 'int main()':
a.cc:99:21: error: reference to 'end' is ambiguous
   99 |                 if (end) {
      |                     ^~~
/usr/include/c++/14/valarray:1265:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:5:6: note:                 'bool end'
    5 | bool end = false;
      |      ^~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool; _Tp = bool; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = bool; _Tp = bool]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool; _Tp = bool]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:36:8:   required from here
   36 |                         fill(y[0], y[6], true);
      |                         ~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:951:35: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
  951 |       for (; __first != __last; ++__first)
      |                                   ^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'bool')
  952 |         *__first = __tmp;
      |         ^~~~~~~~