Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

cnt = [0] * N
for i in range(N):
    for j in range(i, N-i+2):
        if H[j] >= H[j+1]:
            cnt[i] +=1
        else:
            break

print(max(cnt))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))

cnts = 0
cnt = [0] * N
for i in range(1, N):
    if H[i-1] >= H[i]:
        cnts +=1
    else :
        cnts = 0
    cnt[i] = cnts

print(max(cnt))

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

cnt = [0] * N
for i in range(N):
    for j in range(i, N-i+1):
        if H[j] >= H[j+1]:
            cnt[i] +=1
        else:
            break

print(max(cnt))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))

cnts = 0
cnt = [0] * N
for i in range(1, N):
    if H[i-1] >= H[i]:
        cnts +=1
    else :
        cnts = 0
    cnt[i] = cnts

print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))

cnt = [0] * N
for i in range(N):
    for j in range(i, N-1):
        if H[j] >= H[j+1]:
            cnt[i] +=1
        else:
            break

print(max(cnt))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))

cnts = 0
cnt = [0] * N
for i in range(1, N):
    if H[i-1] >= H[i]:
        cnts +=1
    else :
        cnts = 0
    cnt[i] = cnts

print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))

cnt = [0] * N
for i in range(N):
    for j in range(i, N-1):
        if H[j] >= H[j+1]:
            cnt[i] +=1
        else:
            break

print(max(cnt))

Fixed submission:
N = int(input())
H = list(map(int, input().split()))

cnts = 0
cnt = [0] * N
for i in range(1, N):
    if H[i-1] >= H[i]:
        cnts +=1
    else :
        cnts = 0
    cnt[i] = cnts

print(max(cnt))
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())

v = [[] for i in range(n)] # []のn個配列
for i in range(n-1):
  a,b = map(int,input().split())
  a -= 1 # listのindex参照をそのまま使いたいので頂点id(1から始まっている)を-1しておく
  b -= 1 # aと同様
  v[a].append(b)
  v[b].append(a)

f = [0]*n
for i in range(q):
  p,x = map(int,input().split())
  p -= 1 # aと同様
  f[p] += x

def dfs(x,d,s): # x:計算する頂点（上側）, d:計算済み(0)か否か(1), s:頂点xの値
  for y in v[x]: # 頂点xとつながる各頂点yの計算を行う
    if d[y]: # 頂点yが計算未了の場合
      s += f[y] # 頂点xの値sに頂点yの値を足す
      ans[y] = s # 頂点yの値はsに確定
      d[y] = 0 # 頂点yの計算は終わったのでd[y]=0とする
      dfs(y,d,s) # 頂点yの下層についても再帰的に計算
      s -= f[y] # 頂点yの下層の計算が終わったので、sを頂点xの値に戻す

ans = [0]*n
d = [1]*n
d[0] = 0
ans[0] = f[0]
s = f[0]

dfs(0,d,s)
print(*ans) #ansの中身を展開

Fixed submission:
from collections import deque
 
# BFSで通す
N, Q = map(int, input().split())  # N頂点, Q個の命令
 
G = [[] for _ in range(N)]
count = [0]*N
for i in range(N-1):  # 辺はN-1本
    a, b = map(lambda x: int(x)-1, input().split())
    G[a].append(b)
    G[b].append(a)
 
for i in range(Q):  # Q個の操作について
    p, x = map(int, input().split())
    count[p-1] += x
 
q = deque([0])
flag = [False]*N
 
while len(q):
    v = q.pop()
    flag[v] = True
    for e in G[v]:  # vを親にもつノードについてループを回す
        if flag[e]:  # 頂点eに到達済みであれば
            continue
        count[e] += count[v]  # それぞれの子たちに親の値を伝播させる
        q.append(e)
 
print(*count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    print("S",S)
    print("D",D)
    if S in D:
        D[S] += 1
    else:
        D[S] = 1

ans = 0
for v in D.values():
    ans += v * (v - 1) // 2

print(ans)

Fixed submission:
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    if S in D:
        D[S] += 1
    else:
        D[S] = 1

ans = 0
for v in D.values():
    ans += v * (v - 1) // 2

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    print("S",S)
    print("D",D)
    if S in D:
        D[S] += 1
    else:
        D[S] = 1

ans = 0
for v in D.values():
    ans += v * (v - 1) // 2

print(ans)

Fixed submission:
N = int(input())
D = {}
for _ in range(N):
    S = "".join(sorted(input()))
    if S in D:
        D[S] += 1
    else:
        D[S] = 1

ans = 0
for v in D.values():
    ans += v * (v - 1) // 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

li = []
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            li.append([x, y, S-x-y])
print(len(li))

Fixed submission:
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

li = []
for x in range(0, S+1):
    if x <= K:
        for y in range(0, S+1-x):
            if y <= K:
                for z in range(0, S+1-x-y):
                    if x + y + z == S and z <= K:
                        li.append([x, y, z])
print(len(li))

Fixed submission:
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

li = []
for x in range(0, S+1):
    for y in range(0, S+1-x):
        for z in range(0, S+1-x-y):
            if x + y + z == S and x <= K and y <= K and z <= K:
                li.append([x, y, z])
print(len(li))

Fixed submission:
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
def awc(s):
    print("ARC" if s == "ABC" else "ABC")

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(line)
    awc(s)


Fixed submission:
def awc(s):
    print("ARC" if s == "ABC" else "ABC")

if __name__ == "__main__":
    import sys
    in_str = input()
    awc(in_str)
Buggy python submission (verdict: Time Limit Exceeded):
def mws5(lookup, hs):
    ans = 0
    for i in range(len(hs)):
        h = hs[i]
        for k in lookup.keys():
            if lookup[k][k+i+h]:
                ans += 1
    print(ans)

if __name__ == "__main__":
    import sys
    from collections import defaultdict as DD
    lookup = DD(lambda:DD(bool))
    n = int(input())
    hs = [int(_) for _ in input().split()]
    for i, h in enumerate(hs):
        lookup[h][i] = True
    mws5(lookup, hs)


Fixed submission:
def mws5(lookup, hs):
    ans = 0
    for i in range(len(hs)):
        h = hs[i]
        ans += lookup[i+h]
    print(ans)

if __name__ == "__main__":
    import sys
    from collections import defaultdict as DD
    lookup = DD(int)  
    n = int(input())
    hs = [int(_) for _ in input().split()]
    for i, h in enumerate(hs):
        lookup[i-h] += 1
    mws5(lookup, hs)
Buggy python submission (verdict: Runtime Error):
def ghke(k, x):
    return k * 500 >= x

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(int(line))
    roundone([int(_) for _ in in_str[0].split()])

Fixed submission:
def ghke(k, x):
    print('Yes') if k * 500 >= x else print("No")

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(line)
    k, x = [int(_) for _ in in_str[0].split(' ')]
    ghke(k, x)
Buggy python submission (verdict: Runtime Error):
def blackjack(s):
    a, b, c = [_ for int(_) in in_str.split()]
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    blackjack(in_str)


Fixed submission:
def blackjack(s):
    a, b, c = [int(_) for _ in s.split()]
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    blackjack(in_str)
Buggy python submission (verdict: Runtime Error):
def isLast(m1, d1, m2, d2):
  return m2 > m1

if __name__ == "__main__":
  import sys
  m1, d1, m2, d2 = [int(_) for _ in sys.argv[1:]]
  print(isLast(m1, d1, m2, d2))

Fixed submission:
def isLast(m1, d1, m2, d2):
  return m2 > m1
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  m1, d1, m2, d2 = [int(_) for _ in in_str.split()]
  print(int(isLast(m1, d1, m2, d2)))
Buggy python submission (verdict: Runtime Error):
def beforeTax(n):
  li = int(n // 1.08)
  if int(li * 1.08) == n:
    print(li)
  if int((li + 1) * 1.08) == n:
    print(li + 1)
  print(':(')
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  n = [int(_) for _ in in_str.split()]
  print(int(beforeTax(n)))

Fixed submission:
def beforeTax(n):
  li = int(n // 1.08)
  if int(li * 1.08) == n:
    print(li)
  elif int((li + 1) * 1.08) == n:
    print(li + 1)
  else:
  	print(':(')
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  n = [int(_) for _ in in_str.split()][0]
  beforeTax(n)
Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

if A%K == 0 or B%K == 0
	print 'OK'

elif A <= K*(A//K + 1) and K*(A//K + 1) <= B :
	print 'OK'

else :
	print 'NG'


Fixed submission:
K  = int((input() .split())[0])
A, B = map(int, input().split())

if A%K == 0 or  K*(A//K + 1) <= B :
	print('OK')

else :
	print('NG')

Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

If A%K == 0 or B%K == 0
	print 'OK'

elif A <= K*(A//K + 1) and K*(A//K + 1) <= B :
	print 'OK'

else :
	print 'NG'


Fixed submission:
K  = int((input() .split())[0])
A, B = map(int, input().split())

if A%K == 0 or  K*(A//K + 1) <= B :
	print('OK')

else :
	print('NG')
Buggy python submission (verdict: Runtime Error):
import math
X = int(input() .split)
Yokin = 100
Nen = 0

while X > Yokin:
	Yokin = math.floor(Yokin * 1.01)
	Nen = Nen + 1

print( Nen )



Fixed submission:
import math
X = int((input() .split())[0])
Yokin = 100
Nen = 0

while X > Yokin:
	Yokin = math.floor(Yokin * 1.01)
	Nen = Nen + 1

print( Nen )

Buggy python submission (verdict: Runtime Error):
X = int(input())

import math

Yokin = 100
Nen = 0

while X > Yokin
	Yokin = math.floor(Yokin * 1.01)
	Nen = Nen + 1

print( Nen )

Fixed submission:
import math
X = int((input() .split())[0])
Yokin = 100
Nen = 0

while X > Yokin:
	Yokin = math.floor(Yokin * 1.01)
	Nen = Nen + 1

print( Nen )
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
#print(a)
ans='YES'
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        elif a[i]==a[j]:
            ans = 'NO'
print(ans)


Fixed submission:
n=int(input())
a=list(map(int, input().split()))
#print(a)
a.sort()
ans='YES'
prev=0
for i in range(n):
    if prev == a[i]:
        ans='NO'
        break
    else:
        prev = a[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
s=list(input())
n=len(s)
n2 = 2**(n-1)
n3 = (n-1)*-1
# if n2 = 1
ans=0
for i in range(n2):
    li = list(format(i,'010b'))
    li = li[n3:]
    #    print(li)
    tmpstr=s[0]
    tmpnum=0
    index = 0
    for j in li:
#        print("ans",ans,"tmpstr",tmpstr,"tmpnum",tmpnum,"index",index)
        if j == '0':
            # string
            tmpstr=tmpstr+s[index+1]
        else:
            # plus
            if tmpstr =="":
                tmpnum=0
            else:
                tmpnum=int(tmpstr)
            tmpstr=s[index+1]
            ans=ans+tmpnum
        index += 1
    if tmpstr != "":
#        print("ans",ans,"tmpstr",tmpstr)
        tmpnum=int(tmpstr)
        ans=ans+tmpnum
print(ans)


Fixed submission:
s=list(input())
n=len(s)
if n == 1:
    print(int(s[0]))
else:    
    n2 = 2**(n-1)
    #print(n2)
    n3 = (n-1)*-1
    # if n2 = 1
    ans=0
    for i in range(n2):
        li = list(format(i,'010b'))
        li = li[n3:]
        #    print(li)
        tmpstr=s[0]
        tmpnum=0
        index = 0
        for j in li:
            #        print("ans",ans,"tmpstr",tmpstr,"tmpnum",tmpnum,"index",index)
            if j == '0':
                # string
                tmpstr=tmpstr+s[index+1]
            else:
                # plus
                if tmpstr =="":
                    tmpnum=0
                else:
                    tmpnum=int(tmpstr)
                    tmpstr=s[index+1]
                    ans=ans+tmpnum
            index += 1
        if tmpstr != "":
            #        print("ans",ans,"tmpstr",tmpstr)
            tmpnum=int(tmpstr)
            ans=ans+tmpnum
    print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if S = ABC:
	retrun ARC
else:
	retrun ABC

Fixed submission:
S = input()
if S == 'ABC':
	print('ARC')
else:
	print('ABC')
Buggy python submission (verdict: Runtime Error):
if B//K - A//K >=1:
	print('OK')
elif B == A:
	print('OK')
else:
	print('NG')

Fixed submission:
K = int(input())
AB = input()
ABB = AB.split()
A = int(ABB[0])
B = int(ABB[1])
C = 0

for i in range(A, B+1):
  if i % K ==0:
    print('OK')
    C = 1
    break
if C == 0:
  print('NG')
Buggy python submission (verdict: Runtime Error):
h = 'A B C D'
list = h.split(' ')

taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')

Fixed submission:
import math
A, B, C, D = map(int, input().split())
if math.ceil(C/B) <= math.ceil(A/D):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
h = 'A B C D'
list = h.split(' ')

taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')

Fixed submission:
import math
A, B, C, D = map(int, input().split())
if math.ceil(C/B) <= math.ceil(A/D):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')


Fixed submission:
import math
A, B, C, D = map(int, input().split())
if math.ceil(C/B) <= math.ceil(A/D):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
from math import pi

R = int(input)
h = 2*R*pi
print(h)

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)

Buggy python submission (verdict: Runtime Error):
R = int(input)
h = 2*R*3.14

print(h)

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)

Buggy python submission (verdict: Runtime Error):
R = input()
h = 2*R*3.14

print(h)

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)

Buggy python submission (verdict: Runtime Error):
h = input()
print(2h*3.14)

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)

Buggy python submission (verdict: Runtime Error):
h = 2R*3.14

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=list(map(int, input().split()))

for A in range(1,N+1):
  print(X.count(A))

Fixed submission:
import collections

N=int(input())
X=list(map(int, input().split()))
c = collections.Counter(X)

for A in range(1,N+1):
  print(c[A])
Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
for x in range(Lo,Ro):
    for y in range(x+1,Ro+1):
        Sa=x*y
        S=Sa%2019
        if Smin>S:
            Smin=S
print(Smin)



Fixed submission:
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
if Ro>=2019:
    Smin=0
if Ro<2019:
    for x in range(Lo,Ro):
        for y in range(x+1,Ro+1):
            Sa=x*y
            S=Sa%2019
            if Smin>S:
                Smin=S
print(Smin)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
for x in range(L,R):
    for y in range(x+1,R+1):
        Sa=x*y
        S=Sa%2019
        if Smin>S:
            Smin=S
print(Smin)



Fixed submission:
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
if Ro>=2019:
    Smin=0
if Ro<2019:
    for x in range(Lo,Ro):
        for y in range(x+1,Ro+1):
            Sa=x*y
            S=Sa%2019
            if Smin>S:
                Smin=S
print(Smin)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int, input().split())
Smin=2019
for x in range(L,R):
    for y in range(x+1,R+1):
        S=x*y%2019
        if Smin>S:
            Smin=S
print(Smin)



Fixed submission:
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
if Ro>=2019:
    Smin=0
if Ro<2019:
    for x in range(Lo,Ro):
        for y in range(x+1,Ro+1):
            Sa=x*y
            S=Sa%2019
            if Smin>S:
                Smin=S
print(Smin)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int, input().split())
Smin=2019
for x in range(L,R):
    for y in range(x+1,R+1):
        S=x*y%2019
        if Smin>S:
            Smin=S
print(Smin)



Fixed submission:
L,R = map(int, input().split())
Smin=2019
Lo=L%2019
Ro=R-(L-Lo)
if Ro>=2019:
    Smin=0
if Ro<2019:
    for x in range(Lo,Ro):
        for y in range(x+1,Ro+1):
            Sa=x*y
            S=Sa%2019
            if Smin>S:
                Smin=S
print(Smin)
Buggy python submission (verdict: Runtime Error):
n=int(input()
p=list(map(int, input().split()))
i=0
for x in range(0,n-2):
    if p[x]>p[x+1] and p[x+1]>p[x+2]:
        i=i+1
    if p[x]<p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]==p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]>p[x+1] and p[x+1]==p[x+2]:
        i=i+i
print(i)


Fixed submission:
n=int(input())
p=list(map(int, input().split()))
i=0
for x in range(0,n-2):
    if p[x]>p[x+1] and p[x+1]>p[x+2]:
        i=i+1
    if p[x]<p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]==p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]>p[x+1] and p[x+1]==p[x+2]:
        i=i+i
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
d=list(map(int, input().split()))
C=N//2
for x in reversed(range(1,N+1)):
    for y in range(0,x-1):
        if d[y]<d[y+1]:
            t=d[y]
            d[y]=d[y+1]
            d[y+1]=t
if d[C]==d[C-1]:
    print(0)
else:
    print(d[C-1]-d[C])


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

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
d=list(map(int, input().split()))
C=N//2
for x in range(0,N):
    for y in range(0,N-1):
        if d[y]<d[y+1]:
            t=d[y]
            d[y]=d[y+1]
            d[y+1]=t
    N=N-1
if d[C]==d[C-1]:
    print(0)
else:
    print(d[C-1]-d[C])


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

Buggy python submission (verdict: Runtime Error):
N=int(input())
d=list(map(int, input().split()))
C=N//2
for x in range(0,N):
    for y in range(0,N-1):
        if d[y]<d[y+1]:
            t=d[y]
            d[y]=d[y+1]
            d[y+1]=t
    N=N-1
if d[C]==d[C-1]:
    print(0)
elif:
    print(d[C-1]-d[C])


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

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
d=list(map(int, input().split()))
B=N
for x in range(0,N):
    for y in range(0,N-1):
        if d[y]<d[y+1]:
            t=d[y]
            d[y]=d[y+1]
            d[y+1]=t
    N=N-1
C=B//2
if d[C]==d[C-1]:
    print(0)
if d[C]!=d[C-1]:
    print(d[C-1]-d[C])


Fixed submission:
N=int(input())
d=list(map(int, input().split()))
C=N//2
d.sort()
if d[C]==d[C-1]:
    print(0)
else:
    print(d[C]-d[C-1])
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if A==7 and B==5 and C==5:
  print("Yes")
else if A==5 and B==5 and C==7:
  print("Yes")
else if A==5 and B==7 and C==5:
  print("Yes")
else:
  print("No")

Fixed submission:
A,B,C = map(int, input().split())
if A==7 and B==5 and C==5:
  print("YES")
elif A==5 and B==5 and C==7:
  print("YES")
elif A==5 and B==7 and C==5:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

okashi = [0] * N

for l in range(N):
    for i in A[l]:
        okashi[i-1] += 1

count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)


Fixed submission:
N, K = map(int, input().split())
d = []
A = []

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

okashi = [0] * N

for l in range(K):
    for i in A[l]:
        okashi[i-1] += 1

count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    print(A.count(i+1))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
num = [0 for i in range(N)]
for i in A:
    num[i-1] += 1
for l in num:
    print(l)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
data = []
ans = 0
flag = 1
for i in range(a):
  tar = input()
  for j in data:
    if tar == j:
      flag = 0
  if flag:
    ans += 1
  data.append(tar)
   
  
  
print(ans)
    


Fixed submission:
a = int(input())
data = []
for i in range(a):
  data.append(input())
   
ans = set(data)
print(len(ans))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
m=[]
for _ in range(2*k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    if i not in m:
      m.append(i)
mx=max(m)
c=0
for i in range(1,n+1):
  if(i not in m):
    c+=1
print(c)    

Fixed submission:
n,k=map(int,input().split())
m=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    if i not in m:
      m.append(i)
mx=max(m)
c=0
for i in range(1,n+1):
  if(i not in m):
    c+=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8

import sys

X = int(input())

powers = {}
def powered(i):
    if i in powers:
        return powers[i]
    powered = pow(i, 5)
    powers[i] = powered
    return powered

for a in range(100000, 0, -1):
    for b in range(0, 100000):
        poweredA = powered(a)
        poweredB = powered(b)
        if poweredA - poweredB == X:
            print(a, b)
            sys.exit()
        elif poweredA + poweredB == X:
            print(a, -b)
            sys.exit()


Fixed submission:
#coding: utf-8

import sys

X = int(input())

powers = {}
def powered(i):
    if i in powers:
        return powers[i]
    powered = pow(i, 5)
    powers[i] = powered
    return powered

for a in range(1000, 0, -1):
    for b in range(0, 1000):
        poweredA = powered(a)
        poweredB = powered(b)
        if poweredA - poweredB == X:
            print(a, b)
            sys.exit()
        elif poweredA + poweredB == X:
            print(a, -b)
            sys.exit()