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())
D = sorted(map(int, input().split()))
print(D)
if D[N//2 - 1] == D[N//2]:
  print(0)
else:
  print(D[N//2] - D[N//2 - 1])

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

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())
P = map(int,input().split())
p = [i for i in P]
p.sort()
print(p)
if n % 2 == 1:
    print(0)
elif len(p) == 2:
    if p[0]==p[1]:
        print(0)
    else:
        print(1)
else:
    a = p[n//2]
    if a == p[(n//2)-1] or a == p[(n//2)+1]:
        print(0)
    else:
        print(p[n//2]-p[(n//2)-1])

n = int(input())
P = map(int,input().split())
p = [i for i in P]
p.sort()
if n % 2 == 1:
    print(0)
elif len(p) == 2:
    if p[0]==p[1]:
        print(0)
    else:
        p.sort()
        print(p[1]-p[0])
else:
    if p[(n//2)] == p[(n//2)-1]:
        print(0)
    else:
        print(p[n//2]-p[(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):
a=int(input())
b=list(map(int,input().split()))
b.sort()
if b[(a/2)-1]==b[(a/2)]:
  print(0)
else:
  print(b[(a/2)]-b[(a/2)-1]-1)

a=int(input())
b=list(map(int,input().split()))
b.sort()
if b[int(a/2)-1]==b[int(a/2)]:
  print(0)
else:
  print(b[int(a/2)]-b[int(a/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())
a = list(map(int, input().split())) 
count = 0

a.sort()

c1 = a[len(a)//2]
c2 = a[len(a)//2-1]
if c1 != c2 and c1 != (c2 + 1):
    count = c1 - c2 -1
print(count)

n = int(input())
a = list(map(int, input().split())) 
count = 0

a.sort()

c1 = a[len(a)//2]
c2 = a[len(a)//2-1]
if c1 != c2:
    count = c1 - c2
print(count)

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())
p = list(map(int,input().split()))
p.sort() 
ans = p[n/2] - p[n/2-1]
print(ans)

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

ans = ps[n/2] - ps[n/2-1]
print(ans)

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

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(d)
ans=0
 
for i in range(10**7):
    if d[int(N/2-1)] < i and i <= d[int(N/2)]:
        ans +=1
 
print(ans)

N=int(input())
d=list(map(int, input().split()))
 
d=sorted(d)
ans=0
 
for i in range(1+10**5):
    if d[int(N/2-1)] < i and i <= d[int(N/2)]:
        ans +=1
 
print(ans)

Verdicts: Time Limit Exceeded

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

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

max_abc = ds[n/2 - 1]
min_arc = ds[n_2]

print(max_abc - min_arc)

n = int(input())

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

max_abc = ds[int(n/2 - 1)]
min_arc = ds[int(n/2)]

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):
import sys

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

def main():
    d.sort()
    h = n // 2
    l = d[h-1]; r = d[h]
    return r - (l + 1) - 1

if __name__ == '__main__':
    ans = main()
    print(ans)

import sys

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

def main():
    m = n // 2
    l, r = a[m-1], a[m]
    print(r - l)
    
if __name__ ==  '__main__':
    main()

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()
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')

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

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

sorted_d = sorted(d)
half = n/2 

sorted_d[half] = a 
sorted_d[half+1] = b 

print(b-a)

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

sorted_d = sorted(d)
half = n/2

a = sorted_d[half]
b = sorted_d[half+1]

print(b-a)


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

sorted_d = sorted(d)
half = n//2

a = sorted_d[half-1]
b = sorted_d[half]

print(b-a)


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()))
k = max(d)
i = 0
j = 0
ans = 0
b = 0
s = 0
while i <= k:
  while j <= n-1:
    if d[j] < i:
      s += 1
    if d[j] >= i:
      b += 1
    j += 1
  if b == s:
    ans += 1
  b = 0
  s = 0
  i += 1
print(ans)
  

n = int(input())
d = list(map(int,input().split()))
k = max(d)
i = 0
j = 0
ans = 0
b = 0
s = 0
while i <= k:
  while j <= n-1:
    if d[j] <= i:
      b += 1
      j += 1
    if d[j] > i:
      s += 1
      j += 1
  if b == s:
    ans += 1
  b = 0
  s = 0
  i += 1
print(ans)

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


n = int(input())
d = list(map(int,input().split()))
k = max(d)
i = 0
j = 0
ans = 0
b = 0
s = 0
while i <= k:
  while j <= n-1:
    if d[j] < i:
      b += 1
      j += 1
    if d[j] >= i:
      s += 1
      j += 1
  if b == s:
    ans += 1
  b = 0
  s = 0
  i += 1
print(ans)
  

n = int(input())
d = list(map(int,input().split()))
k = max(d)
i,j,ans,b,s = 0
while i <= k:
  while j <= n-1:
    if d[j] <= i:
      b += 1
    if d[j] > i:
      s += 1
  if b == s:
    ans += 1
  i += 1
print(ans)
  

n = int(input())
d = list(map(int,input().split()))
k = max(d)
i = 0
j = 0
ans = 0
b = 0
s = 0
while i <= k:
  while j <= n-1:
    if d[j] <= i:
      b += 1
    if d[j] > i:
      s += 1
  if b == s:
    ans += 1
  b = 0
  s = 0
  i += 1
print(ans)

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Time Limit Exceeded

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

left = d[N//2]
right = d[N//2 +1]

dif = right - left

print(dif)

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

d.sort()

left = d[int(N/2)]
right = d[int(N/2) +1]

dif = right - left

print(dif)

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

d.sort()
left = d[int(N/2-1)]
right = d[int(N/2)]

dif = right - left

print(dif)

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):
s=list(input())
k=int(input())
s.append(-1)
i=0
ans=-1
while True:
    if s[i]=="-1":
        ans=s[i]
        break
    if s[i]!="1":
        ans=s[i]
        if i+1>k:
            ans="1"   
        break
    i+=1
print(ans)


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

print(ls[n//2]-ls[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(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)

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)

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):
# input
N = int(input())
d = list(map(int, input().split()))


sort_d = sorted(d)
c = N // 2
print(len(list(range(sort_d[c - 1] + 1, sort_d[c]))))

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


sort_d = sorted(d)
c = N // 2
print(len(list(range(sort_d[c - 1], sort_d[c]))))

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):
# coding: utf-8

def main():
    N = int(input())
    d = sorted(list(map(int, input().split())))
    ans = 0
    if d[N / 2] != d[N / 2 - 1]:
        ans = d[N / 2] - d[N / 2 - 1]

    print(ans)


if __name__ == "__main__":
    main()


# coding: utf-8

def main():
    N = int(input())
    d = sorted(list(map(int, input().split())))
    ans = 0
    if d[N // 2] != d[N // 2 - 1]:
        ans = d[N // 2] - d[N // 2 - 1]

    print(ans)


if __name__ == "__main__":
    main()


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 = sorted(list(map(int,input().split())))
print(d)
print(d[0])
print(d[n//2 + 2])
print(d[n//2 + 1])
if d[n//2 + 1] == d[n//2 +2]:
    print("0")
else:
    print(d[n//2] - d[n//2 -1])

n = int(input())
d = sorted(list(map(int,input().split())))
if d[n//2 ] == d[n//2 -1]:
    print("0")
else:
    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 = sorted(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())
ds = [int(i) for i in input().split()]

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


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

print(ds[N//2] - ds[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_s = list(map(int,input().split()))
d_s.sort()
print(d_s[len(d_s)]-d_s[len(d_s)-1])

# coding: utf-8
# Your code here!
N = int(input())
d_s = list(map(int,input().split()))
d_s.sort()
print(d_s[len(d_s)//2]-d_s[len(d_s)//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 = int(input())
d = list(map(int, input().split()))

ans = 0
for K in range(1, 10**5+1):
  if np.sum(d[d>=K]) == np.sum(d[d<K]): ans += 1

print(ans)

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








d = sorted(d)
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 = sorted(d)
tar = int(n/2) - 1


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

print(ans)


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)

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)


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()))
cnt = 0
for i in range(max(D)) :
  cnt = len(list(filter(lambda x : x <= i, D)))
  if(cnt == N // 2) :
    ans += 1
  else :
    pass
print(ans)

N = int(input())
D = list(map(int, input().split()))
ans = 0
for i in range(max(D)) :
  cnt = len(list(filter(lambda x : x <= i, D)))
  if(cnt == N // 2) :
    ans += 1
    print(i)
  else :
    pass
print(ans)

N = int(input())
D = list(map(int, input().split()))
D.sort()
ans = 0
for i in range(N // 2) :
  cnt = len(list(filter(lambda x : x <= D[N // 2 - 1 + i], D)))
  if(cnt == N // 2) :
    ans += D[N // 2] - D[N // 2 - 1]
  elif(cnt > N // 2) :
    break
  else :
    pass
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()
ans = d[(N/2)+1]-d[N/2]
  

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

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[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())
a = sorted(list(map(int, input().split())))
print(a[n/2] - a[n/2-1])

n = int(input())
a = sorted(list(map(int, input().split())))
print(a[n//2] - a[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())
List = list(map(int,input().split()))

List.sort()

a = List[N/2-1]
b = List[N/2]

print(int(b-a))

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

List.sort()

a = List[int(N/2-1)]
b = List[N//2]

print(int(b-a))


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()
S = sum(d)
if not d[N/2 - 1] < S/N <= d[N/2 + 1]:
  print(0)
elif:
  A = 0
  for i in range(d[N/2 + 1]-d[N/2 - 1]):
    d[N/2 - 1] + i+1 <= d[N/2 + 1]
    A += 1
  print(A)

N = int(input())
d = list(map(int, input().split()))
d.sort()
S = sum(d)
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,m = map(int,input().split())
a = []
mod = 10**9+7
d = [0 for i in range(n+1)]
d[0] = 1
d[1] = 1
if n >1 :
    d[2] = 2
for i in range(3,n+1):
    d[i] = d[i-1] + d[i-2]
d.append(0)
if m != 0:
    for i in range(m):
        b = int(input())
        a.append(b)
    ans = 1
    if a[0] == 1:
        ans = 1
    else:
        ans = ans*d[a[0]-1]%mod
    for i in range(m-1):
        ans = ans*d[a[i+1]-a[i]-2]%mod
    ans = ans*d[n-a[m-1]-1]%mod
else:
    ans = d[n]
print(ans)



n,m = map(int,input().split())
a = []
mod = 10**9+7
for i in range(m):
    b = int(input())
    a.append(b)
d = [0 for i in range(n+1)]
d[0] = 0
d[1] = 1
d[2] = 2
for i in range(3,n+1):
    d[i] = d[i-1] + d[i-2]
ans = 1
if a[0] == 1:
    ans = 1
else:
    ans = ans*d[a[0]-1]%mod
for i in range(m-1):
    ans = ans*d[a[i+1]-a[i]-2]%mod
ans = ans*d[n-a[m-1]-1]%mod
print(ans)

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

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())
P=list(map(int,input().split()))

D=sorted(D)
K=D[N//2]-D[N//2-1]
print(K)

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

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())
a=list(map(int,input().split()))
print(a[n//2]-a[n//2-1])

n=int(input())
a=list(map(int,input().split()))
a.sort()
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):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[n/2]-s[n/2-1])

input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[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())
l = sorted(list(map(int, input().split())))
d = int(n / 2)
r = l[d] - l[d-1]
print(l)
print(r)

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

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(d[sorted(d)//2]-d[sorted(d)//2-1])

n = int(input())
d = list(map(int, input().split()))
print(sorted(d)[n//2]-sorted(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 = sorted(D)
left = D[N//2]
right = D[N//2+1]

print(right-left)


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

D = sorted(D)
left = D[N//2-1]
right = D[N//2]
# print("left: {}, right: {}".format(left, right))
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):
import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
cnt = 0
ans = 0
for i in N:
    if len(N) == 1:
        ans = N[0]
        break
    if i == '1':
        cnt += 1
        continue
    else:
        if int(i) * 5000 * 10 ** 12 + cnt >= K:
            ans = i
            break
        else:
            ans = N[N.find(i) + 1]
            break

print(ans)


import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *d = map(int, read().split())
d.sort()

ans = d[N // 2] - d[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):
n=int(input())
d=list(map(int, input().split()))
l=d//2
dif=d[l]-d[l-1]
if dif==0:
  print(0)
else:
  print(dif)

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

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


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

sd = sorted(d)

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

else:

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

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

sd = sorted(d)

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

else:

  print(sd[int(n/2)] - sd[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())
lst = list(map(int,input().split()))
lst.sort()
print(lst)
i = n//2
j = i-1
print(lst[i]-lst[j])


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

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):
a=int(input())
s=list(map(int,input().split()))
s.sort()
print(s[a/2]-a[a/2-1])

a=int(input())
n=sorted(list(map(int,input().split())))
print(n[a//2]-n[a//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().strip().split()))
ans=0

d.sort()



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

print(ans)

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


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())).sort()
a = l[n//2]
b = l[n//2 + 1]

print(b-a)

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

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 sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    d = list(map(int, input().split()))
    d.sort()
    g = d[n//2]
    ans += g - d[n//2-1] + 1
    print(ans)

if __name__ == '__main__':
    main()

import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

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 = [int(x) for x in input().split()]
d.sort()
print(d[int(n / 2) + 1] - d[int(n / 2)])

n = int(input())
d = [int(x) for x in input().split()]
d.sort()
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())
value = list(map(int,input().split()))
value.sort()
print(value[(int(N/2))]-value[(int(N/2))-1]+1)

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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([int(x) for x in input().split()])
l = D[len(D)//2-1]
h = D[len(D)//2]
if l == h:
  print(0)
else:
  print(h - l + 1)

N = int(input())
D = sorted([int(x) for x in input().split()])
l = D[len(D)//2-1]
h = D[len(D)//2]
if l == h:
  print(0)
else:
  print(D.count(h) + h - l)

N = int(input())
D = sorted([int(x) for x in input().split()])
l = D[len(D)//2-1]
h = D[len(D)//2]
if l == h:
  print(0)
else:
  print(h - l)

Verdicts: Wrong Answer

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([int(x) for x in input().split(' ')])
if d[int(n/2)-1] == d[int(n/2)]:
    print(0)
else:
    print(d[int(n/2)] - d[int(n/2)-1]+1)

n = int(input())
d = sorted([int(x) for x in input().split(' ')])
if d[int(n/2)-1] == d[int(n/2)]:
    print(0)
else:
    print(d[int(n/2)] - d[int(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())
x=list(map(int,input().split()))
n=N//2

X=sorted(x)
#print(X)

#print(X[n-1])
#print(X[n])

print(X[n]-X[n-1]


N=int(input())
x=list(map(int,input().split()))
n=N//2

X=sorted(x)
#print(X)

#print(X[n-1])
#print(X[n])

print(X[n]-X[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())
d = list(map(int,input().split()))

t = d.sort()

a = t[(n/2)-1]
b = t[(n/2)]

print(b-a)

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

d.sort()

a = d[int(n/2)-1]
b = d[int(n/2)]

print(b-a)

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):
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1

import statistics
import math
n = int(input()) 
s = list(map(int,input().split()))
s.sort()

med_ind = len(s)//2 -1
#print(med_ind)
ans = s[med_ind+1]-s[med_ind]
#print(s[med_ind+1],s[med_ind])
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):
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1

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

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


Verdicts: Runtime Error

Accepted