ZhenlongDai/ACPR huggingface dataset:
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import statistics


if __name__ == '__main__':
    N = int(input())
    d_list = list(map(int, input().split()))

    med_low = statistics.median_low(d_list)
    med_high = statistics.median_high(d_list)

    if med_high == med_low:
        answer = 0
    else:
        if d_list.count(med_high) == 1:
            answer = med_high - med_low
        else:
            answer = med_high - med_low - 1

    print(answer)


Failing test case input:
8
0 1 26 5 0 4 4 0

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
import statistics


if __name__ == '__main__':
    N = int(input())
    d_list = list(map(int, input().split()))

    med_low = statistics.median_low(d_list)
    med_high = statistics.median_high(d_list)

    if med_high == med_low:
        answer = 0
    else:
        answer = med_high - med_low

    print(answer)

Problem: p02989
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
N_List = sorted(list(map(int,input().split())))
std = int(N/2)
ansstd = N_List[std] - N_List[std-1] 
print((0,ansstd)[ansstd > 1])

Failing test case input:
6
3 1 0 4 2 7

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
N_List = sorted(list(map(int,input().split())))
std = int(N/2)
ansstd = N_List[std] - N_List[std-1] 
print((0,ansstd)[ansstd > 0])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d_list = [int(i) for i in input().rstrip().split(' ')]
d_list.sort()
print(d_list)

a = int(n/2) -1
b = int(n/2)

if d_list[a] == d_list[b]:
  print(0)
else:
  print(d_list[b] - d_list[a])


Failing test case input:
14
3728 14 455 0 0 232 832 12092 70 1 -3 805 001110 4

Expected output:
162


Actual output:
[-3, 0, 0, 1, 4, 14, 70, 232, 455, 805, 832, 1110, 3728, 12092]
162


Fixed submission (verdict: Accepted):
n = int(input())
d_list = [int(i) for i in input().rstrip().split(' ')]
d_list.sort()

a = int(n/2) -1
b = int(n/2)

if d_list[a] == d_list[b]:
  print(0)
else:
  print(d_list[b] - d_list[a])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = list(map(int,input().split()))
d.sort()
m = int(len(d)/2)
ml = d[m-1]
mr = d[m]

if mr - ml <= 1:
	print(0)
else:
	print(mr - ml)

Failing test case input:
6
5 0 0 4 6 7

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
d = list(map(int,input().split()))
d.sort()
m = int(len(d)/2)
ml = d[m-1]
mr = d[m]

if mr - ml < 1:
	print(0)
elif mr- ml ==1:
	print(1)
else:
	print(mr - ml)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
value = list(map(int,input().split()))
value.sort()
print(value)
print(value[(int(N/2))]-value[(int(N/2))-1]+1)

Failing test case input:
8
0 1 9 3 -1 8 0 0

Expected output:
1


Actual output:
[-1, 0, 0, 0, 1, 3, 8, 9]
2


Fixed submission (verdict: Accepted):
N = int(input())
value = list(map(int,input().split()))
value.sort()
print(value[(int(N/2))]-value[(int(N/2))-1])
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
gn=0
a=d[int(n/2)]-d[int((n/2)-1)]-1

if d[int(n/2)]!=d[int((n/2)-1)]:
  for i in d:
    if i==d[int(n/2)]:
      gn+=1
  if gn==1:
    a+=1
  print(a)
else:
  print(0)

Failing test case input:
8
0 1 26 5 0 4 4 0

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
gn=0
a=d[int(n/2)]-d[int((n/2)-1)]-1

if d[int(n/2)]!=d[int((n/2)-1)]:
  for i in d:
    if i==d[int(n/2)]:
      gn+=1
  if gn>=1:
    a+=1
  print(a)
     
else:
  print(0)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
value = list(map(int,input().split()))
value.sort()
print(value)
print(value[(int(N/2))]-value[(int(N/2))-1])

Failing test case input:
14
3728 87 455 12 0 714 447 12092 70 0 -1 562 011110 1

Expected output:
360


Actual output:
[-1, 0, 0, 1, 12, 70, 87, 447, 455, 562, 714, 3728, 11110, 12092]
360


Fixed submission (verdict: Accepted):
N = int(input())
value = list(map(int,input().split()))
value.sort()
print(value[(int(N/2))]-value[(int(N/2))-1])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n =int(input())
d = list(map(int,input().split()))

cnt = 0

d.sort()

print(d)
print(d[int(n/2)] - d[int(n/2-1)])

Failing test case input:
14
8817 245 150 1575 90 5308 971 6261 203 93 13 194 001110 0

Expected output:
42


Actual output:
[0, 13, 90, 93, 150, 194, 203, 245, 971, 1110, 1575, 5308, 6261, 8817]
42


Fixed submission (verdict: Accepted):
n =int(input())
d = list(map(int,input().split()))

cnt = 0

d.sort()


print(d[int(n/2)] - d[int(n/2-1)])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
D = list(map(int,input().split()))
D.sort()
mid = int(len(D)/2)
print(mid)
ans = D[mid]-D[mid-1]
print(ans)


Failing test case input:
14
36236 55 235 173 1 1118 372 12407 43 0 2 257 011110 0

Expected output:
62


Actual output:
7
62


Fixed submission (verdict: Accepted):
N = int(input())
D = list(map(int,input().split()))
D.sort()
mid = int(len(D)/2)
ans = D[mid]-D[mid-1]
print(ans)
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input().rstrip())
line = input().rstrip()
l = [int(v) for v in line.split()]
l.sort()
uniq_list = sorted(list(set(l)))
result = 0
cur_i = 0
for i in range(len(uniq_list)):
    for j in range(cur_i, len(l)):
        if uniq_list[i] == l[j]:
            if (N / 2) == j:
                result = uniq_list[i] - uniq_list[i - 1]
                break
            else:
                cur_i = j + 1

print(result)

Failing test case input:
8
0 1 26 5 3 4 4 14

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input().rstrip())
line = input().rstrip()
l = [int(v) for v in line.split()]
l.sort()
uniq_list = sorted(list(set(l)))
result = 0
start_at = 0
for i in range(len(uniq_list)):
    for j in range(start_at, len(l)):
        if uniq_list[i] == l[j]:
            if (N / 2) == j:
                result = uniq_list[i] - uniq_list[i - 1]
            else:
                start_at = j + 1
            
            break

print(result)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

def is_odd(num):
    if num % 2 == 1:
        return True
    else:
        return False


n=int(input())


d=list(map(int,input().split()))

d=sorted(d)
LEN=int(len(d)/2)
if is_even(LEN):
    print(d[LEN]-d[LEN-1]+1)

elif is_odd(LEN):
    print(d[LEN]-d[LEN-1])



Failing test case input:
8
0 1 40 5 0 4 4 0

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

def is_odd(num):
    if num % 2 == 1:
        return True
    else:
        return False


n=int(input())


d=list(map(int,input().split()))

d=sorted(d)
LEN=int(len(d)/2)
if is_even(LEN):
    if d[LEN]==d[LEN-1]:
        print(0)

    else:
        print(d[LEN]-d[LEN-1])

elif is_odd(LEN):
    if d[LEN]==d[LEN-1]:
        print(0)

    else:
        print(d[LEN]-d[LEN-1])

Problem: p02989
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
N_List = sorted(list(map(int,input().split())))
std = int(N/2)
ansstd = N_List[std] - N_List[std-1] 
print((0,ansstd-1)[ansstd > 1])

Failing test case input:
14
26445 23 347 37 65 3898 493 12407 197 5 10 257 011100 0

Expected output:
60


Actual output:
59


Fixed submission (verdict: Accepted):
N = int(input())
N_List = sorted(list(map(int,input().split())))
std = int(N/2)
ansstd = N_List[std] - N_List[std-1] 
print((0,ansstd)[ansstd > 0])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
inp = [int(x) for x in input().split()]
med=int(len(inp)/2)
print(inp[med]-inp[med-1])

Failing test case input:
14
86113 3566 306 11668 74746 8478 23677 84052 60113 19737 11912 11858 001011 -2

Expected output:
54


Actual output:
60375


Fixed submission (verdict: Accepted):
a=int(input())
inp = [int(x) for x in input().split()]
inp.sort()
med=int(len(inp)/2)
print(inp[med]-inp[med-1])
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
d = list(map(int,input().split()))

d.sort()
print(d)

a = int(int(n)/2-1)
b = int(int(n)/2)

print(d[a])
print(d[b])

if d[b] - d[a] == 2:
  print("2")
elif d[b] - d[a] == 1:
  print("1")
else:
  print("0")



Failing test case input:
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 51211 93284 100000 0

Expected output:
25993


Actual output:
[0, 10342, 11639, 21912, 29105, 30914, 51211, 77204, 78532, 83018, 92015, 93284, 99592, 100000]
51211
77204
0


Fixed submission (verdict: Accepted):
n = input()
d = list(map(int,input().split()))

d.sort()

a = int(int(n)/2-1)
b = int(int(n)/2)

if d[b] - d[a] > 0:
  print(d[b]-d[a])
else:
  print("0")

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
d = list(map(int, input().split()))

d.sort()
print(d)

d_len = len(d)

if d_len % 2 == 0:
    up = int(d_len/2)
    down = int(d_len/2) - 1
    if up == down:
        print('0')
    else:
        print(d[up]-d[down])
            
        

else:
    print('0')

Failing test case input:
8
0 1 24 3 0 8 0 0

Expected output:
1


Actual output:
[0, 0, 0, 0, 1, 3, 8, 24]
1


Fixed submission (verdict: Accepted):
N = int(input())
d = list(map(int, input().split()))

d.sort()


d_len = len(d)

if d_len % 2 == 0:
    up = int(d_len/2)
    down = int(d_len/2) - 1
    if up == down:
        print('0')
    else:
        print(d[up]-d[down])
            
        

else:
    print('0')

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
L=list(map(int,input().split()))
L.sort
d=L[int(n/2)-1]-L[int(n/2)]


print(d)




Failing test case input:
14
3728 87 455 12 0 714 447 12092 70 0 -1 562 011110 1

Expected output:
360


Actual output:
-11645


Fixed submission (verdict: Accepted):
n=int(input())
L=list(map(int,input().split()))
L.sort()
d=L[n

print(d)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]
print(left, right)
diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)

Failing test case input:
14
3728 14 30 -1 0 149 832 5835 0 1 -3 350 001110 2

Expected output:
16


Actual output:
14 30
16


Fixed submission (verdict: Accepted):
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]

diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()

s=0
N=int(n/2)
k=abs(d[N]-d[N-1])
K=int((d[N]+d[N-1])/2)
for i in range(n):
    if d[i]>=K:
        s=s+1
    else:
        s=s

if s==N:
    print(k)
else:
    print(0)

Failing test case input:
6
5 0 4 7 6 7

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
s=0
N=int(n/2)
k=int(abs(d[N]-d[N-1]))
K=(d[N]+d[N-1])/2
for i in range(n):
    if d[i]>=K:
        s=s+1
    else:
        s=s
if s==N:
    print(k)
else:
    print(0)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
d_list = list(map(int, input().split()))
d_list.sort()

k = d_list[int(N/2)]
print(k)

count = 0
for i in range(N):
    if count == int(N/2):
        print('k is ' + str(k)) 
        print(d_list[int(N/2)] - d_list[int(N/2)-1])
        break
    elif k > d_list[i]:
        count += 1
    else:
        pass
else: 
    print(0)


Failing test case input:
8
0 1 24 3 0 8 4 0

Expected output:
2


Actual output:
3
k is 3
2


Fixed submission (verdict: Accepted):
N = int(input())
d_list = list(map(int, input().split()))
d_list.sort()

k = d_list[int(N/2)]
count = 0
for i in range(N):
    if count == int(N/2):
        print(d_list[int(N/2)] - d_list[int(N/2)-1])
        break
    elif k > d_list[i]:
        count += 1
    else:
        pass
else: 
    print(0)

Problem: p02989
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
l = sorted(list(map(int, input().split())))
d = int(n / 2)
r = l[d] - l[d-1]
print(l)
print(r)

Failing test case input:
14
86113 3566 306 11668 74746 8478 23677 84052 60113 19737 11912 11858 001011 -2

Expected output:
54


Actual output:
[-2, 306, 1011, 3566, 8478, 11668, 11858, 11912, 19737, 23677, 60113, 74746, 84052, 86113]
54


Fixed submission (verdict: Accepted):
n = int(input())
l = sorted(list(map(int, input().split())))
d = int(n / 2)
r = l[d] - l[d-1]
print(r)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=sorted(list(map(int,input().split())))
print(d)
res=0
if n % 2 == 0:
    m=int(n/2)
    
    if d[m-1] == d[m]:
        pass
    else:
        res = d[m] - d[m-1] 

else:
    pass
    
    
print(res)

Failing test case input:
14
4470 3566 38 29199 22 21666 33590 5325 16829 43835 29 1770 000011 0

Expected output:
904


Actual output:
[0, 11, 22, 29, 38, 1770, 3566, 4470, 5325, 16829, 21666, 29199, 33590, 43835]
904


Fixed submission (verdict: Accepted):
n=int(input())
d=sorted(list(map(int,input().split())))

res=0
if n % 2 == 0:
    m=int(n/2)
    
    if d[m-1] == d[m]:
        pass
    else:
        res = d[m] - d[m-1] 

else:
    pass
    
    
print(res)
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())

d = list(map(int,input().split()))

d.sort()
print(d)

k = int(N/2)
Ans = d[k] - d[k-1]

print(Ans)


Failing test case input:
14
99592 10342 29105 78532 83018 11639 92015 127350 30914 39830 51211 93284 100000 0

Expected output:
27321


Actual output:
[0, 10342, 11639, 29105, 30914, 39830, 51211, 78532, 83018, 92015, 93284, 99592, 100000, 127350]
27321


Fixed submission (verdict: Accepted):

N = int(input())

d = list(map(int,input().split()))

d.sort()

k = int(N/2)
Ans = d[k] - d[k-1]

print(Ans)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=list(map(int,input().split()))
print(s)
changed=sorted(s,reverse=True)

if n%2==0:
    if changed[int(n/2-1)]==changed[int(n/2)]:
        print(0)
    else:
        print(-changed[int(n/2)]+changed[int(n/2-1)])
else:
    print(0)

Failing test case input:
8
0 1 26 5 0 4 4 0

Expected output:
3


Actual output:
[0, 1, 26, 5, 0, 4, 4, 0]
3


Fixed submission (verdict: Accepted):
n=int(input())
s=list(map(int,input().split()))

changed=sorted(s,reverse=True)


if changed[int(n/2-1)]==changed[int(n/2)]:
        print(0)
else:
        print(-changed[int(n/2)]+changed[int(n/2-1)])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
num=list(map(int,input().split()))
num.sort()
print(num[int(n/2)],num[int(n/2) -1])
if num[int(n/2)-1]==num[int(n/2)]:
    a=0
elif not num[int(n/2)]==num[int(n/2) -1]:
    a= num[int(n/2)] - num[int(n/2)-1]
print(a)

Failing test case input:
14
4470 1096 127 3147 15 21666 11950 5325 16829 440 21 5070 000000 0

Expected output:
2051


Actual output:
3147 1096
2051


Fixed submission (verdict: Accepted):
n=int(input())
num=list(map(int,input().split()))
num.sort()
if num[int(n/2)-1]==num[int(n/2)]:
    a=0
elif not num[int(n/2)]==num[int(n/2) -1]:
    a= num[int(n/2)] - num[int(n/2)-1]
print(a)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
if b[(int(n/2)-1)]==b[int((n/2))]:
  print(0)
else:
  c=b[int((n/2)-1)]
  d=b[int((n/2))]
  e=len(list(range(c,d)))
  print(e+1)



Failing test case input:
14
99592 10342 29105 78532 83018 11639 57149 127350 30914 39830 51211 93284 100000 0

Expected output:
5938


Actual output:
5939


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
if b[(int(n/2)-1)]==b[int((n/2))]:
  print(0)
else:
  c=b[int((n/2)-1)]
  d=b[int((n/2))]
  e=len(list(range(c,d)))
  print(e)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
dlis=sorted(list(map(int,input().split())))
print(dlis)
print(dlis[int((n/2))]-dlis[int(n/2)-1])

Failing test case input:
6
5 1 0 4 2 7

Expected output:
2


Actual output:
[0, 1, 2, 4, 5, 7]
2


Fixed submission (verdict: Accepted):
n=int(input())
dlis=sorted(list(map(int,input().split())))
print(dlis[int((n/2))]-dlis[int(n/2)-1])
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import statistics
n = int(input())
d = input().split(' ')
d = [int(i) for i in d]
m = int(statistics.median(d))
if m in d:
  print(0)
else:
  nn = int(n/2) 
  d.sort()
  print(d[nn] - d[nn-1])




Failing test case input:
6
5 0 0 4 6 7

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
import statistics
n = int(input())
d = input().split(' ')
d = [int(i) for i in d]
m = int(statistics.median(d))
nn = int(n/2) 
d.sort()
print(d[nn] - d[nn-1])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

from statistics import mean
N = int(input())
d = list(map(int,input().split()))

d.sort()
avg = mean(d) 

d1 = [i for i in d if i <= avg]
d2 = [i for i in d if i > avg]

if len(d1) == len(d2):
    a = d2[0] - d1[-1]
    print(a)
print(0)

Failing test case input:
14
8817 245 150 1575 90 5308 971 6261 203 93 13 194 001110 0

Expected output:
42


Actual output:
0


Fixed submission (verdict: Accepted):
from statistics import mean
import sys
N = int(input())
d = list(map(int,input().split()))

d.sort()

d1 = [d[i] for i in range(N
d2 = [d[i] for i in range(N

a = d2[0] - d1[-1]

if len(d1) == len(d2):
    print(a)
    sys.exit()
print(0)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
d = [int(i) for i in input().split()]
n = int(n / 2)
d = sorted(d)
print(n, d)
print(d[n]-d[n-1])

Failing test case input:
6
5 1 0 4 4 7

Expected output:
0


Actual output:
3 [0, 1, 4, 4, 5, 7]
0


Fixed submission (verdict: Accepted):
n = int(input())
d = [int(i) for i in input().split()]
n = int(n / 2)
d = sorted(d)
print(d[n]-d[n-1])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
list=list(map(int,input().split()))
list2=sorted(list)

print(list[int(n/2)]-list[int(n/2)-1])

Failing test case input:
14
3728 14 455 0 0 232 832 12092 70 1 -3 805 001110 4

Expected output:
162


Actual output:
11260


Fixed submission (verdict: Accepted):
n=int(input())
list=list(map(int,input().split()))
list2=list.sort()

print(list[int(n/2)]-list[int(n/2)-1])

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()



print(int(d[int(N/2)])-int(d[int(N/2)-1]))

print(ans)

Failing test case input:
8
0 1 24 5 0 4 4 0

Expected output:
3


Actual output:
3
0


Fixed submission (verdict: Accepted):
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()



print(int(d[int(N/2)])-int(d[int(N/2)-1]))
Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def inp():
    return(int(input()))



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



def instr():
    s = input()
    return(list(s[:len(s)]))



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


n = inp()

arr = inlist()
arr = sorted(arr)
n = int(n/2)
kl = int(arr[n-1])
kh = int(arr[n])
print(arr)
print(kl, kh)
print(max(0, kh-kl))

Failing test case input:
14
86113 3566 306 11668 74746 8478 23677 84052 60113 19737 11912 11858 001011 -2

Expected output:
54


Actual output:
[-2, 306, 1011, 3566, 8478, 11668, 11858, 11912, 19737, 23677, 60113, 74746, 84052, 86113]
11858 11912
54


Fixed submission (verdict: Accepted):

def inp():
    return(int(input()))



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



def instr():
    s = input()
    return(list(s[:len(s)]))



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


n = inp()

arr = inlist()
arr = sorted(arr)
n = int(n/2)
kl = int(arr[n-1])
kh = int(arr[n])
print(max(0, kh-kl))

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
D = list(map(int, input().split()))

D.sort()
if D[int(N/2)] == D[int(N/2-1)]:
    ans = 0
else:
    ans = D[int(N/2)] - D[int(N/2-2)]

print(ans)

Failing test case input:
6
5 0 4 7 6 7

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
D = list(map(int, input().split()))

D.sort()
if D[int(N/2)] == D[int(N/2-1)]:
    ans = 0
else:
    ans = D[int(N/2)] - D[int(N/2-1)]

print(ans)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from statistics import mean
N = int(input())
d = list(map(int,input().split()))

d.sort()
avg = mean(d) 

d1 = [i for i in d if i <= avg]
d2 = [i for i in d if i > avg]

if len(d1) == len(d2):
    a = d2[0] - d1[-1]
    print(a)


Failing test case input:
6
3 1 0 2 2 7

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
from statistics import mean
import sys
N = int(input())
d = list(map(int,input().split()))

d.sort()

d1 = [d[i] for i in range(N
d2 = [d[i] for i in range(N

a = d2[0] - d1[-1]

if len(d1) == len(d2):
    print(a)
    sys.exit()
print(0)

Problem: p02989
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
d=list(map(int,input().split()))
d.sort()
gn=0
a=d[int(n/2)]-d[int((n/2)-1)]-1

if d[int(n/2)]!=d[int((n/2)-1)]:
  for i in d:
    if i==d[int(n/2)]:
      gn+=1
  if gn==1:
    a+=1
  print(a)
  print(d)
     
else:
  print(0)

Failing test case input:
14
99592 10342 29105 78532 83018 11639 92015 127350 30914 21912 51211 93284 100000 0

Expected output:
27321


Actual output:
27321
[0, 10342, 11639, 21912, 29105, 30914, 51211, 78532, 83018, 92015, 93284, 99592, 100000, 127350]


Fixed submission (verdict: Accepted):
n=int(input())
d=list(map(int,input().split()))
d.sort()
gn=0
a=d[int(n/2)]-d[int((n/2)-1)]-1

if d[int(n/2)]!=d[int((n/2)-1)]:
  for i in d:
    if i==d[int(n/2)]:
      gn+=1
  if gn>=1:
    a+=1
  print(a)
     
else:
  print(0)
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, K = map(int, input().split())
a = tuple(map(int, input().split()))

def main():
    l = [False] * (K+1)
    for i in range(K+1):
        if i < a[0]:
            l[i] = False
        else:
            l[i] = any(not l[i-j] if i >= j else True for j in a)
    if l[-1]:
        print('First')
    else:
        print('Second')


main()


Failing test case input:
0 2
1 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
a = tuple(map(int, input().split()))

def main():
    l = [False] * (K+1)
    for i in range(a[0] -1, K+1):
        l[i] = any(not l[i-j] if i >= j else False for j in a)
    if l[-1]:
        print('First')
    else:
        print('Second')


main()

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0,0]  for j in range(K+1)]
dp[0][1]=1
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i][0]=max(dp[i-a[j]][1],dp[i][0])
            dp[i][1]=max(dp[i-a[j]][0],dp[i][1])
print(dp[K][0])

Failing test case input:
2 3
2 10

Expected output:
First


Actual output:
0


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[0 for j in range(K+1)]
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i]=max((dp[i-a[j]]+1)%2,dp[i])
if dp[K]:
    print("First")
else:
    print("Second")

Problem: p03170
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K  = map(int,input().split())
A = list(map(int,input().split()))

dp = [None for _ in range(K+1)]
dp[0] = 0
for k in range(1,K+1):
	for a in A:
		if k-a>=0:
			if dp[k-a]==0:
				dp[k]=1


if dp[K]==1:
	print('First')
else:
	print('Second')

Failing test case input:
3 21
1 1 4

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
N, K  = list(map(int,input().split()))
A = list(map(int,input().split()))

dp = [0 for _ in range(K+1)]
dp[0] = 0
for k in range(1,K+1):
	for a in A:
		if k-a>=0:
			if dp[k-a]==0:
				dp[k]=1


if dp[K]==1:
	print('First')
else:
	print('Second')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(k+1)
for j in range(1,k+1):
  for i in a:
    if 0<=j-i and dp[j-1]==False:
      dp[j]=True
if dp[k]:
  print('First')
else:
  print('Second')

Failing test case input:
2 3
2 10

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
def main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    dp=[False]*(k+1)
    for j in range(1,k+1):
      for i in a:
        if 0<=j-i and dp[j-i]==False:
          dp[j]=True
    if dp[k]:
      print('First')
    else:
      print('Second')
main()
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K=map(int,input().split())

A=list(map(int,input().split()))

ma=[]
dp=[False]*(K+1)

for i in range(1,K+1):
    if i in A:
        dp[i]=True
    for j in A:
        if i < j:
            continue
        elif not dp[i-j]:
            dp[i] = True


if dp[K]:
    print("first")
else:
    print("second")




Failing test case input:
3 12
1 1 2

Expected output:
Second


Actual output:
second


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())

A=list(map(int,input().split()))

ma=[]
dp=[False]*(K+1)

for i in range(1,K+1):
    if i in A:
        dp[i]=True
    for j in A:
        if i < j:
            continue
        elif not dp[i-j]:
            dp[i] = True


if dp[K]:
    print("First")
else:
    print("Second")

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      dp[i]=True
      break
    else:
      if dp[i-li[j]]==False:
        dp[i]=True
        break
if dp[k]==True:
  print("First")
else:
  print("Second")
  
  


Failing test case input:
2 1
2 5

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      continue
    if dp[i-li[j]]==False:
      dp[i]=True
      break
if dp[k]==True:
  print("First")
else:
  print("Second")

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0,0]  for j in range(K+1)]
dp[0][1]=1
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i][0]=max(dp[i-a[j]][1],dp[i][0])
            dp[i][1]=max(dp[i-a[j]][0],dp[i][1])
if dp[K][0]:
    print("First")
else:
    print("Second")

Failing test case input:
3 20
2 3 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
a=list(map(int,input().split()))
dp=[0 for j in range(K+1)]
for i in range(1,K+1):
    for j in range(N):
        if i-a[j]>=0:
            dp[i]=max((dp[i-a[j]]+1)%2,dp[i])
if dp[K]:
    print("First")
else:
    print("Second")

Problem: p03170
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

dp = [None] * (K + 1)  
dp[0] = False
for k in range(1, K + 1):
    for a in A:
        if a <= k:
            dp[k] = not dp[k - a]
            break
    if dp[k] is None:
        dp[k] = False

print('First' if dp[-1] else 'Second')

Failing test case input:
2 9
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

dp = [False] * (K + 1)  

for k in range(1, K + 1):
    for a in A:
        if a <= k and not dp[k - a]:
            dp[k] = True
            break

print('First' if dp[-1] else 'Second')
Problem: p03170
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
def main():
    N,K=tuple(map(int,sys.stdin.readline().split()))
    a=tuple(map(int,sys.stdin.readline().split()))
    dp=[False for _ in range(K+1)]
    for i in range(K+1):
        for x in a:
            if i-x>=0:dp[i]=not dp[i-x]
    print('First') if dp[K] is True else print('Second')
if __name__=='__main__':main()

Failing test case input:
2 13
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
import sys
def main():
    N,K=tuple(map(int,sys.stdin.readline().split()))
    a=tuple(map(int,sys.stdin.readline().split()))
    dp=[False for _ in range(K+1)]
    for i in range(K+1):
        for x in a:
            if i-x>=0:dp[i]=dp[i] or (not dp[i-x])
    print('First') if dp[K] is True else print('Second')
if __name__=='__main__':main()

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (K + 1)

for i in range(K):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i + 1] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')




Failing test case input:
2 14
1 5

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [False] * (K + 1)

for i in range(K + 1):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      dp[i]=False
    else:
      if dp[i-li[j]]==False:
        dp[i]=True
if dp[k]==True:
  print("First")
else:
  print("Second")
  
  


Failing test case input:
3 25
1 1 2

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      continue
    if dp[i-li[j]]==False:
      dp[i]=True
      break
if dp[k]==True:
  print("First")
else:
  print("Second")
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


n, k, *a = map(int, read().split())
dp = [False] * (k + 1)
for i in range(k + 1):
    for j in range(n):
        if i - a[j] >= 0:
            dp[i] |= dp[i - a[j]]
if dp[k]:
    print('First')
else:
    print('Second')


Failing test case input:
2 9
1 1

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


n, k, *a = map(int, read().split())
dp = [False] * (k + 1)
for i in range(k + 1):
    for j in range(n):
        if i - a[j] >= 0:
            dp[i] |= not dp[i - a[j]]
if dp[k]:
    print('First')
else:
    print('Second')

Problem: p03170
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.buffer.readline

def main():
    N,M = map(int,input().split())
    a = list(map(int,input().split()))
    
    dp = [1 for _ in range(M+max(a)+1)]
    for i in range(min(a)):
        dp[i] = -1

    for i in range(M):
        for num in a:
            dp[i+num] = -1*dp[i]

    if 1 in dp[M-min(a)+1:M+1]:
        print("First")
    else:
        print("Second")
   
if __name__ == "__main__":
    main()


Failing test case input:
2 13
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.buffer.readline

def main():
    N,M = map(int,input().split())
    a = list(map(int,input().split()))
    
    dp = [False for _ in range(M+1)]

    for i in range(M+1):
        for num in a:
            if i-num<0:
                continue
            if dp[i-num] == False:
                dp[i] = True

    if dp[M]:
        print("First")
    else:
        print("Second")
   
if __name__ == "__main__":
    main()

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, K = map(int, input().split())
a = [int(c) for c in input().split()]


dp = [False] * (K+1)
for ai in a:
    for k in range(K+1):
        if k >= ai:
            dp[k] = dp[k] or (not dp[k-ai])

print('First' if dp[k] else 'Second')

Failing test case input:
2 9
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
a = [int(c) for c in input().split()]


dp = [False] * (K+1)
for k in range(K+1):
    for ai in a:
        if k >= ai:
            dp[k] = dp[k] or (not dp[k-ai])

print('First' if dp[k] else 'Second')
Problem: p03170
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
dp = [False]*(k+1)

for i in range(k):
  for j in range(n):
    if i-a_list[j] >= 0:
      dp[i] |= not(dp[i-a_list[j]])
      
if dp[k-1]:
  print('First')
else:
  print('Second')

Failing test case input:
2 5
2 3

Expected output:
Second

Actual output:
First


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

def main():
  n, k = map(int, input().split())
  a_list = list(map(int, input().split()))
  dp = [False]*(k+1)

  for i in range(1,k+1):
    for j in range(n):
      if i-a_list[j] >= 0:
        dp[i] |= not(dp[i-a_list[j]])


  if dp[k]:
    print('First')
  else:
    print('Second')
main()

Problem: p03170
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*(k+1)
for i in range(k+1):
    for j in range(n):
        if i>=j and dp[i-j]==0:
            dp[i]=1
if dp[k]==0:
    print('Second')
else:
    print('First')

Failing test case input:
1 3
4 5

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*(k+1)
for i in range(k+1):
    for j in range(n):
        if i>=l[j] and dp[i-l[j]]==0:
            dp[i]=1
if dp[k]==0:
    print('Second')
else:
    print('First')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [float("inf") for i in range(k+1)]

for i in range(al[0]):
    dp[i] = 0 

for i in range(k):
    for a in al:
        if i+a <= k:
            dp[i+a] = dp[i] + 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")



Failing test case input:
3 21
1 1 2

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [0 for i in range(k+1)]

for i in range(k+1):
    for a in al:
        if a <= i:
            if dp[i-a] == 0:
                dp[i] = 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [None]*(k+1)
ind = 0
while ind<a[0]:
    dp[ind] = False
    ind += 1
for i in range(ind, k+1):
    for j in a:
        if i-j<0:
            dp[i] = True
            break
        if not dp[i-j]:
            dp[i] = True
            break
    else:
        dp[i] = False
print('First' if dp[k] else 'Second')


Failing test case input:
0 2
1 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [None]*(k+1)
ind = 0
while ind<a[0]:
    dp[ind] = False
    ind += 1
for i in range(ind, k+1):
    for j in a:
        if i-j<0:
            dp[i] = False
            break
        if not dp[i-j]:
            dp[i] = True
            break
    else:
        dp[i] = False
print('First' if dp[k] else 'Second')
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


def submit():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()

    dp = [False for _ in range(k + 1)]
    for e in a:
        for i in range(k + 1):
            if i >= e:
                dp[i] = dp[i] or not dp[i - e]
    
    if dp[k]:
        print("First")
    else:
        print("Second")

submit()

Failing test case input:
3 21
1 1 2

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):


def submit():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()

    dp = [False for _ in range(k + 1)]
    for i in range(k + 1):
        for e in a:
            if i >= e:
                dp[i] = dp[i] or not dp[i - e]
    
    if dp[k]:
        print("First")
    else:
        print("Second")

submit()

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1)
dp[0]=0

for i in range(1,k+1):
    for j in range(n):
        if i-a[j]>=0:
            dp[i]=1
            dp[i]= dp[i] and dp[i-a[j]]
    dp[i]=(dp[i]+1)%2
print("First" if dp[k] else "Second")

Failing test case input:
2 4
3 5

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1)
dp[0]=0

for i in range(1,k+1):
    z=0
    for j in range(n):
        if i-a[j]>=0:
            if z==0:
                dp[i]=1
            dp[i]= dp[i] and dp[i-a[j]]
            z=1
    if z:
        dp[i]=(dp[i]+1)%2

print("First" if dp[k] else "Second")

Problem: p03170
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K  = list(map(int,input().split()))
A = list(map(int,input().split()))

dp = [None for _ in range(K+1)]
dp[0] = 0
for k in range(1,K+1):
	for a in A:
		if k-a>=0:
			if dp[k-a]==0:
				dp[k]=1


if dp[K]==1:
	print('First')
else:
	print('Second')

Failing test case input:
2 7
3 6

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
N, K  = list(map(int,input().split()))
A = list(map(int,input().split()))

dp = [0 for _ in range(K+1)]
dp[0] = 0
for k in range(1,K+1):
	for a in A:
		if k-a>=0:
			if dp[k-a]==0:
				dp[k]=1


if dp[K]==1:
	print('First')
else:
	print('Second')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      dp[i]=True
    else:
      if dp[i-li[j]]==False:
        dp[i]=True
if dp[k]==True:
  print("First")
else:
  print("Second")
  
  


Failing test case input:
0 4
1 5

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
li=[int(k) for k in input().split()]
dp=[False]*(k+1)
for i in range(1,k+1):
  for j in range(len(li)):
    if i-li[j]<0:
      continue
    if dp[i-li[j]]==False:
      dp[i]=True
      break
if dp[k]==True:
  print("First")
else:
  print("Second")
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, K = map(int, input().split())
a = list(map(int, input().split()))
dp = [[-1,0] for i in range(K+1)]
for i in range(K+1):
    for j in range(N):
        if i+a[j]<=K:
            if dp[i+a[j]][1] == 0:
                dp[i+a[j]][0] = dp[i][0]*(-1)
                dp[i+a[j]][1] = 1
            else:
                dp[i+a[j]][0] = 1
if dp[K][0] == 1:
    print('First')
else:
    print('Second')

Failing test case input:
3 21
1 1 2

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
a = list(map(int, input().split()))
dp = [[-1,0] for i in range(K+1)]
for i in range(K+1):
    for j in range(N):
        if i+a[j]<=K:
            if dp[i+a[j]][1] == 0:
                dp[i+a[j]][0] = dp[i][0]*(-1)
                dp[i+a[j]][1] = 1
            else:
                if dp[i][0] == -1:
                    dp[i+a[j]][0] = 1 
if dp[K][0] == 1:
    print('First')
else:
    print('Second')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
l = list(map(int, input().split()))

dp = [-1]*(k+1)
dp[0] = 0

for i in range(1, k+1):
  for j in range(n):
    if i - l[j] >= 0:
      dp[i] = 1 - dp[i-l[j]]
      
if dp[k] == 0:
  print('Second')
else:
  print('First')

Failing test case input:
3 20
2 3 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
l = list(map(int, input().split()))

dp = [-1]*(k+1)
dp[0] = 0

for i in range(1, k+1):
  temp = 1
  for j in range(n):
    if i - l[j] >= 0:
      temp *= dp[i-l[j]]
  dp[i] = 1-temp
      
if dp[k] == 0:
  print('Second')
else:
  print('First')

Problem: p03170
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[0]*(K+1)

for a in A:
    for i in range(K+1):
        if i+a<=K:
            if dp[i]==0:
                dp[i+a]=1

print("First" if dp[-1]==1 else "Second")


Failing test case input:
2 6
2 1 4

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):


N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[0]*(K+1)

for i in range(K+1):    
    for a in A:
        if i+a<=K:
            if dp[i]==0:
                dp[i+a]=1

print("First" if dp[-1]==1 else "Second")
Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
a = tuple(map(int,input().split()))

dp = [True] + [False]*k
for i in range(1,k+1):
    judge = False
    for j in range(n):
        if i-a[j] >= 0 and dp[i-a[j]]:
            judge = True
    dp[i] = judge
if dp[k]:
    print('First')
else:
    print('Second')

Failing test case input:
3 20
1 3 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
a = tuple(map(int,input().split()))

dp = [False] + [True]*k
for i in range(1,k+1):
    judge = False
    for j in range(n):
        if i-a[j] >= 0 and not dp[i-a[j]]:
            judge = True
    dp[i] = judge

if dp[k]:
    print('First')
else:
    print('Second')

Problem: p03170
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [0] * (k+1)

for i in range(1, k+1):
    for j in range(n):
        if i - a[j] >= 0 and dp[i-a[j]] == 0:
            dp[i] = 1

print(dp[k])

Failing test case input:
2 28
1 1

Expected output:
Second


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
A = list(map(int, input().split()))

dp = [0] * (k+1)

for i in range(1, k+1):
    for a in A:
        if i - a < 0:
            break
        if dp[i-a] == 0:
            dp[i] = 1

if dp[k] == 1:
    print("First")
else:
    print("Second")

Problem: p03170
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[0]*(K+1)

for a in A:
    for i in range(K):
        if i+a<=K:
            if dp[i]==0:
                dp[i+a]=1

print("First" if dp[-1]==1 else "Second")


Failing test case input:
2 9
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):


N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[0]*(K+1)

for i in range(K+1):    
    for a in A:
        if i+a<=K:
            if dp[i]==0:
                dp[i+a]=1

print("First" if dp[-1]==1 else "Second")

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [1] * (k + 1)
player = ["Second", "First"]

for i in range(1, k + 1):
    for j in range(n):
        if 0 <= i - a[j] and dp[i - a[j]] == 1:
            dp[i] = 0

print(player[dp[k]])
        

Failing test case input:
1 8
2 2

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [1] * (k + 1)
player = ["First", "Second"]

for i in range(1, k + 1):
    for j in range(n):
        if 0 <= i - a[j] and dp[i - a[j]] == 1:
            dp[i] = 0

print(player[dp[k]])
Problem: p03170
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [False]*(k+1)
for i in range(1, k):
    flag = False
    for ai in a:
        if i-ai >= 0 and  not dp[i-ai]:
            flag = True
            break
    dp[i] = flag

if dp[-1]:
    print("First")
else:
    print("Second")

Failing test case input:
2 13
2 3

Expected output:
First


Actual output:
Second


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
a = list(map(int, input().split()))

dp = [False]*(k+1)
for i in range(1, k+1):
    flag = False
    for ai in a:
        if i-ai >= 0 and  not dp[i-ai]:
            flag = True
            break
    dp[i] = flag

if dp[-1]:
    print("First")
else:
    print("Second")

Problem: p03170
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

dp = [0] * (K+1)
for a in A:
    for i in range(K+1):
        if dp[i] == 0:
            if i+a <= K:
                dp[i+a] = 1

if dp[K] == 1:
    print('First')
else:
    print('Second')

Failing test case input:
2 21
2 1 4

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
N,K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

dp = [0] * (K+1)
for i in range(K+1):
    for a in A:
        if dp[i] == 0:
            if i+a <= K:
                dp[i+a] = 1

if dp[K] == 1:
    print('First')
else:
    print('Second')

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [float("inf") for i in range(k+1)]

for i in range(al[0]):
    dp[i] = 0 

for i in range(k+1):
    for a in al:
        if a <= i:
            dp[i] = dp[i-a] + 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")



Failing test case input:
2 15
2 3

Expected output:
Second


Actual output:
First


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
al = list(map(int,input().split()))

dp = [0 for i in range(k+1)]

for i in range(k+1):
    for a in al:
        if a <= i:
            if dp[i-a] == 0:
                dp[i] = 1


if dp[-1] % 2 == 0:
    print("Second")
else:
    print("First")

Problem: p03170
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
aa = list(map(int,input().split()))

dp = [-1]*(k+1)

for i in range(1,k+1):
  for j in range(n):
    if i >= aa[j]:
      dp[i] = max(dp[i],-dp[i-aa[j]])

if dp[k]>0:
  print('first')  
else:
  print('second')      

Failing test case input:
1 100000
4

Expected output:
Second


Actual output:
second


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
aa = list(map(int,input().split()))

dp = [-1]*(k+1)

for i in range(1,k+1):
  for j in range(n):
    if i >= aa[j]:
      dp[i] = max(dp[i],-dp[i-aa[j]])

if dp[k]>0:
  print('First')  
else:
  print('Second')