Problem:


Score : 500 points

Problem Statement

There is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.

You and Lunlun the dachshund alternately perform the following operation (starting from you):

Choose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.

The one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?

Constraints

1 \leq N \leq 10^5

1 \leq a_i \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
a_1
a_2
:
a_N

Output

If you will win, print first; if Lunlun will win, print second.

Sample Input 1

2
1
2

Sample Output 1

first

Let Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.

You should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.

Note that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).

Sample Input 2

3
100000
30000
20000

Sample Output 2

second



Sample input:
2
1
2


Sample output:
first

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]

if all([int(a % 2 == 0) for a in A]):
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
cnt1 = A.count(1)

if cnt1 % 2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())

even = 0
for i in range(n):
    a = int(input())
    even += 1-a%2

if even == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]+[10**10]

if sum(A)%2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
if len(a) == 1:
    if a[0]%2 == 0:
        print('second')
    else:
        print('first')
    
else:
    num = a[-1]-a[-2]
    if num%2 == 0:
        print('second')
    else:
        print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [0]
for i in range(n):
    lst.append(int(input()))

lst.sort()
diff = lst[-1]-lst[-2]
if diff%2==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 'second' if any(a[i] % 2 == 0 for i in range(n)) else 'first'
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

# ddict = defaultdict(lambda: 0)
# ddict = defaultdict(lambda: 1)
# ddict = defaultdict(lambda: int())
# ddict = defaultdict(lambda: list())
# ddict = defaultdict(lambda: float())

n = I()
a = CI(n)

if n==1:
    if a[0]%2==0:
        print("second")
        exit()
    else:
        print("first")
        exit()

s = 0
f = 0
for i in range(n):
    if a[i]%2==0:
        s += 1
    else:
        f += 1

if f>=s:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

# ddict = defaultdict(lambda: 0)
# ddict = defaultdict(lambda: 1)
# ddict = defaultdict(lambda: int())
# ddict = defaultdict(lambda: list())
# ddict = defaultdict(lambda: float())

n = I()
a = CI(n)

s = 0
f = 0
for i in range(n):
    if a[i]%2==0:
        s += 1
    else:
        f += 1

if f>=s:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())
gu = 0
ki = 0
for i in range(N):
    a = int(input())
    if a//2 == 1:
        ki += 1
    else:
        gu += 1

if ki % 2 == 0:
    ans = "second"
else:
    ans = "first"

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = "second"
for i in range(N):
    a = int(input())
    if a//2 == 1:
        ans = "first"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(input()) for _ in range(n)]

for a in A:
    if a != 1:
        break
else:
    print('first')
    exit()

cnt = 0
for a in A:
    if a%2 == 0:
        cnt += 1
if cnt == n:
    print('second')
elif cnt == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [int(input()) for _ in range(n)]
cnt = 0
for a in A:
    if a%2 == 0:
        cnt += 1
if cnt == n:
    print('second')
elif cnt == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
N=int(input())
A_sum=0
for i in range(N):
    A_sum+=int(input())
    A_sum%=2

if A_sum:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)
b = True
for i in range(n):
    if l[i] % 2 != 0:
        b = False
if b:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
s = 1
for i in range(n):
    if a[i]%2 == 1:
        s = 0
        break
print(["first","secound"][s])

Submission status: Wrong Answer

Solution code:
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1
if flag=="0":
    print("second")
else:
    print("first")

###1個
#111
#奇数ならfirst 偶数ならsecond

###２個
#111
#111
#奇数奇数ならfirst
#11
#11
#偶数偶数ならsecond
#

Submission status: Wrong Answer

Solution code:
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1
if flag=="1":
    print("Second")
else:
    print("First")

###1個
#111
#奇数ならfirst 偶数ならsecond

###２個
#111
#111
#奇数奇数ならfirst
#11
#11
#偶数偶数ならsecond
#

Submission status: Wrong Answer

Solution code:
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1
if flag=="0":
    print("Second")
else:
    print("First")

###1個
#111
#奇数ならfirst 偶数ならsecond

###２個
#111
#111
#奇数奇数ならfirst
#11
#11
#偶数偶数ならsecond
#

Submission status: Wrong Answer

Solution code:

def main():
	n = int(input())
	ans =0
	for i in range(0 , n):
		t = int(input())
		ans = ans+(t%2)
	if ans%2!=0:
		print("first")
	else:
		print("second")
if __name__=="__main__":
	main()

Submission status: Wrong Answer

Solution code:

        
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()

    n = int(input())
    flag = 0
    for i in range(n):
        a = int(input())
        flag &= (a%2 == 1)
    if flag:
        print('first')
    else:
        print('second')

    




                
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    cnt = 0
    for i in(a):
        xors ^= i
        cnt += i % 2

    if(xors != 0 or cnt == n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    cnt = 0
    for i in(a):
        xors ^= i
        cnt += i % 2
    print(xors)
    if(xors != 0 or cnt == n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or su <= n + 1):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or su <= 2 * n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or su == n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or sum == n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans % 2 == 1):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans * 2 >= n):
        print('first')
    else:
        print('second')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans * 2 >= n):
        print('first')
    else:
        print('no')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([int(input()) for i in range(n)])
    ans = sum(a)
    if(ans % 2 == 0 and n != ans):
        print('second')
    else:
        print('first')

main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = list([int(input()) for i in range(n)])
    ans = sum(a)
    if(ans % 2 == 0):
        print('second')
    else:
        print('first')

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2 + (sum(A) - A.count(1)) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2 + sum(A) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    if N == 1:
        grundy = A[0] % 2
    else:
        grundy = (A[1] - A[0]) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    if N == 1:
        grundy = A[0] % 2
    elif A[0] > 1:
        grundy = 0
    else:
        grundy = (A[1] - A[0]) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = sum(A) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Wrong Answer

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [0]*n
count = 0
for i in range(n):
    a[i] = INT()
    if a[i] % 2 == 0:
        count += 1

if count == 1 or count % 2 == 0:
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [0]*n
for i in range(n):
    a[i] = INT()

if sum(a) < n + 1:
    if n == 1 or n % 2 == 0:
        ans = "first"
    else:
        ans = "second"
else:
    if ( sum(a) - (n+1) ) % n == 0:
        ans = "first"
    else:
        ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [0]*n
for i in range(n):
    a[i] = INT()

if max(a) == 1:
    if n == 1 or n % 2 == 0:
        ans = "first"
    else:
        ans = "second"
elif sum(a) % 2 == 1:
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [0]*n
for i in range(n):
    a[i] = INT()

if sum(a) % 2 == 1:
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

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

if n == 1:
    print("first")
elif (a[-1] - a[-2]) % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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

if n == 1:
    print("first")
elif a[-1] == a[-2]:
    print("first")
elif (a[-1] - a[-2]) % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    A = [int(input()) for _ in range(n)]
    if any([a % 2 != 0 for a in A]):
        print('second')
    else:
        print('first')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
odd = 0
for i in range(N):
    a = int(input())
    if a % 2 == 1:
        odd += 1
if odd % 2 == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
ans = 0
for i in range(N):
    a.append(int(input()))
    ans += a[i]
if ans % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N, *a = map(int, open(0))
    if max(a)-min(a) % 2 == 1:
        print('first')
    else:
        print('second')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
print('first' if any(x%2 for x in a) else 'second')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
print('second' if all(i%2==0 for i in a) else 'first')

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
# if any(item%2==1 for item in a):
if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")



n = int(input())
a = list(map(int, input().split()))
if any(item%2==1 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = sum(item%2==1 for item in a)
if val!=0:
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = sum(item%2==1 for item in a)
if val%2==1:
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=[int(input()) for i in range(n)]

f="first"
s="second"
# print(a)
if sum(a)==n or sum(a)==n+1:
    print(f)
    exit()
# print(sum(a)%2)
if sum(a)%2:
    print(f)
else:
    print(s)

Submission status: Wrong Answer

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=[int(input()) for i in range(n)]

f="first"
s="second"
# print(a)
if sum(a)==n:
    print(f)
    exit()
# print(sum(a)%2)
if sum(a)%2:
    print(f)
else:
    print(s)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/caddi2018/tasks/caddi2018_b

n = int(input())
odd = even = 0
for _ in range(n):
    apple = int(input())
    if apple % 2 == 0:
        even += 1
    else:
        odd += 1

if odd % 2 == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
if sum(a)%2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  s = int(input())
  a.append(s%2)
k = sum(a)

if(k%2)or (n==2 and k==1):
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  s = int(input())
  a.append(s%2)
k = sum(a)
if(k%2):
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())
even = 0
A = []

for i in range(N):
    a = int(input())
    if not a%2:
        even += 1
    A.append(a)

if N == 1:
    print("sfeicrosntd"[(A[0]%2)::2])
elif sum(A) == N:
    print("sfeicrosntd"[(sum(A)%2)::2])
else:
    if even == N:
        print("second")
    else:
        print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
even = 0
A = []

for i in range(N):
    a = int(input())
    if not a%2:
        even += 1
    A.append(a)

if N == 1:
    print("sfeicrosntd"[(A[0]%2)::2])
elif N == 2:
    print("second")
else:
    if even == N:
        print("second")
    else:
        print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
even = 0
A = []

for i in range(N):
    a = int(input())
    if not a%2:
        even += 1
    A.append(a)

if N == 1:
    print("sfeicrosntd"[(A[0]%2)&0::2])
elif N == 2:
    print("first")
else:
    if even == N:
        print("second")
    else:
        print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
even = 0
A = []

for i in range(N):
    a = int(input())
    if not a%2:
        even += 1
    A.append(a)

if N == 1:
    print("sfeicrosntd"[(A[0]%2)&0::2])
else:
    if even == N:
        print("second")
    else:
        print("first")

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(input()) for _ in range(n)]
print("first" if sum(arr) % 2 == 1 else "second")

Submission status: Wrong Answer

Solution code:
n = int(input())

b = 0
c = 0
for i in range(n):
    a = int(input())
    if a % 2 == 0:
        b += 1
    else:
        c += 1

if (b-c) % 2 == 0:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



n=int(input())
#n,m=input_list()
start=0
#a=input_list()
tmp=[int(input()) for _ in range(n)]
a=[]
for each in tmp:
    if each !=1:
        a.append(each)
if len(a)!=0:
    a.pop()

if sum(a)==0:
    print("first")
    exit()
for each in a:
    if each%2==1:
        start=1-start

if start==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



n=int(input())
#n,m=input_list()
start=0
#a=input_list()
a=[int(input()) for _ in range(n)]
if sum(a)==n:
    print("first")
    exit()
for each in a:
    if each%2==1:
        start=1-start

if start==1:
    print("first")
else:
    print("second")