Problem:


Problem Statement

There are N piles of candies on the table. The piles are numbered 1 through N. At first, pile i contains a_i candies.

Snuke and Ciel are playing a game. They take alternating turns. Snuke goes first. In each turn, the current player must perform one of the following two operations:

Choose a pile with the largest number of candies remaining, then eat all candies of that pile.

From each pile with one or more candies remaining, eat one candy.

The player who eats the last candy on the table, loses the game. Determine which player will win if both players play the game optimally.

Constraints

1≤N≤10^5

1≤a_i≤10^9

Input

The input is given from Standard Input in the following format:

N
a_1 a_2 … a_N

Output

If Snuke will win, print First. If Ciel will win, print Second.

Sample Input 1

2
1 3

Sample Output 1

First

At the beginning of the game, pile 2 contains the most candies. If Snuke eats all candies of this pile, Ciel has no choice but to eat the last candy.

Sample Input 2

3
1 2 1

Sample Output 2

First

If Snuke eats one candy from each pile, Ciel is again left with the last candy.

Sample Input 3

3
1 2 3

Sample Output 3

Second



Sample input:
2
1 3


Sample output:
First

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.append(0)
A.sort()
winner=""
for i in range(N+1):
    if A[N-i]>=i:
        if (A[N-i]-i)%2==0:
            winner="First"
        else:
            winner="Second"
    else:
        break

print(winner)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
s=0
for i in range(N):
  s=s^L[i]
if s==0:
  print("Second")
else:
  print("First")

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N = I()
a = LI()

odd = 0
even = 0
for i in range(N):
    if a[i] % 2 == 1:
        odd += 1
    else:
        even += 1

if N % 2 == 1:
    if odd <= even:
        print('First')
    else:
        print('Second')
else:
    if odd >= even:
        print('First')
    else:
        print('Second')

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
a=sorted(a)[::-1]
j=i=0
while n:i+=a[i]>i;j+=a[j]>=i;n-=1
print('SFeicrosntd'[(a[i-1]|j)&1::2])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

a.sort(reverse=True)

#after win=false first win = true
ans = False

for i in range(n):
    if len(a)==1:
        ans = ((a[i]%2)==1)
        break
    if len(a) == i+1:
        ans = (((a[i]-i) % 2) == 0)
        break
    if i==a[i]:
        for j in range(i-1,n):
            if i>=a[j]:
                ans = (((j-i)%2)==1)
    if i>=a[i+1]:
        ans = ans or (((a[i]-i-1)%2)==1)
    if i>=a[i+1] or i==a[i]:
        break


if ans:
    print("First")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

a.sort(reverse=True)

#after win=false first win = true
ans = False

for i in range(n):
    if len(a)==1:
        ans = ((a[i]%2)==1)
        break
    if len(a) == i+1:
        ans = (((a[i]-i) % 2) == 0)
        break
    if i==a[i]:
        for j in range(i-1,n):
            if i>a[j]:
                ans = (((j-i)%2)==1)
    if i>=a[i+1]:
        ans = ans or (((a[i]-i-1)%2)==1)
    if i>=a[i+1] or i==a[i]:
        break


if ans:
    print("First")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=sorted(map(int,raw_input().split()))
a.reverse()
for i in range(n):
    if a[i]<i+1:break
m1=a[i-1]-i
j=i
while j<n and a[j]>=i:j+=1
m2=j-i
print 'First' if (m1%2 or m2%2) else 'Second'

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=[0]+sorted(map(int,raw_input().split()))
b=[True for _ in range(n)]
d=[a[i+1]-a[i] for i in reversed(range(n))]
for i in range(n):
    if d[i]%2:
        for j in range(n-i-1,n):b[j]=(not b[j])
    for j in range(n-1):b[j+1]=(b[j+1] or not b[j])
print 'First' if b[-1] else 'Second'

Submission status: Wrong Answer

Solution code:
n = input()
a = sorted(map(int, raw_input().split()),reverse=True)
i = 0
j = 0
k = 0
p = ["First","Second"]
pp = ["T","A"]
while True:
    # print pp[i%2],
    # print j,k,a[j]-k
    if (a[j]-k) % 2 == 0:
        # print"s"
        if j == n-1:#win
            print p[i%2]
            exit()
        k += 1
        if a[j]-k == 0:#lose
            print p[(i+1)%2]
            exit()
    else:
        # print "v"
        if j == n-1 or a[j+1]-k == 0:#lose
            print p[(i+1)%2]
            exit()

        j += 1
    i += 1

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 0
q = deque(a)
t = 1
while 1:
    while q and q[0] == t:
        q.popleft()
    if not q:
        break
    t += 1
    q.pop()
    if not q:
        f = 1
        break
q = deque(a)
t = 1
while 1:
    q.pop()
    if not q:
        break
    while q and q[0] == t:
        q.popleft()
    if not q:
        f = 1
        break
    t += 1
print "First" if f else "Second"

Submission status: Wrong Answer

Solution code:
n = input()
a = sorted(map(int, raw_input().split()),reverse=True)
i = 0
j = 0
k = 0
p = ["First","Second"]
while True:
    # print j,k,a[j]-k
    if a[j]-k + i % 2 == 0:
        if j == n-1:
            print p[i%2]
            exit()
        k += 1
    else:
        if j == n-1:
            print p[(i+1)%2]
            exit()
        j += 1
    i += 1

Submission status: Wrong Answer

Solution code:
n = input()
a = sorted(map(int, raw_input().split()),reverse=True)
i = 0
j = 0
k = 0
p = ["First","Second"]
while True:
    print j,k,a[j]-k
    if a[j]-k + i % 2 == 0:
        if j == n-1:
            print p[i%2]
            exit()
        k += 1
    else:
        if j == n-1:
            print p[(i+1)%2]
            exit()
        j += 1
    i += 1

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit
setrecursionlimit(50010)
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif (a[j] - t) == 1:
        return not f(i, a[j])
    else:
        return x ^ y ^ ((n - i) & 1)
print "First" if f(0, 0) else "Second"

Submission status: Wrong Answer

Solution code:
# coding: utf-8

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect

def eat_all(al):
    for i in range(len(al)):
        al[i] -= 1
    while True:
        if al[0] == 0:
            al.pop(0)
        else:
            break
    return al

def step(turn, a_list):
    if len(a_list) == 1:
        if a_list[0] % 2 == 0:
            return turn
        else:
            return (not turn)
    if a_list[-1] % 2 != 0:
        a_list.pop()
        return step(not turn, a_list)
    else:
        a_list = eat_all(a_list)
        a_list.pop()
        if len(a_list) == 0:
            return turn
        return step(turn, a_list)

n = int(input())
a_list = [None] * n
inputs = input().split(" ")
for i in range(n):
    a_list[i] = int(inputs[i])
a_list.sort()
win = step(1, a_list)
if win == 1:
    print("First")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int, input().split()))
a.sort()
print('First' if (a[0]+n)%2==1 else 'Second')

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit
setrecursionlimit(50010)
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif (a[j] - t) == 1 and not y:
        return not f(i, a[j])
    else:
        return x ^ y ^ ((n - i) & 1)
print "First" if f(0, 0) else "Second"

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
print(["First","Second"][(max(A) - min(A) + N) % 2])

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit
setrecursionlimit(50010)
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif y:
        return x ^ y ^ ((n - i) & 1)
    else:
        return not f(i, a[j])
print "First" if f(0, 0) else "Second"

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
ins = raw_input()
ins = ins.split()
ins = map(int,ins)
ans = reduce(lambda a,b: a^b,ins,0)
if(ans == 0):
    print "Second"
else:
    print "First"

Submission status: Wrong Answer

Solution code:
import numpy as np
input1 = raw_input()
input2 = raw_input()
N = int(input1)
list = input2.split()
a = np.zeros(len(list), np.uint8)
for i, element in enumerate(list):
    a[i] = int(element)

if N == 2 and a.min() == 1:
    print 'First'
elif (a - 1).sum() == 1:
    print 'First'
else:
    print 'Second'

Submission status: Wrong Answer

Solution code:
import numpy as np
input1 = raw_input()
input2 = raw_input()
N = int(input1)
list = input2.split()
a = np.zeros(len(list), np.uint8)
for i, element in enumerate(list):
    a[i] = int(element)

if N == 2 and a.min() == 1:
    print 'Frise'
elif (a - 1).sum() == 1:
    print 'First'
else:
    print 'Second'

Submission status: Time Limit Exceeded

Solution code:
n = input()
A = sorted(map(int, raw_input().split()), reverse=True)

x = 0
y = 0

def is_lose(x, y):
    return x >= n or y >= A[x]
    
while not is_lose(x+1, y+1):
    x += 1
    y += 1

x_ = x
count_x = 0
while not is_lose(x_+1, y):
    x_ += 1
    count_x += 1
    
y_ = y
count_y = 0
while not is_lose(x, y_+1):
    y_ += 1
    count_y += 1

if (count_x%2 == 0) and (count_y%2 == 0):
    print "Second"
else:
    print "First"

Submission status: Memory Limit Exceeded

Solution code:

def turn(s, x):
  if len(x) == 0: return True
  if len(x) == 1: return x[0]%2 == 0

  b = [i-1 for i in x if i!=1]
  a = list(x)
  a.remove(max(a))

  if (not turn(1-s, a)) or (not turn(1-s, b)):
    return True
  else:
    return False

N = int(raw_input())
x = map(int, raw_input().split())
if turn(0, x):
  print 'First'
else:
  print 'Second'

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.append(0)
A.sort()
winner=""
for i in range(N+1):
    if A[N-i]>i:
        if (A[N-i]-i)%2==0:
            winner="First"
        else:
            winner="Second"
    elif A[N-i]==i:
        if (A[N-i+1]-A[N-i])%2==1:
            winner="First"
            break
        else:
            count=0
            for j in range(N-i,-1,-1):
                if A[j]==i:
                    count+=1
                else:
                    break
            if count%2==1:
                winner="First"
            else:
                winner="Second"
            break
    else:
        break

print(winner)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
a.append(0)
i = 0
j = 0
while i + 1 < a[i + 1]:
    i += 1
    j += 1
while i + 1 <= a[j]:
    j += 1
if (j - i) % 2 == 0 or (a[i] - i) % 2 == 0:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
import sys

n, *aaa = map(int, sys.stdin.read().split())

aaa.sort(reverse=True)
aaa.append(-1)
i = 0
while aaa[i + 1] > i + 1:
    i += 1

j = i
while aaa[j] >= i + 1:
    j += 1

if (aaa[i] - i) % 2 == 0 or (j - i) % 2 == 0:
    ans = 0
else:
    ans = 1

print(['First', 'Second'][ans])

Submission status: Accepted

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=0
while n:i+=a[i]>i;j+=a[j]>=i;n-=1
print('SFeicrosntd'[(a[i-1]^i|j^i)&1::2])

Submission status: Accepted

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=0
for x in range(n):i+=a[i]>i;j+=a[j]>=i
print('SFeicrosntd'[(a[i-1]^i|j^i)&1::2])

Submission status: Accepted

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=0
for x in range(n):i+=a[i]>i;j+=a[j]>=i
print('SFeicrosntd'[(a[i-1]^i)&1|(j^i)&1::2])

Submission status: Accepted

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=0
while i<n and a[i]>i:i+=1
while j<n and a[j]>=i:j+=1
print('SFeicrosntd'[(a[i-1]^i)&1|(j^i)&1::2])

Submission status: Accepted

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
i=0
while i<n and a[i]>i:i+=1
j=i
while j<n and a[j]>=i:j+=1
print('SFeicrosntd'[(a[i-1]-i)&1 or (j-i)&1::2])

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split())) + [0]
a.sort(reverse=True)
for i in range(n):
    if a[i + 1] <= i + 1:
        y = a[i + 1:].count(i + 1)
        x = i - a[i] - 1
        if x % 2 == 0 and y % 2 == 0:
            print('Second')
        else:
            print('First')
        break

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

a.sort(reverse=True)
a.append(0)

#after win=false first win = true
ans = False

for i in range(n):
    if i+1>=a[i+1]:
        ans=(((a[i]-i)%2)==0)
        for j in range(i+1,n+1):
            if a[j]<=i:
                ans = ans or (((i-j)%2)==0)
                break
        break

if ans:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,*A = map(int,read().split())

A.sort(reverse = True)

A.append(0)
i = 0
while A[i + 1] > i + 1:
    i += 1

x = A[i] - (i + 1)
y = max(j for j in range(N) if A[j] > i) - i

answer = 'First' if x&1 or y&1 else 'Second'
print(answer)

Submission status: Accepted

Solution code:
n=int(raw_input())
a=sorted(map(int,raw_input().split()))
a.reverse()
i=0
while i<n and a[i]>=i+1:i+=1
j=i
while j<n and a[j]>=i:j+=1
print 'First' if (a[i-1]-i)%2 or (j-i)%2 else 'Second'

Submission status: Accepted

Solution code:
n=int(raw_input())
a=sorted(map(int,raw_input().split()))
a.reverse()
i=0
while i<n and a[i]>=i+1:i+=1
m1=a[i-1]-i
j=i
while j<n and a[j]>=i:j+=1
m2=j-i
print 'First' if (m1%2 or m2%2) else 'Second'

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7


def f():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    a.reverse()
    i = j = 0
    while i+1 < n and a[i+1] > j+1:
        i += 1
        j += 1
    if (a[i] - j - 1) % 2 == 1:
        return 'First'
    k = 0
    while i+1 < n and a[i+1] > j:
        i += 1
        k += 1
    if k % 2 == 1:
        return 'First'
    return 'Second'

print(f())

Submission status: Accepted

Solution code:
n = input()
A = sorted(map(int, raw_input().split()), reverse=True)

x = 0
y = 0

def is_lose(x, y):
    return x >= n or y >= A[x]
    
while not is_lose(x+1, y+1):
    x += 1
    y += 1

x_ = x
count_x = 0
while not is_lose(x_+1, y):
    x_ += 1
    count_x += 1
    
count_y = A[x] - 1 - y

if (count_x%2 == 0) and (count_y%2 == 0):
    print "Second"
else:
    print "First"

Submission status: Accepted

Solution code:
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"

Submission status: Runtime Error

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=0
while n:i+=a[i]>i;j+=a[j]>=i,n-=1
print('SFeicrosntd'[(a[i-1]^i|j^i)&1::2])

Submission status: Runtime Error

Solution code:
n=int(input())
a=sorted(map(int,input().split()))[::-1]
j=i=x=0
while x<n:i+=a[i]>i;j+=a[j]>=i,x+=1
print('SFeicrosntd'[(a[i-1]^i|j^i)&1::2])

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,*A = map(int,read().split())

A.sort(reverse = True)

A.append(0)
i = 0
while A[i + 1] < i + 1:
    i += 1

x = A[i] - (i + 1)
y = max(j for j in range(N) if A[j] <= i + 1) - i

answer = 'First' if x&1 or y&1 else 'Second'
print(answer)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

i = 0
j = N-1
t = 0
while True:
    j -= 1
    if i == j:
        if (a[i] - t) % 2 == 1:
            win1 = 0
        else:
            win1 = 1
        break
    t += 1
    while a[i] == t:
        i += 1
    if i == j:
        if (a[i] - t) % 2 == 1:
            win1 = 1
        else:
            win1 = 0
        break

i = 0
j = N-1
t = 0
while True:
    t += 1
    while a[i] == t:
        i += 1
    if i == j:
        if (a[i] - t) % 2 == 1:
            win2 = 0
        else:
            win2 = 1
        break
    j -= 1
    if i == j:
        if (a[i] - t) % 2 == 1:
            win2 = 1
        else:
            win2 = 0
        break

if win1 == 1 and win2 == 1:
    print('Second')
else:
    print('First')

Submission status: Runtime Error

Solution code:
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"

Submission status: Runtime Error

Solution code:
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif (a[j] - t) == 1:
        return not f(i, a[j])
    else:
        return x ^ y ^ ((n - i) & 1)
print "First" if f(0, 0) else "Second"

Submission status: Runtime Error

Solution code:
import numpy as np
input1 = raw_input()
input2 = raw_input()
N = int(input1)
list = input2.split()
a = np.zeros(len(list), np.uint8)
for i, element in enumerate(list):
    a[i] = int(element)

def play(turn, a, N):
    if N == 1 and a[0] == 1:
        if turn % 2 == 0:
            print 'Second'
        else:
            print 'First'
        return 0
                
    if (a - 1).sum() == 1:
        if turn % 2 == 0:
            print 'First'
        else:
            print 'Second'
        return 0

    if N == 2 and a.min() == 1:
        if turn % 2 == 0:
            print 'First'
        else:
            print 'Second'
        return 0

    if N == 2 and (a - 1).sum == 2:
        if turn % 2 == 0:
            print 'Second'
        else:
            print 'First'
        return 0

    if N == 1:
        a[0] -= 1
        play(turn + 1, a, 1)
    else:
        a[np.argmax(a)] = 0
        play(turn + 1, a[a > 0], N-1)

play(0, a, N)

Submission status: Runtime Error

Solution code:
import numpy as np
input1 = raw_input()
input2 = raw_input()
N = int(input1)
list = input2.split()
a = np.zeros(len(list), np.uint8)
for i, element in enumerate(list):
    a[i] = int(element)

def play(turn, a, N):
    if N == 1 and a[0] == 1:
        if turn % 2 == 0:
            print 'Second'
        else:
            print 'First'
        return 0
                
    if (a - 1).sum() == 1:
        if turn % 2 == 0:
            print 'First'
        else:
            print 'Second'
        return 0

    if N == 2 and a.min() == 1:
        if turn % 2 == 0:
            print 'First'
        else:
            print 'Second'
        return 0

    if N == 1:
        a[0] -= 1
        play(turn + 1, a, 1)
    else:
        a[np.argmax(a)] = 0
        play(turn + 1, a[a > 0], N-1)

play(0, a, N)

Submission status: Runtime Error

Solution code:
import numpy as np
input1 = raw_input()
input2 = raw_input()
N = int(input1)
list = input2.split()
a = np.zeros(len(list), np.uint8)
for i, element in enumerate(list):
    a[i] = int(element)

def play(turn, a, N):
    if N == 1 and a[0] == 1:
        if turn % 2 == 0:
            print 'Second'
        else:
            print 'First'
        return 0
                
    if (a - 1).sum() == 1:
        if turn % 2 == 0:
            print 'First'
        else:
            print 'Second'
        return 0

    if N == 1:
        a[0] -= 1
        play(turn + 1, a, 1)
    else:
        a[np.argmax(a)] = 0
        play(turn + 1, a[a > 0], N-1)

play(0, a, N)