Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = sorted(set(a))
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = (g * x) // math.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)

Fixed submission:
import fractions

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = sorted(set(a))
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = (g * x) // fractions.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)

Buggy python submission (verdict: Runtime Error):
import math

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = set(a)
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = g * x // math.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)

Fixed submission:
import fractions

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = sorted(set(a))
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = (g * x) // fractions.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

ac = 0
wa = [0]*n
d = [False]*n

for _ in range(m):
    p, s = input().split()
    p = int(p)-1
    if not d[p] and s == 'AC':
        ac += 1
        d[p] = True
    elif not d[p] and s == 'WA':
        wa[p] += 1
p = 0
for i in range(n):
    if d[i]:
        p += wa[i]
print(ac, p)

Fixed submission:
c = input()
print(chr(ord(c)+1))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n != 2:
    if n % 2 == 0:
        n += 1
    while not is_prime(n):
        n += 2
    print(n)
else:
    print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

Fixed submission:
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    while not is_prime(n):
        n += 1
    print(n)

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

if n % 2 == 0:
    n += 1
while not is_prime(n):
    n += 2
print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

Fixed submission:
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    while not is_prime(n):
        n += 1
    print(n)

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

if n != 2:
    if n % 2 == 0:
        n += 1
    while not is_prime(n):
        n += 2
    print(n)
else:
    print(n)

def is_prime(q):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

Fixed submission:
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    while not is_prime(n):
        n += 1
    print(n)

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

if n != 2:
    if n % 2 == 0:
        n += 1
    for p in range(n, 10**5, 2):
        if is_prime(p):
            print(p)
            break
else:
    print(n)

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

Fixed submission:
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    while not is_prime(n):
        n += 1
    print(n)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

d = b - a + 1
print(math.ceil(d/2))

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

d = b - a
if d % 2 == 0:
    print(d//2)
else:
    f = min(a - 1, n - b) + d//2 + 1
    print(f)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
total_breaks = 0
position = 0
for i in range(1, n + 1):
    try:
        breaks = a[position::].index(i)
        total_breaks += breaks
        position = position + breaks + 1
    except ValueError:
        if position == 0:
            total_breaks = -1
            break
        else:
            total_breaks = total_breaks + n - position
            break
print(total_breaks)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
total_breaks = 0
position = 0
for i in range(1, n + 1):
    try:
        next_position = a.index(i, position)
        if next_position < position:
            total_breaks = total_breaks + n - position
            break
        total_breaks = total_breaks + next_position - position
        position = next_position + 1
    except ValueError:
        if position == 0:
            total_breaks = -1
            break
        else:
            total_breaks = total_breaks + n - position
            break
print(total_breaks)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
total_breaks = 0
position = 0
for i in range(1, n + 1):
    try:
        breaks = a[position::].index(i)
        total_breaks += breaks
        position = position + breaks + 1
    except ValueError:
        if position == 0:
            total_breaks = -1
            break
        else:
            total_breaks = total_breaks + n - position
            break
print(total_breaks)

Fixed submission:
n = int(input())

ans = 0
if n % 2 != 0:
    print(0)
else:
    n //= 10
    while n > 0:
        ans += n
        n //= 5
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=int(int(N*100/108)*1.08)
print([':(',d][X==N])

Fixed submission:
N=int(input())
X=int(N*100/108)
print(X if int(X*1.08)==N else X+1 if int((X+1)*1.08)==N else ':(')

Buggy python submission (verdict: Runtime Error):
n=int(input())
d,m=divmod(n,1.08)
print[':(',d][m==0 or m<=0.5])

Fixed submission:
N=int(input())
X=int(N*100/108)
print(X if int(X*1.08)==N else X+1 if int((X+1)*1.08)==N else ':(')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
count=0
for i in range(1000):
    p=str(int(i/100))+str(int(i/10%10))+str(int(i%10))
    l=0
    for j in range(N):
        if S[j]==p[l]:
            l+=1
        if l==3:
            count+=1
            break
print(count)

Fixed submission:
N=int(input())
S=input()
count=0
for i in range(1000):
    p='0'*(3-len(str(i)))+str(i)
    p1=S.find(p[0])
    if p1!=-1:
        p2=S[p1+1:].find(p[1])
        if p2!=-1:
            p3=S[p1+p2+2:].find(p[2])
            if p3!=-1:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
key=set()
for i in range(N):
    if i>0 and S[i-1]==S[i]:
        continue
    for j in range(i+1, N):
        if j>i+1 and S[j-1]==S[j]:
            continue
        for k in range(j+1, N):
            if k>j+1 and S[k-1]==S[k]:
                continue
            key.add(S[i]+S[j]+S[k])
print(len(key))

Fixed submission:
N=int(input())
S=input()
count=0
for i in range(1000):
    p='0'*(3-len(str(i)))+str(i)
    p1=S.find(p[0])
    if p1!=-1:
        p2=S[p1+1:].find(p[1])
        if p2!=-1:
            p3=S[p1+p2+2:].find(p[2])
            if p3!=-1:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
key=set()
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            key.add(S[i]+S[j]+S[k])
print(len(key))

Fixed submission:
N=int(input())
S=input()
count=0
for i in range(1000):
    p='0'*(3-len(str(i)))+str(i)
    p1=S.find(p[0])
    if p1!=-1:
        p2=S[p1+1:].find(p[1])
        if p2!=-1:
            p3=S[p1+p2+2:].find(p[2])
            if p3!=-1:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
key=set()
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            key.add(S[i]+S[j]+S[k])
print(len(key))

Fixed submission:
N=int(input())
S=input()
count=0
for i in range(1000):
    p='0'*(3-len(str(i)))+str(i)
    p1=S.find(p[0])
    if p1!=-1:
        p2=S[p1+1:].find(p[1])
        if p2!=-1:
            p3=S[p1+p2+2:].find(p[2])
            if p3!=-1:
                count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
def getN():
    return int(input())

def gcd(p, q):
    if p % q == 0: return q
    return gcd(q, p % q)

def main():
    
    K = getN()

    result = 0

    for i in range(1,K+1):
        for j in range(1,K+1):
            for k in range(1,K+1):
                result += gcd(gcd(i,j),k)
    
    print(result)

    return

if __name__ == "__main__":
    main()

Fixed submission:
def getN():
    return int(input())

# def gcd(p, q):
#     if p % q == 0: return q
#     return gcd(q, p % q)

def gcd(p, q):
    while q != 0:
        r = p % q
        p = q
        q = r
    return p

def main():
    
    K = getN()

    result = 0

    for i in range(1,K+1):
        for j in range(1,K+1):
            for k in range(1,K+1):
                result += gcd(gcd(i,j),k)
    
    print(result)

    return

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
from functools import reduce
def getN():
    return int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def main():
    
    K = getN()

    result = 0

    for i in range(1,K+1):
        for j in range(1,K+1):
            for k in range(1,K+1):
                result += gcd(i,j,k)
    
    print(result)

    return

if __name__ == "__main__":
    main()

Fixed submission:
def getN():
    return int(input())

# def gcd(p, q):
#     if p % q == 0: return q
#     return gcd(q, p % q)

def gcd(p, q):
    while q != 0:
        r = p % q
        p = q
        q = r
    return p

def main():
    
    K = getN()

    result = 0

    for i in range(1,K+1):
        for j in range(1,K+1):
            for k in range(1,K+1):
                result += gcd(gcd(i,j),k)
    
    print(result)

    return

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l = 2*math.sqrt(a*b)
r = c - a - b

lint = int(l)

rl = r-l

# print(str(l) + " " + str(r))

# print(str(l-float(lint)) + " " + str(rl))

# print(math.isclose(0,rl))
if  math.isclose(0,rl)==True:
    print("Yes")
elif 0 < rl:
    print("Yes")
else:
    print("No")




Fixed submission:
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l2  = 4 * a * b
r = c - a - b
r2 = r * r

# if l2 < r2:
#     print("Yes")
# else:
#     print("No")

if r > 0 :
    if l2 < r2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l = 2*math.sqrt(a*b)
r = c - a - b

lint = int(l)

rl = r-l

# print(str(l) + " " + str(r))

# print(str(l-float(lint)) + " " + str(rl))

# print(math.isclose(0,rl))
if  math.isclose(0,rl):
    print("Yes")
elif 0 < rl:
    print("Yes")
else:
    print("No")




Fixed submission:
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l2  = 4 * a * b
r = c - a - b
r2 = r * r

# if l2 < r2:
#     print("Yes")
# else:
#     print("No")

if r > 0 :
    if l2 < r2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l = 2*math.sqrt(a*b)
r = c - a - b

lint = int(l)

rl = r-l

# print(str(l) + " " + str(r))

# print(str(l-float(lint)) + " " + str(rl))

# print(math.isclose(0,rl))

if 0 < rl or math.isclose(0,rl):
    print("Yes")
else:
    print("No")




Fixed submission:
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l2  = 4 * a * b
r = c - a - b
r2 = r * r

# if l2 < r2:
#     print("Yes")
# else:
#     print("No")

if r > 0 :
    if l2 < r2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l = 2*math.sqrt(a*b)
r = c - a - b

lint = int(l)

rl = r-l

# print(str(l) + " " + str(r))

# print(str(l-float(lint)) + " " + str(rl))

if 0 < rl or math.isclose(0,rl):
    print("Yes")
else:
    print("No")




Fixed submission:
import math

ABC = input().split()

a = int(ABC[0])
b = int(ABC[1])
c = int(ABC[2])
#a = b = c = pow(10,9)

l2  = 4 * a * b
r = c - a - b
r2 = r * r

# if l2 < r2:
#     print("Yes")
# else:
#     print("No")

if r > 0 :
    if l2 < r2:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

N = int(input())

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

if D[0] != 0 or D.count(0) !=1:
    print("0")
    exit()

D.sort()
#D = D[1:]
m = max(D)
counted = []

for i in range(1,m):
    c = D.count(i)
    if c != 0:
        counted.append(c)

#calc
result = 1
x = counted[0]
for i in range(1,len(counted)):
    y = counted[i]
    result = result * pow(x,y)
    x = y
print(result%998244353)


Fixed submission:
import collections
N = int(input())

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

counted = collections.Counter(D)

if D[0] != 0 or counted[0] !=1:
    print("0")
    exit()

#calc
result = 1
x = counted[1]
for i in range(2,N+1):
    y = counted[i]
    result = result * pow(x,y) %998244353
    x = y
print(result)

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())

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

if D[0] != 0 or D.count(0) !=1:
    print("0")
    exit()

D.sort()
counted = []

for i in range(1,N):
    c = D.count(i)
    if c != 0:
        counted.append(c)

#calc
result = 1
x = counted[0]
for i in range(1,len(counted)):
    y = counted[i]
    result = result * pow(x,y)
    x = y
print(result%998244353)





Fixed submission:
import collections
N = int(input())

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

counted = collections.Counter(D)

if D[0] != 0 or counted[0] !=1:
    print("0")
    exit()

#calc
result = 1
x = counted[1]
for i in range(2,N+1):
    y = counted[i]
    result = result * pow(x,y) %998244353
    x = y
print(result)

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())

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

if D[0] != 0 or D.count(0) !=1:
    print("0")
    exit()

D.sort()
D = D[1:]
m = max(D)

#calc
result = 1
x = D.count(1)
D = D[x:]
for i in range(2,m+1):
    y = D.count(i)
    D = D[y:]
    if y!= 0:
        result = result * pow(x,y)
        x = y
print(result%998244353)





Fixed submission:
import collections
N = int(input())

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

counted = collections.Counter(D)

if D[0] != 0 or counted[0] !=1:
    print("0")
    exit()

#calc
result = 1
x = counted[1]
for i in range(2,N+1):
    y = counted[i]
    result = result * pow(x,y) %998244353
    x = y
print(result)

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())

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

if D[0] != 0 or D.count(0) !=1:
    print("0")
    exit()

m = max(D)

#calc
result = 1
x = D.count(1)
for i in range(2,m+1):
    y = D.count(i)
    if y!= 0:
        result = result * pow(x,y)
        x = y
print(result%998244353)





Fixed submission:
import collections
N = int(input())

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

counted = collections.Counter(D)

if D[0] != 0 or counted[0] !=1:
    print("0")
    exit()

#calc
result = 1
x = counted[1]
for i in range(2,N+1):
    y = counted[i]
    result = result * pow(x,y) %998244353
    x = y
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
K = int(input())

a = S[K]-1

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))

Fixed submission:
N = int(input())
S = list(input())
K = int(input())

a = S[K-1]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
K = int(input())

a = S[K]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))

Fixed submission:
N = int(input())
S = list(input())
K = int(input())

a = S[K-1]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0 for i in range(0,N)]
for i in range(0,len(A)):
    B[A[i]-1] += 1
for j in range(0,len(B)):
    print(B[j])
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
p = list(map(int,input().split()))
E = []
for i in range(0,len(p)):
    E.append((p[i]+1)/2)
def maxexp(p,E,K):
    s = 0
    for i in range(0,len(p)-K+1):
        t = 0
        for j in range(0,K):
            t = t + E[i+j]
        s = max(s,t)
    return s
print(maxexp(p,E,K))

Fixed submission:
N,K = map(int,input().split())
p = list(map(int,input().split()))
def maxexp(p,K):
    s = 0 
    for i in range(0,K):
        s = s + p[i]
        t = s
    for j in range(0,len(p)-K):
        s = s - p[j] + p[j+K]
        t = max(s,t)
    return (t+K)/2
print(maxexp(p,K))
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())
import math
def lcm(A,B):
    return (A * B) // math.gcd(A, B)
print(lcm(A,B))

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

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

Fixed submission:
A, B = map(int,input().split())
import fractions
def lcm(A,B):
    return (A * B) // fractions.gcd(A, B)
print(lcm(A,B))
Buggy python submission (verdict: Runtime Error):
from math import sqrt
# map(int,input().split())
a,b,c = map(int,input().split())
if 4*a*b < (c-a-b)*(c-a-b):
  print("Yes")
else if 4*a*b >= (c-a-b)*(c-a-b):
  print("No")
else:
  print("Yes")

Fixed submission:
from math import sqrt
# map(int,input().split())
a,b,c = map(int,input().split())
if (c-a-b>0)and(4*a*b < (c-a-b)*(c-a-b)):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
R,C = map(int,input().split())
graph = [[i for i in input()] for j in range(R)]
visited = [[False for i in range(C)] for j in range(R)]

def dfs(start_y,start_x,goal_y,goal_x):
  queue = [[start_y,start_x,0]]
  while queue:
    now = queue.pop(0)
    visited[now[0]][now[1]] = True
    if now[0]==goal_y and now[1]==goal_x: return now[2]
    for next in [[1,0],[-1,0],[0,1],[0,-1]]:
      if now[0]+next[0] < 0 or now[1]+next[1] < 0: continue
      if now[0]+next[0] > R-1 or now[1]+next[1] > C-1: continue
      if visited[now[0]+next[0]][now[1]+next[1]]: continue
      if graph[now[0]+next[0]][now[1]+next[1]]=='#': continue
      queue.append([now[0]+next[0],now[1]+next[1],now[2]+1])
      visited[now[0]+next[0]][now[1]+next[1]] = True

ans = 0
for row_s in range(R):
  for column_s in range(C):
    for row_g in range(R):
      for column_g in range(C):
        if graph[row_s][column_s]=='#' or graph[row_g][column_g]=='#': continue
        visited = [[False for i in range(C)] for j in range(R)]
        ans = max(ans,dfs(row_s,column_s,row_g,column_g))
    
print(ans)

Fixed submission:
R,C = map(int,input().split())
graph = [[i for i in input()] for j in range(R)]
visited = [[False for i in range(C)] for j in range(R)]

def dfs(start_y,start_x):
  queue = [[start_y,start_x,0]]
  while queue:
    now = queue.pop(0)
    visited[now[0]][now[1]] = True
    for next in [[1,0],[-1,0],[0,1],[0,-1]]:
      if now[0]+next[0] < 0 or now[1]+next[1] < 0: continue
      if now[0]+next[0] > R-1 or now[1]+next[1] > C-1: continue
      if visited[now[0]+next[0]][now[1]+next[1]]: continue
      if graph[now[0]+next[0]][now[1]+next[1]]=='#': continue
      queue.append([now[0]+next[0],now[1]+next[1],now[2]+1])
      visited[now[0]+next[0]][now[1]+next[1]] = True
  return now[2]

ans = 0
for row_s in range(R):
  for column_s in range(C):
      if graph[row_s][column_s]=='#': continue
      visited = [[False for i in range(C)] for j in range(R)]
      ans = max(ans,dfs(row_s,column_s))
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2:
  print("0")
else:
  ans = 0
  i = 1
  while True:
    ans += N // (10*i)
    i *= 5
    if i > N:break
      
print(ans)

Fixed submission:
N = int(input())

if N%2:
  print("0")
else:
  ans = 0
  i = 1
  while True:
    ans += N // (10*i)
    i *= 5
    if i > N:break
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
import numpy as np
A = [i for i in map(int,input().split())]
A = np.array(A)

for i in range(M):
  index = np.argmax(A)
  A[index] //= 2
  
print(np.sum(A))

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
n = int(inupt())
print(n**3)

Fixed submission:
n = int(input())
print(n**3)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
print(sum([i for i in range(1,n)]))

Fixed submission:
n = int(input())-1
print(n*(n+1)//2)