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

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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])

Solution (Python):
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])

Solution (Python):
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])

Solution (Python):
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])

Solution (Python):
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])

Solution (Python):
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])

Solution (Python):
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

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

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


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")

Solution (Python):
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)

Solution (Python):
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'

Solution (Python):
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'

Solution (Python):
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())

Solution (Python):
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"

Solution (Python):
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"