Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]
l_A[0] = list(map(int, input().split()))
l_A[1] = list(map(int, input().split()))
l_A[2] = list(map(int, input().split()))

def detect_BINGO(l_Atf):
    #print(l_Atf)
    #横
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            #print("横" + str(i))
            return True
    #縦
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            #print("縦" + str(i))
            return True
    #斜
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        #print("斜＼")
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][3-1-i]
    if(f_detect):
        #print("斜／")
        return True
    
    #BINGOなし
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("no")


Fixed submission:
import math
N = int(input())
print(math.ceil(N/2))

Buggy python submission (verdict: Runtime Error):
import math
N = input()
print(math.ceil(N/2))

Fixed submission:
import math
N = int(input())
print(math.ceil(N/2))
Buggy python submission (verdict: Runtime Error):
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]

def detect_BINGO(l_Atf):
    #print(l_Atf)
    #横
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            #print("横" + str(i))
            return True
    #縦
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            #print("縦" + str(i))
            return True
    #斜
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        #print("斜＼")
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[3-1-i][3-1-i]
    if(f_detect):
        #print("斜／")
        return True
    
    #BINGOなし
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

#   print(l_Atf)
f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("no")


Fixed submission:
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]
l_A[0] = list(map(int, input().split()))
l_A[1] = list(map(int, input().split()))
l_A[2] = list(map(int, input().split()))

def detect_BINGO(l_Atf):
    #print(l_Atf)
    #横
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            #print("横" + str(i))
            return True
    #縦
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            #print("縦" + str(i))
            return True
    #斜
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        #print("斜＼")
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][3-1-i]
    if(f_detect):
        #print("斜／")
        return True
    
    #BINGOなし
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
n = 1
for i in a:
    n *= i
if n > 10**18:
    n = -1
print(n)


Fixed submission:
def main():

    N = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    ans = 1
    for i in A:
        ans *= i
        if(ans > 1000000000000000000):
            print(-1)
            return
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
ans = 0
for i in range(N):
    tmp = input()
    if not tmp in S:
        S.append(tmp)
        ans += 1
print(ans)


Fixed submission:
import numpy as np
N = int(input())
S = [0] * N
ans = 0
for i in range(N):
    S[i] = input()
print(len(np.unique(S)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
ans = 0
for i in range(N):
    tmp = input()
    if not tmp in S:
        S.append(tmp)
        ans += 1
print(ans)


Fixed submission:
import numpy as np
N = int(input())
S = [0] * N
ans = 0
for i in range(N):
    S[i] = input()
print(len(np.unique(S)))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
for i in reversed(s):
    n += int(i) * d
    n %= 2019
    d *= 10
    mod[n % 2019] += 1
print(sum(i*(i-1)//2 for i in mod))


Fixed submission:
s = input()
mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
for i in reversed(s):
    n += int(i) * d
    n %= 2019
    d *= 10
    d %= 2019
    mod[n % 2019] += 1
print(sum(i*(i-1)//2 for i in mod))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
for i in reversed(s):
    n += int(i) * d
    d *= 10
    mod[n % 2019] += 1
print(sum(i*(i-1)//2 for i in mod))


Fixed submission:
s = input()
mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
for i in reversed(s):
    n += int(i) * d
    n %= 2019
    d *= 10
    d %= 2019
    mod[n % 2019] += 1
print(sum(i*(i-1)//2 for i in mod))
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())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
for i in A:
    s[i - 1] += 1
print(*s, sep='\n')
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
min = float('inf')
ans = 0
for i in range(N):
  if P[i] <= min(P[:(i+1)]):
    ans += 1
print(ans)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min = float('inf')
ans = 0
for i in range(N):
    if P[i] <= min:
        min = P[i]
        ans += 1
    # if P[i] <= min(P[:(i+1)]):
    #     ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    if P[i] <= min(P[:(i+1)]):
        ans += 1
print(ans)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min = float('inf')
ans = 0
for i in range(N):
    if P[i] <= min:
        min = P[i]
        ans += 1
    # if P[i] <= min(P[:(i+1)]):
    #     ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
def main():
    A, B = map(int, input().split())
    ans = int(A * B / math.gcd(A, B))
    print(ans)
main()


Fixed submission:
import fractions
def main():
    A, B = map(int, input().split())
    ans = int(A * B / fractions.gcd(A, B))
    print(ans)
main()

Buggy python submission (verdict: Runtime Error):
import math
def main():
    A, B = map(int, input().split())
    ans = int(A * B / math.gcd(A, B))
    print(ans)
main()


Fixed submission:
import fractions
def main():
    A, B = map(int, input().split())
    ans = int(A * B / fractions.gcd(A, B))
    print(ans)
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    d = [1]
    ans = 0
    for i in range(N):
        if a[d[i]-1] == 2:
            ans += 1
            break
        elif a[d[i]-1] in d or i == N - 1:
            ans = -1
            break
        else:
            d.append(a[d[i]-1])
            ans += 1
    print(ans)
main()



Fixed submission:
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    now = 1
    for i in range(N):
        if a[now - 1] == 2:
            break
        elif i == N - 1:
            i = -2
        else:
            now = a[now - 1]
        #print('{}: {}'.format(i, now))
    print(i + 1)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    d = [1]
    ans = 0
    for i in range(N):
        if a[d[i]-1] == 2:
            ans += 1
            break
        elif a[d[i]-1] in d or i == N - 1:
            ans = -1
            break
        else:
            d.append(a[d[i]-1])
            ans += 1
    print(ans)
main()



Fixed submission:
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    now = 1
    for i in range(N):
        if a[now - 1] == 2:
            break
        elif i == N - 1:
            i = -2
        else:
            now = a[now - 1]
        #print('{}: {}'.format(i, now))
    print(i + 1)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    d = [1]
    ans = 0
    for i in range(N):
        if a[d[i]-1] == 2:
            ans += 1
            break
        elif a[d[i]-1] in d:
            ans = -1
            break
        else:
            d.append(a[d[i]-1])
            ans += 1
    print(ans)
main()


Fixed submission:
def main():
    N = int(input())
    a = [0 for i in range(N)]
    for i in range(N):
        a[i] = int(input())
    now = 1
    for i in range(N):
        if a[now - 1] == 2:
            break
        elif i == N - 1:
            i = -2
        else:
            now = a[now - 1]
        #print('{}: {}'.format(i, now))
    print(i + 1)
main()
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=1
way=0
for i in A:
    ans*=i
way=str(ans-1)
if(len(way)>=19):
    ans=-1
else:
    pass
print(ans)

Fixed submission:
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return under+same+over

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans=1
way=0
for i in A:
    ans*=i
    way=str(ans-1)
    if(len(way)>=19):
        ans=-1
        break
    else:
        pass
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def buble_sort(list,ans):
    i=len(list)
    while(i>1):
        for j in range(i-1):
            if(list[j]<list[j+1]):
                list[j],list[j+1]=list[j+1],list[j]
            elif(list[j]==list[j+1]):
                ans="NO"
                return ans
            else:
                pass
        i-=1
    return ans

N=int(input())
A=list(map(int,input().split()))
ans="YES"
ans=buble_sort(A,ans)
print(ans)

Fixed submission:
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N=int(input())
A=list(map(int,input().split()))
A=quick_sort(A)
ans="YES"
if(len(A)>1):
    for i in range(len(A)):
        if(A[i-1]==A[i]):
            ans="NO"
            break
        else:
            pass
else:
    pass
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N,K=map(int,input().split())
p=list(map(int,input().split()))
ans=sum(p[0:K])
for i in range(len(p)-K+1):
    if(ans<sum(p[i:i+K])):
        ans=sum(p[i:i+K])
    else:
        pass
print((ans+K)/2)

Fixed submission:
N,K=map(int,input().split())
p=list(map(int,input().split()))
ans=sum(p[0:K])
all_sum=[sum(p[0:K])]
for i in range(len(p)-K):
    ans=ans+p[i+K]-p[i]
    all_sum.append(ans)
ans=max(all_sum)
print((ans+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=1
for i in range(1,N):
    if(P[i]<min(P[0:i])):
        count+=1
    else:
        pass
print(count)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=0
mini=P[0]
for i in range(N):
    if(P[i]<=mini):
        mini=P[i]
        count+=1
    else:
        pass
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
count=0
for X in range(K+1):
    for Y in range(K+1):
        for Z in range(K+1):
            com=X+Y+Z
            if(com==S):
                count+=1
            else:
                pass
print(count)

Fixed submission:
K,S=map(int,input().split())
count=0
for X in range(K+1):
    for Y in range(K+1):
        com=S-(X+Y)
        if(com>=0 and com<=K):
            count+=1
        else:
            pass
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
big = 0
a = list(map(int, input().split()))
ans = 1
for num in a:
    ans = ans * num
if ans > 10 ** 18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
big = 0
a = list(map(int, input().split()))
a.sort()
ans = 1
for num in a:
    if num == 0:
        print(0)
        big = 1
        break
    ans = ans * num
    if ans > 10 ** 18:
        print(-1)
        big = 1
        break
if big == 0:
    print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if a >= k:
    print(k)
else:
    print(a - ((k-a)-b)

Fixed submission:
a, b, c, k = map(int, input().split())
if a >= k:
    print(k)
else:
    print(a - ((k-a)-b))

Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if a >= k:
    print(a)
else:
    print(a - ((k-a)-b)

Fixed submission:
a, b, c, k = map(int, input().split())
if a >= k:
    print(k)
else:
    print(a - ((k-a)-b))
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input())

answer = 'NG'

for i in range(a,b):
    if i % k == 0:
        answer = 'OK'
print(answer)



Fixed submission:
k = int(input())
a, b = map(int, input().split())

answer = 'NG'

for i in range(a,b+1):
    if i % k == 0:
        answer = 'OK'
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = map(int, input().split())
A = list(map(int, input().split()))
ans = 1
for a in A:
  ans *= a
if (ans > 10 ** 18):
  ans = -1
print(ans)

Fixed submission:
def calc():
  N = map(int, input().split())
  A = list(map(int, input().split()))
  for a in A:
    if a == 0:
      return 0
  ans = 1
  for a in A:
    ans *= a
    if (ans > 10 ** 18):
      return -1
  return ans

print(calc())
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N, M, Q = map(int, input().split())

L = []
for i in range(Q):
    L.append(list(map(int, input().split())))

A = []
for m in range(1, M + 1):
    for n in range(N):
        A.append(m)
#print(A)

ans_max = 0
for AA in itertools.combinations(A, N):
    ans = 0
    for ll in L:
        a = ll[0]
        b = ll[1]
        c = ll[2]
        d = ll[3]
        Ab = AA[b-1]
        Aa = AA[a-1]
        s = Ab - Aa
        if (s == c):
            ans += d
    if (ans_max < ans):
        ans_max = ans
print(ans_max)

Fixed submission:
N, M, Q = map(int, input().split())
zz = [list(map(int, input().split())) for _ in range(Q)]

def f(s):
    if len(s) == N:
        return [s]
    result = []
    if s == '':
        r = 0
    else:
        r = int(s[-1])
    for i in range(r, M):
        result.extend(f(s + str(i)))
    return result

ans = 0
V = f('')
for s in V:
    A = [int(c) + 1 for c in s]
    t = 0
    for a, b, c, d in zz:
        if A[b - 1] - A[a - 1] == c:
            t += d
    ans = max(ans, t)
print(ans)
Buggy python submission (verdict: Runtime Error):
K = int (input())
S = (input())
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...'

Fixed submission:
K = int (input())
S = (input())
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
p=1
for i in l:
  p*=i
if p>1000000000000000000:
  print('-1')
else:
  print(p)


Fixed submission:
n=int(input())
l=list(map(int,input().split()))
p=1
flag=1
zero=0 
for i in l:
    if i==0 :
        zero=1 
        break 
if zero==0:
    for i in l:
        p*=i
        if p>1000000000000000000:
            flag=0
            break
    if flag==0:
        print('-1')
    else:
        print(p)
else : 
    print("0")
Buggy python submission (verdict: Runtime Error):
n=int(input())

s=input()
l=len(s)
if l>n:
  print(s[:n].join'...')
else:
  print(s)

Fixed submission:
n=int(input())
 
s=input()
l=len(s)
if l>n:
  print(s[:n]+'...')
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18
            return -1
    return n

print(ans(a))

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
from decimal import *
import numpy as np
a = np.array(list(map(Decimal, input().split())))
p = np.prod(a, axis=0)
if p > 10**18:
    print(-1)
else:
    print(p)

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
from decimal import *
import numpy as np
a = np.array(list(map(Decimal, input().split())))
p = np.prod(a, axis=0)
if p > 10**18:
    print(-1)
else:
    print(p)

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
p = 1
if 0 in a:
    print(0)
    exit()
for i in range(n):
    p = p * a[i]
if p > 10**18:
    print(-1)
else:
    print(p)

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
p = 1
if 0 in n:
    print(0)
    exit()
for i in range(n):
    p = p * a[i]
if p > 10**18:
    print(-1)
else:
    print(p)

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
p = 1
for i in range(n):
    p = p * a[i]
if p > 10**18:
    print(-1)
else:
    print(p)

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

def ans(a):
    if 0 in a:
        return 0
    n = 1
    for i in a:
        n *= i
        if n > 10**18:
            return -1
    return n

print(ans(a))
Buggy python submission (verdict: Runtime Error):
a, b, c, k = list(map(int, input().split()))
s = 0

if k >= a:
    s = a
if (k - a - b) >= 0:
    s -= k - a - b

print(s)


Fixed submission:
s = input()
t = input()

if len(t) - len(s) != 1:
    print('No')
else:
    if s == t[0:-1] and t[-1].isalpha() and t[-1].islower():
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
t=list(input())
for i in range(len(t)):
    if t[i]=="?":
        t[i]=D
    print(t[i],end="")

Fixed submission:
t=list(input())
for i in range(len(t)):
    if t[i]=="?":
        t[i]="D"
    print(t[i],end='')

Buggy python submission (verdict: Runtime Error):
t=list(input())
for i in range(len(t)):
    if t[i]=='?':
        t[i]=D
    print(t[i],end="")

Fixed submission:
t=list(input())
for i in range(len(t)):
    if t[i]=="?":
        t[i]="D"
    print(t[i],end='')
Buggy python submission (verdict: Runtime Error):
n=input()
s=int(n/100)
if s==7:
    print("Yes")
    exit()
elif n%10 == 7:
    print("Yes")
    exit()
elif n%100>=70 and n%100<80:
    print("Yes")
    exit()
else:
    print("No")

Fixed submission:
n=int(input())
s=int(n/100)
if s==7:
    print("Yes")
    exit()
elif n%10 == 7:
    print("Yes")
    exit()
elif n%100>=70 and n%100<80:
    print("Yes")
    exit()
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
ans=0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        continue
    ans+=i
print(ans)

Fixed submission:
n = int(input())
ans=0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        continue
    ans+=i
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ans=0
for i in range(1,n):
    if i%3==0 or i%5==0:
        continue
    ans+=i
print(ans)

Fixed submission:
n = int(input())
ans=0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        continue
    ans+=i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int,input().split()))
Y = sorted(list(set(X)))
Z = [X.count(y) for y in Y]
cnt = 0
for i in range(len(Y)):
    cnt += Z[i] 
    if cnt == N//2:
        cnt = Y[i+1] - Y[i]
        break
    elif cnt > N//2:
        cnt = 0
        break
print(cnt)

Fixed submission:
N = int(input())
X = sorted(list(map(int,input().split())))
print(X[N//2]-X[N//2-1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int,input().split()))
Y = sorted(list(set(X)))
Z = [X.count(y) for y in Y]
cnt = 0
for i in range(len(Y)):
    cnt += Z[i] 
    if cnt == N//2:
        cnt = len(list(range(Y[i],Y[i+1])))
        break
    elif cnt > N//2:
        cnt = 0
        break
print(cnt)

Fixed submission:
N = int(input())
X = sorted(list(map(int,input().split())))
print(X[N//2]-X[N//2-1])