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

N=int(input())
d=list(map(int,input().split()))
d=sorted(d)
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 = sorted(list(map(int, input().split())))
check = []
half = int(len(D)/2)
D_lead = D[:half]
D_tail = D[half:]
if max(D_lead) != min(D_tail):
    check = [num for num in range(max(D_lead), min(D_tail)+1)]
    print(len(check))
else:
    print(0)

N = int(input())
D = sorted(list(map(int, input().split())))
check = []
half = int(len(D)/2)
D_lead = D[:half]
D_tail = D[half:]
if max(D_lead) != min(D_tail):
    check = [num for num in range(max(D_lead), min(D_tail))]
    print(len(check))
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())
permu=list(map(lambda x:int(x),input().split()))
permu=sorted(permu)
s,t=N//2-1,N//2
print(s,t)
a=list(range(permu[s]+1,permu[t]+1))
print(len(a))


N=int(input())
permu=list(map(lambda x:int(x),input().split()))
permu=sorted(permu)
s,t=int(N/2)-1,int(N/2)
a=list(range(permu[s]+1,permu[t]+1))
print(len(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):

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

d.sort()
avg = mean(d) // 1

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

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

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

d.sort()

d1 = [d[i] for i in range(N//2) if i <= N]
d2 = [d[i] for i in range(N//2,N)]

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

if len(d1) == len(d2):
    print(a)
    sys.exit()
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):
#!/usr/bin/env python3
p

#!/usr/bin/env python3
n = int(input())
d = list(map(int, input().split()))

d.sort()
h = n // 2 - 1

a = d[h]
b = d[h + 1]

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


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


n = int(input())
d = list(map(int,input().split()))
d.sort()
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=sorted(d)

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

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

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

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

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



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

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




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


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

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

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

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

dd=sorted(d)

print(dd[n/2+1]-dd[n/2-1])

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

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


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

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

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


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

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


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

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

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


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

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

arr = sorted(arr_input)

ans = arr[n/2] - arr[n/2-1]

if ans == 0:
    print(0)
else:
    print(ans)


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

arr = sorted(arr_in)

n = int(n/2)

res =  arr[n] - arr[n-1]
print(res)


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,b,c,d=map(int, input().split())

import fractions

def lcm(x,y):
	return (x*y)//fractions.gcd(x,y)

lcmcd=lcm(c,d)
divc=b//c-(a-1)//c
divd=b//d-(a-1)//c
divcd=b//lcmcd-(a-1)//lcmcd

print(b-a+1-divc-divd+divcd)

a,b,c,d=map(int, input().split())

import fractions

def lcm(x,y):
	return (x*y)//fractions.gcd(x,y)

lcmcd=lcm(c,d)
divc=b//c-(a-1)//c
divd=b//d-(a-1)//c
divcd=b//lcmcd-(a-1)//lcmcd

print(b-a+1-divc-divd+divcd)

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

import heapq

heapq.heapify(d)

for i in range(n//2-1):
	heapq.heappop(d)
	
a=heapq.heappop(d)
b=heapq.heappop(d)

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())).sort()
i = int(n / 2)

print(d[i] - d[i - 1])

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

d.sort()
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)
l = d[n/2-1]
r = d[n/2]
print(r-l)


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


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

D = sorted([int(v) for v in input().split()])
arc = N // 2
abc = arc - 1
print(D[arc] - D[abc])


N = int(input())

D = sorted([int(v) for v in input().split()])
arc = N // 2
abc = arc - 1
print(D[arc] - D[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())
d = list(map(int, input().split()))


length = len(d)
length_half = int(length/2)


print(d[length_half]-d[length_half-1])


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

length = len(d)
length_half = int(length/2)


print(d[length_half]-d[length_half-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=[int(x) for x in input().split()]
d.sort()
high=max(d)
low=0
while((high-low)>=2):
  if len([x for x in d if x<int((high+low)/2)])<N/2:
    low=int((high+low)/2)
  elif len([x for x in d if x<int((high+low)/2)])>N/2:
    high=int((high+low)/2)
  else:
    break
M=int((high+low)/2)
count=1
print(M)
if len([x for x in d if x<M])!=N/2:
  print(0)
else:
  while len([x for x in d if x<M])==N/2:
    count=count+1
    M=M+1
  print(count)
  print(M)
  print(len([x for x in d if x<M-1])==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: 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)
print(d[n//2],d[n//2-1])
print(d[n//2]-d[n//2-1])

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

N=int(input())
D=list(map(int,input().split()))
D=sorted(D)
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):
import statistics
 
n = int(input())
d = list(map(int, input().split()))
 
if n % 2 == 1:
  print(0)
  exit()

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

n = int(input())
d = list(map(int, input().split()))
 
if n % 2 == 1:
  print(0)
  exit()

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



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

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



Verdicts: Wrong Answer

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



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


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


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

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


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

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


N = int(input())
D = list(map(int,input().split()))
D.sort()
mid = int(len(D)/2)
ans = D[mid]-D[mid-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):
N = int(input())
d = list(map(int,input().split()))
d.sort()
print(d)
half = int(N/2)
dis = d[half] - d[half - 1]
print(dis)


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


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_inputs = sorted([int(i) for i in input().split()])

abc = d_inputs[0:n//2]
arc = d_inputs[n//2:n]
print(abc,arc)
print(len([i for i in range(abc[-1]+1,arc[0]+1)]))



n = int(input())
d_inputs = sorted([int(i) for i in input().split()])

abc = d_inputs[0:n//2]
arc = d_inputs[n//2:n]

print(len([i for i in range(abc[-1]+1,arc[0]+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()
print(D[N//2 + 1] - D[N//2])

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

a = int(input())
b = list(map(int, input().split()))
b.sort()
print(b)
for i in range(a//2, a):
    print(b[i]-b[i-1])
    exit()


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


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

cnt = int(input())
in_str = [int(i) for i in input().split()]
in_str.sort()
print(in_str[cnt//2] - in_str[cnt // 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 = list(map(int, input().split()))
d_list.sort()

n1 = d_list[N//2]
print(d_list[n1 + 1] - d_list[n1])

              

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

n1 = N//2
print(d_list[n1] - d_list[n1 - 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()))
mid = N/2 - 1
lst = sorted(lst)
if lst[mid] == lst[mid+1]:
    print(0)
elif lst[mid] < lst[mid+1]:
    print(lst[mid+1]-lst[mid]+1)

N = int(input())
lst = list(map(int, input().split()))
mid = int(N/2 - 1)
lst = sorted(lst)
if lst[mid] == lst[mid+1]:
    print(0)
elif lst[mid] < lst[mid+1]:
    print(lst[mid+1]-lst[mid])

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()))
p = 0
q = 0
m = 0
d.sort()
if (len(d))%2 == 0:
  m = (d[(len(d)//2)-1]+d[len(d)//2])/2
else:
  m = d[(len(d)//2)]
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
  else:
    break
print(p-q)

n = int(input())
d = list(map(int,input().split()))
p = 0
q = 0
m = 0
d.sort()
if (len(d))%2 == 0:
  m = ((d[(len(d)//2)])+(d[len(d)//2-1]))/2
else:
  m = d[(len(d)//2)]
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
  else:
    break
print(p-q)

n = int(input())
d = list(map(int,input().split()))
p = 0
q = 0
m = 0
d.sort()
if (len(d))%2 == 0:
  m = ((d[(len(d)/2)-1])+(d[len(d)/2]))/2
else:
  m = d[(len(d)/2)]
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
print(p-q)

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

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

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

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())
l=[int(i) for i in input().split()]
l.sort()
print(max(0,l[int(N/2)] - l[int(N/2)-1])


N=int(input())
l=[int(i) for i in input().split()]
l.sort()
print(max(0,l[int(N/2)] - l[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())
a = list ( map( int, input().split()))

def swap(a,i,j):
  c = a[i]
  d = a[j]
  if a[i]>a[j]:
    a[j] = c
    a[i] = d
  return a

for i in range (int(n/2)+1):
  for j in range (i+1,n):
    swap(a,i,j)
    
print(a[int(n/2)+1]-a[int(n/2)])


  

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

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



  

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

def swap(a,i,j):
  c = a[i]
  d = a[j]
  if a[i]>a[j]:
    a[j] = c
    a[i] = d
  return a

for i in range (int(n/2)+1):
  for j in range (i+1,n):
    swap(a,i,j)
    
print(a[int(n/2)+1]-a[int(n/2)])



  

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

def swap(a,i,j):
  c = a[i]
  d = a[j]
  if a[i]>a[j]:
    a[j] = c
    a[i] = d
  return a

for i in range (n/2+1):
  for j in range (i+1,n):
    swap(a,i,j)
    
print(a[n/2+1]-a[n/2])
  

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

a.sort()
k = int(n/2)    
print(a[k]-a[k-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()
mind = d[n//2-1]
maxd = d[n//2]

print(mind,maxd)

ans = maxd - (mind + 1) + 1
if ans < 0:
    print(0)
    exit()
print(ans)

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

d.sort()
mind = d[n//2-1]
maxd = d[n//2]

ans = maxd - (mind + 1) + 1
if ans < 0:
    print(0)
    exit()
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):
N = int(input())
P = list(map(int, input().split()))
 
print(L[N//2]-L[N//2-1])


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

L[N//2]-L[N//2-1]

N = int(input())
P = sorted(list(map(int, input().split())))

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

N = int(input())
P = sorted(list(map(int, input().split())))

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

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


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

n=int(input())
li=list(map(int,input().split()))
li.sort()
print(li[n//2]-li[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()))
dunder = 0
count = 0
for i in range():
    dunder = sum (x<i for x in d)
    if 2*dunder == len(d):
        count += 1
    elif 2*dunder > len(d):
        break
print(count)


N = int(input())
d = list(map(int,input().split()))
dunder = 0
count = 0
for i in range(N):
    dunder = sum (x<i for x in d)
    if 2*dunder == len(d):
        count += 1
    elif 2*dunder > len(d):
        break
print(count)


N = int(input())
d = list(map(int,input().split()))
dunder = 0
count = 0
for i in range(max(d)):
    dunder = sum (x<i for x in d)
    print(dunder)
    if 2*dunder == len(d):
        count += 1
print(count)


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


Verdicts: Runtime Error

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())
L=list(map(int,input().split())
M=list[]
m=list[]
for i in range(N):
  for x in range(N):
    if L[x]<i:
      L[x].append(M)
    else:
      L[x].append(m)
  if len(M)=len(m):
    ans+=1

print(ans)

N=int(input())
L=list(map(int,input().split()))
l=sorted(L)
if N%2==0:
  n=int(N/2)
  a=l[n-1]
  b=l[n]
  if a==b:
    print('0')
  else:
    print(b-a)
    
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):
n = int(input())
p = set(map(int, input().split()))

if len(p) % 2 == 1:
    print(0)
else:
    p = list(p)
    cnt = p[len(p)//2] - p[len(p)//2 -1]
    print(cnt)

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

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

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):
a=int(input())
inp = [int(x) for x in input().split()]
med=int(len(inp)/2)
print(inp[med]-inp[med-1])

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

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


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+1]-d[N//2]
print(ans)


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

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


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

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


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


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

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


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=list(map(int, input().split()))
#print(d)
sd = sorted(d)
##print(sd[len(d)//2-1])
print(sd[len(d)//2])
print(sd[len(d)//2]  -  sd[len(d)//2-1] +1)

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


print(sd[len(d)//2]  -  sd[len(d)//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())
List=list(map(int,input().split()))
D=List.sort()
m=D[N&2]-D[N%2-1]-1
if m=-1:
  print(0)
else:
  print(m)

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

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

D2 = sorted(D)
A = D2[N//2]
B = D2[N//2+1]
print(abs(A-B))

N = int(input())

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

D2 = sorted(D)
A = D2[N//2-1]
B = D2[N//2]
print(abs(A-B))

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()
while len(d) > 0:
        x = d.pop()
        y = d.pop(0)
print(y - x)


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


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

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

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

n=int(input())
prob=list(map(int,input().split()))
prob.sort(reverse=True)
print(-prob[n//2]+prob[(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())
dlis=sorted(list(map(int,input().split())))
print(dlis)
print(dlis[int((n/2))]-dlis[int(n/2)-1])

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

Verdicts: Wrong Answer

Accepted