TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
A=sorted(list(map(int,input().split())))
if n%2==1:
  print(0)
else:
  print(A[n//2]-A[n//2-1]+1)

n=int(input())
A=sorted(list(map(int,input().split())))
if n%2==1:
  print(0)
else:
  print(A[n//2]-A[n//2-1] )


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N/2-1]
b = d[N/2]
if a != b:
  print(b-a)
if a == b:
  print(0)

N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N/2-1]
b = d[N/2]
print(b-a)

N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N//2-1]
b = d[N//2]
if a != b:
  print(b-a)
if a == b:
  print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
d = list(map(int,input().split()))

arc_list = list()
abc_list = list()

harf_num = int(n/2)

d.sort()
abc_list = d[:harf_num]
arc_list = d[harf_num:]

abc_max = max(abc_list)
arc_min = min(arc_list)

print(abc_max - arc_min)

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

arc_list = list()
abc_list = list()

harf_num = int(n/2)

d.sort()
abc_list = d[:harf_num]
arc_list = d[harf_num:]

abc_max = max(abc_list)
arc_min = min(arc_list)

print(arc_min - abc_max)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
X = int(N/2)
D = list(map(int,input().split(' ')))
D.sort()
print(D[X] -(D[X-1]+1))

N = int(input())
X = int(N/2)
D = list(map(int,input().split(' ')))
D.sort()
print(D[X] -D[X-1])


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
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])


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


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = list(map(int, input().split())) 
print(len(d))

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

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

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

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

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)]-d[int(len(d)/2)-1])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N/2] - d_sort[N/2 - 1])


N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N/2] - d_sort[N/2-1])


N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N//2] - d_sort[N//2 - 1])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
d.sorted()
print(d[n/2]-d[n/2-1])

n=int(input())
d=list(map(int,input().split()))
d.sort()
print(d[n//2]-d[n//2-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
l.sort()
a=n/2
s=l.index(a-1)
t=l.index(a)
if s==t:
  print("0")
else:
  ans=t-s
  print(ans)

n=int(input())
l=list(map(int,input().split()))
l.sort()
a=int(n/2)
s=l[a-1]
t=l[a]
if s==t:
  print("0")
else:
  ans=t-s
  print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())

array = list(map(int, input().split())).sort()

print(array[N//2]-array[N//2-1])

N = int(input())

array = sorted(list(map(int, input().split())))

print(array[N//2]-array[N//2-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N=int(input())
d=[int(input().sprit())]
d.sort()
print(d[N]-d[N-1])

N=int(input())
x=int(N/2)
d=[int(x) for x in (input().split())]
d.sort()
print(d[x]-d[x-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
a = sorted(list(map(int, input().split())))
print(a[len(a)//2] - a[len(a)//2-1])


a = sorted(list(map(int, input().split())))
print(a[len(a)] - a[len(a)-1])


a = sorted(list(map(int, input().split())))
print(a[len(a)//2] - a[len(a)//2-1] + 1)


input()
a = sorted(list(map(int, input().split())))
print(a[len(a)//2] - a[len(a)//2 - 1])

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[N/2-1]-l[N/2])

N = int(input())
l = list(map(int, input().split()))
l.sort()
print(l[len(l)//2] - l[len(l)//2-1])


Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
d.sort()
ans=d[m]-d[m-1]
print(ans+1)


n=int(input())
d=list(map(int,input().split()))
d.sort()
m=int(n/2)
ans=d[m]-d[m-1]
print(ans)



Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=list(map(int, input().split()))

d.sort()

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

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

d.sort()

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
import numpy as np

N, *arr = map(int, input().split())
arr = np.array(arr)
arr.sort()
m1 = arr[int(N / 2 - 1)]
m2 = arr[int(N / 2)]
print(m2 - m1)

import numpy as np

N = int(input())
arr = [int(i) for i in input().split()]
arr = np.sort(arr)
m1 = arr[int(N / 2)-1]
m2 = arr[int(N / 2)]
print(m2 - m1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = input()

if N/2 %2 != 0:
    print '0'

else:
    ls = list(map(int, input().split()))

    ls_sorted = sorted(ls)

    K = ls_sorted[N/2] - ls_sorted[N/2 - 1]

    print(K)

N = input()

if N/2 %2 != 0:
    print(0)

else:
    ls = list(map(int, input().split()))

    ls_sorted = sorted(ls)

    K = ls_sorted[N/2] - ls_sorted[N/2 - 1]

    print(K)

N = input()


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

ls_sorted = sorted(ls)

K = ls_sorted[N//2] - ls_sorted[N//2 - 1]

print(K)

N = int(input())


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

ls.sort()

K = ls[N//2] - ls[N//2 - 1]

print(int(K))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=sorted(list(map(int,input().split())))
print(d)
res=0
if n % 2 == 0:
    m=int(n/2)
    #print(d[m],d[m+1])
    if d[m-1] == d[m]:
        pass
    else:
        res = d[m] - d[m-1] 

else:
    pass
    
    
print(res)

n=int(input())
d=sorted(list(map(int,input().split())))
#print(d)
res=0
if n % 2 == 0:
    m=int(n/2)
    #print(d[m],d[m+1])
    if d[m-1] == d[m]:
        pass
    else:
        res = d[m] - d[m-1] 

else:
    pass
    
    
print(res)
        

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
import math
from operator import mul
from functools import reduce

def comb(n, r):
  r = min(r, n-r)
  if r==0: return 1
  over = reduce(mul, range(n, n-r, -1))
  under = reduce(mul, range(1, r+1))
  return over//under

n, k = map(int, input().split())
mod = 10**9+7

for i in range(1, k+1):
  if i <= n-k+1:
    ans = comb(n-k+1, i) * comb(k-1, i-1)
    ans %= mod
  else:
    ans = 0
  print(ans)

n = int(input())
*d, = map(int, input().split())

d.sort()

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
D = list(map(int,input().split()))

D.sort()
print(D[n//2] -D[n//2-1]+1)

n = int(input())
D = list(map(int,input().split()))

D.sort()
print(D[n//2] -D[n//2-1])



Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = input()
d = [int(i) for i in input().split()]
if len(d) % 2 == 1:
  ans = 0
else:
  d.sort()
  if d[len(d)-1] == d[len(d)]:
    ans = 0
  else:
    ans = d[len(d)] - d[len(d)]
    
print(ans)



n = input()
d = [int(i) for i in input().split()]
if len(d) % 2 == 1:
  ans = 0
else:
  d.sort()
  if d[len(d)//2-1] == d[len(d)//2]:
    ans = 0
  else:
    ans = d[len(d)//2] - d[len(d)//2-1]
    
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = [int(i) for i in input().split()]
#  N = 6

#  N = 8

#  N = 14

#      [
#          99592,
#          10342,
#          29105,
#          78532,
#          83018,
#          11639,
#          92015,
#          77204,
#          30914,
#          21912,
#          34519,
#          80835,
#          100000,
#          1,
#      ]
#  )
l = len(d) // 2
boundary = d[l - 1]
next_d = boundary
boundary_cnt = 0
for i in d[l:]:
    if i == boundary:
        boundary_cnt += 1
        if boundary > 2:
            next_d = boundary
            break
    elif i > boundary:
        next_d = i
        break
print(next_d - boundary)


N = int(input())
d = list(sorted([int(i) for i in input().split()]))
l = len(d) // 2
boundary = d[l - 1]
next_d = boundary
boundary_cnt = 0
for i in d[l:]:
    if i == boundary:
        boundary_cnt += 1
        if boundary > 2:
            next_d = boundary
            break
    elif i > boundary:
        next_d = i
        break
print(next_d - boundary)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N=int(int(input())/2)
N-=(N+1)%2
a=sorted(input().split())
print(int(a[N+1])-int(a[N]))

N = int(input()) / 2
a = input().split()

if a[N] == a[N + 1]:
    print(0)
else:
    print(int(a[N+1]) - int(a[N]))

N = int(input()) / 2
a = input().split()

if a[N] == a[N + 1]:
    print(0)
else:
    print(a[N+1] - a[N])

N=int(int(input())/2)
a=sorted(input().split())
print(int(a[N+1])-int(a[N]))

N=int(int(input())/2)
a=sorted(list(map(int,input().split())))
print(int(a[N])-int(a[N-1]))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
    N = int(input())
    d = list(map(int,input().split()))

    d.sort()
    i = len(d)//2
    print(d[i]-d[i-1])

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

d.sort()
i = len(d)//2
print(d[i]-d[i-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
d = list(map(int, input().split()))

d = sorted(d)

if d[n//2] == d[n//2]:
    print(0)
else:
    print(d[n//2] - d[n//2-1])

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

d = sorted(d)

if d[n//2-1] == d[n//2]:
    print(0)
else:
    print(d[n//2] - d[n//2-1])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
l = list(map(int, input().split()))

c_idx = n / 2 - 1
l.sort()
print(l[c_idx + 1] - l[c_idx])

n = int(input())
l = list(map(int, input().split()))
 
c_idx = n // 2 - 1
l.sort()
print(l[c_idx + 1] - l[c_idx])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
m=int(n/2)
d=sorted(d)
print(d[m+1]-d[m])


n=int(input())
d=map(int,input().split())
m=n/2
d=sorted(d)
print(d[m+1]-d[m])

n=int(input())
d=list(map(int,input().split()))
m=n/2
d.sort()
print(d[m+1]-d[m])


n=int(input())
d=list(map(int,input().split()))
m=n/2
d=sorted(d)
print(d[m+1]-d[m])


n=int(input())
d=list(map(int,input().split()))
m=n/2
li=sorted(d)
print((li[m+1]-li[m]))


n=int(input())
d=list(map(int,input().split()))
m=int(n/2)
d=sorted(d)
print(d[m]-d[m-1])


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
dlist = list(map(int, input().split()))

dlist.sort()
print(dlist[N/2]-dlist[N/2-1])

N = int(input())
dlist = list(map(int, input().split()))

dlist.sort()
N = int(N/2)
print(dlist[N]-dlist[N-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
l=sort(list(map(int,input().split())))
print(l[n//2]-l[n//2-1])

n=int(input())
l=sorted(list(map(int,input().split())))
print(l[n//2]-l[n//2-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = input().split()
d = list(map(int,d))

L=0
R=0
DDT = 0
ans = 0
for K in range(min(d),max(d)+1):
    for i in range(N):
        if d[i] == K:
            DDT += 1
        elif d[i] < K:
            L += 1
        else:
            R += 1
    print(L,R)
    if L == R:
        ans += 1
    else:
        while DDT > 0:
            if L < R:
                L += 1
                DDT -= 1
            elif L > R:
                R += 1
                DDT -= 1
            else:
                L += 1
                DDT -= 1
        if L == R:
            ans += 1
    L = 0
    R = 0
    DDT = 0
print(ans-1)

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

d.sort()

ans = d[N//2] - d[(N//2)-1]
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1

n = int(input())
arr = list(map(int, input().split()))
arr.sort()
ans = arr[n//2] - arr[n//2-1]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
if __name__ == '__main__':
	N = int(input())
	D = list(map(int, input().split()))
	(D.sort())

	if D[(N//2)-1] == D[N//2]:
		print('0')
	else:
		print(D[(N//2)] - D[(N//2) - 1])
	print(D)


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

	if D[(N//2)-1] == D[N//2]:
		print('0')
	else:
		print(D[(N//2)] - D[(N//2) - 1])


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
D = list(map(int, input().split()))

D = sorted(D)
max_ = max(D)
min_ = min(D)

middle_idx = len(D)//2

diff = D[middle_idx+1] - D[middle_idx]
print(diff)

  
  
  
  

N = int(input())
D = list(map(int, input().split()))
 
D = sorted(D)
max_ = max(D)
min_ = min(D)
 
middle_idx = len(D)//2
print("mi", middle_idx)
diff = D[middle_idx+1] - D[middle_idx]
print(diff)

N = int(input())
D = list(map(int, input().split()))
 
D = sorted(D)
max_ = max(D)
min_ = min(D)

middle_idx = len(D)//2
 
diff = D[middle_idx] - D[middle_idx-1]
print(diff)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input().split()
d = list(map(int, input().split()))

d.sort()

if d[int((N-1)/2)] == d[int(N/2)]:
    result = 0
else:
    result = d[int(N/2)]-d[int((N-1)/2)]

print(result)


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

d.sort()
result = d[int(N/2)]-d[int((N-1)/2)]
print(result)


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

d.sort()

if d[int((N-1)/2)] == d[int(N/2)]:
    result = 0
else:
    result = d[int(N/2)]-d[int((N-1)/2)]

print(result)


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

d.sort()
result = d[int(N/2)]-d[int((N-1)/2)]
print(result)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
import fractions
a, b, c, d = map(int, input().split())
e = (c*d)/fractions.gcd(c,d)
bb = b-((b//c) + (b//d)- (b//e))
aa = a-1-(((a-1)//c)+((a-1)//d)-((a-1)//e))
z = bb-aa
print(int(z))

import fractions
a, b, c, d = map(int, input().split())
e = (c*d)/fractions.gcd(c,d)
bb = b-(b//c + b//d- b//e)
aa = a-1-((a-1)//c+(a-1)//d-(a-1)//e)
z = bb-aa
print(int(z))

n = int(input())
d = list(map(int, input().split()))
d.sort()
if d[int((n/2))] == d[int(n/2)-1]:
    print(0)
else:
    print(d[int(n/2)]-d[int((n/2)-1)])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
D = list(map(int, input().split()))

D.sort()

print(D)
print(D[N//2] - D[N//2 - 1])

N = int(input())
D = list(map(int, input().split()))

D.sort()

print(D[N//2] - D[N//2 - 1])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
def q38(n, d):
    max_d = max(d)
    min_d = min(d)
    count = 0
    for i in range(min_d+1, max_d):
        a = []
        b = []
        for j in d:
            if j >= i:
                a.append(j)
            else:
                b.append(j)
        if len(a) == len(b):
            count += 1
    return count
N = int(input())
d = [int(i) for i in input.split()]
print(q38(N, d))

    def q38(n, d):
        max_d = max(d)
        min_d = min(d)
        count = 0
        for i in range(min_d+1, max_d):
            a = []
            b = []
            for j in d:
                if j >= i:
                    a.append(j)
                else:
                    b.append(j)
            if len(a) == len(b):
                count += 1
        return count
     
  N = int(input())
  d = [int(i) for i in input().split()]
  print(q38(N, d))

def q38(n, d):
    max_d = max(d)
    min_d = min(d)
    count = 0
    for i in range(min_d+1, max_d):
        a = []
        b = []
        for j in d:
            if j >= i:
                a.append(j)
            else:
                b.append(j)
        if len(a) == len(b):
            count += 1
    return count

N = int(input())
d = [int(i) for i in input().split()]

def check(N, d):
    numList = d
    numList.sort()
    
    if N % 2 != 0:
        print(0)
    else:
        print(numList[int(len(numList)/2)] - numList[int(len(numList)/2-1)])

N = int(input())
d = [int(i) for i in input().split()]
check(N, d)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
D = list(map(int, input().split())).sort()
print(D[N // 2] - D[(N // 2) - 1])


N = int(input())
D = sorted(map(int, input().split()))
print(D[N // 2] - D[(N // 2) - 1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
from collections import deque
n, m = map(int, input().split())

g = [[] for i in range(n)]

for i in range(m):
  u, v = map(int, input().split())
  u, v = u-1, v-1
  g[u].append(v)
# print(g)

s, t = map(int, input().split())
s, t = s-1, t-1

visited = [[-1]*3 for j in range(n)]

l = 0
queue = deque([[s, l]])
visited[s][l] = 0
while queue:
  x, l = queue.popleft()
  if [x, l] == [t, 0]:
    print(visited[x][l]//3)
    exit()
  for x_ in g[x]:
    new_x, new_l = x_, (l+1)%3
    if visited[new_x][new_l] == -1:
      visited[new_x][new_l] = visited[x][l]+1
      queue.append([new_x, new_l])
    
print(visited[t][0])

n = int(input())
ds = list(map(int, input().split()))
ds.sort()
#print(ds)

abc = ds[:n//2]
arc = ds[n//2:]
#print(abc)
#print(arc)

print(min(arc)-max(abc))

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
p=list(map(int,input().split()))

P=sorted(p)
print(P)
K=P[n//2]-P[n//2-1]

print(K)


n=int(input())
p=list(map(int,input().split()))

P=sorted(p)

K=P[n//2]-P[n//2-1]

print(K)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = sorted(list(map(int, input().split())))
print(d[N / 2] - d[N / 2 - 1])

N = int(input())
d = sorted(list(map(int, input().split())))
print(d[int(N / 2)] - d[int(N / 2 - 1)])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
d = list(map(int,input().split()))
d.sort()
ans = d[n/2] - d[(n/2)-1]
print(ans)

n = int(input())
d = list(map(int,input().split()))
ans = 0
for k in range(max(d)):
    ARC = 0
    ABC = 0
    for i in range(n):
        if d[i] >= k:
            ARC += 1
        else:
            ABC += 1
    if ARC == ABC:
        ans +=1
        print(k,ans)
    else:
        print(k,ans,ARC,ABC)
        continue
print(ans)

n = int(input())
d = list(map(int,input().split()))
d.sort()
ans = d[int(n/2)] - d[int(n/2)-1]
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N = int(input())
d = list(map(int, input().split()))
d.sort()
print(d[N/2] - d[N/2-1])
    

import math
N = int(input())
d = list(map(int, input().split()))
d.sort()
tmp = math.floor(N/2)
print(d[tmp] - d[tmp-1])

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
N=int(input())
D=[int(i) for i in input().split()]
mid=N//2-1
print(D[mid+1]-D[mid])


N=int(input())
D=[int(i) for i in input().split()]
D.sort()
mid=N//2-1
print(D[mid+1]-D[mid])


Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
d = list(map(int,input().split()))

count = 0

if n % 2 == 0:
    d.sort()
    print(d)
    tmp = n  // 2

    if d[tmp-1] == d[tmp]:
        print(0)

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

else:
    print(0)

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

count = 0

if n % 2 == 0:
    d.sort()
    tmp = n  // 2

    if d[tmp-1] == d[tmp]:
        print(0)

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

else:
    print(0)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = input()
dl = list(map(int,input().split()))
dl.sort()

if n % 2 != 0:
  print(0)
  exit()

  
left = dl[(n//2)-1]
right = dl[(n//2)]

print(right-left)


n = int(input())
dl = list(map(int,input().split()))
dl.sort()

if n % 2 != 0:
  print(0)
  exit()

  
left = dl[(n//2)-1]
right = dl[(n//2)]

print(right-left)


Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
sorted_nums = sorted(list(map(int, input().split())))
center = len(sorted_nums // 2)
ans = sorted_nums[center] - sorted_nums[center-1]
print(ans)

n = int(input())
sorted_nums = sorted(list(map(int, input().split())))
center = len(sorted_nums) // 2
ans = sorted_nums[center] - sorted_nums[center-1]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
p = []
d = list(map(int, input().split()))
print(d)

cnt=0
cnth=0
cntl=0
for k in range(min(d)+1, max(d)-1):
    for x in d:
        if x >= k:
            cnth += 1
        elif x < k:
            cntl += 1
    if cnth == cntl:
        cnt+=1
    cnth =0
    cntl =0

print(cnt)

import numpy as np

n = int(input())
d = list(map(int, input().split()))
d = np.array(d)
d_sorted = np.sort(d)

half = int(n/2)
if d_sorted[half] == d_sorted[half-1]:
    cnt = 0
else:
    cnt = (d_sorted[half]) - (d_sorted[half-1])


print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n = int(input())
d_list = list(map(int,input().split()))
d = sorted(d_list)
g = n//2
f = d[g]
j = d[g+1]
print(j-f)

n = int(input())
d_list = list(map(int,input().split()))
d = sorted(d_list)
g = n//2
f = d[g-1]
j = d[g]
print(j-f)

Verdicts: Runtime Error

Accepted
Problem: Takahashi made N problems for competitive programming. The problems are numbered 1 to N, and the difficulty of Problem i is represented as an integer d_i (the higher, the harder).  He is dividing the problems into two categories by choosing an integer K, as follows:    * A problem with difficulty K or higher will be _for ARCs_.   * A problem with difficulty lower than K will be _for ABCs_.  How many choices of the integer K make the number of problems for ARCs and the number of problems for ABCs the same?

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
d.sort()
a=int(n/2)
i=int(n/2-1)
print(d)
if d[a]!=d[i]:
    num=d[a]-d[i]
    print(num)
else:
    print(0)

n=int(input())
d=list(map(int,input().split()))
d.sort()
a=int(n/2)
i=int(n/2-1)
if d[a]!=d[i]:
    num=d[a]-d[i]
    print(num)
else:
    print(0)

Verdicts: Wrong Answer

Accepted