Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A={str(n+1):a for n,a in zip(range(int(input())),input().split())}
print(" ".join(sorted(A.items(),key=lambda x:x[1])[i][0] for i in len(A)))

Fixed submission:
A=dict(zip(range(1,int(input())+1),list(map(int,input().split()))))
B=sorted(A.items(),key=lambda x:x[1])
for b in B:
    print(b[0],end=" ")
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(map(int,input().split()))
S.sort()
S.reverse()
p = [S.pop(0)]
c = S
f = False

for i in range(N):
    np = []
    nc = []
    for j in range(len(p)):
        for k in range(len(c)):
            if c[k] < p[j]:
                np.append(c.pop(k))
                f = True
                break
        if f == False:
            print("No")
            exit(0)
        f = False
    print(np)
    p += np
    p.sort()
    p.reverse()

print("Yes")

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
N=input()
print(N*(N-1)/2)

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

Buggy python submission (verdict: Time Limit Exceeded):
print(sum(range(int(input()))))

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split)
print(max(A+B, A-B, A*B))

Fixed submission:
A, B = map(int, input().split())
print(max(A+B, A-B, A*B))
Buggy python submission (verdict: Runtime Error):
num = input()

result = 0

if len(num) != 1:
  result = int((len(num)-2)//2 * ("90") + "9")

if len(num) % 2 == 0:
  print(result)
else:
  AAA = int("1" + (len(num) - 1) * "0") - 1
  print(result + int(num) - AAA)

Fixed submission:
strList = input().split()
A, B, C = [int(s) for s in strList]

if (A - B) >= C:
    print(0)
elif A - B < C:
    print(C - A + B)
Buggy python submission (verdict: Runtime Error):
import fractions import *
N,X0=map(int,input().split())
X=list(map(int,input().split()))
ans=abs(X[0]-X0)
for i in range(1,N):
    ans=gcd(ans,abs(X[i]-X0))
print(ans)

Fixed submission:
import fractions
N,X0=map(int,input().split())
X=list(map(int,input().split()))
X_=[]
ans=abs(X[0]-X0)
for i in range(1,N):
    ans=fractions.gcd(ans,abs(X[i]-X0))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N,X0=map(int,input().split())
X=list(map(int,input().split()))
X_=[]
ans=abs(X[0]-X0)
for i in range(1,N):
    ans=math.gcd(ans,abs(X[i]-X0))
print(ans)

Fixed submission:
import fractions
N,X0=map(int,input().split())
X=list(map(int,input().split()))
X_=[]
ans=abs(X[0]-X0)
for i in range(1,N):
    ans=fractions.gcd(ans,abs(X[i]-X0))
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

c = 0
for s in S:
    if s == "1":
        c += 1
    else:
        break

print(S[c])

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

c = 0
for s in S:
    if s == "1":
        c += 1
    else:
        break

print(1 if K <= c else S[c])

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

c = -1
for s in S:
    if s == "1":
        c += 1
    else:
        break

print(1 if K < c else S[c+1])

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

c = 0
for s in S:
    if s == "1":
        c += 1
    else:
        break

print(1 if K <= c else S[c])
Buggy python submission (verdict: Runtime Error):
def sigma4jou(k):
    total = 0
    for i in range(k):
        total += 4 ** (i)
    return(total)

def pketa(N):
    k = 1
    while N - sigma4jou(k) > 0:
        k += 1
    return(2 * k - 1)

def mketa(N):
    k = 1
    while N + 2 * sigma4jou(k) < 0:
        k += 1
    return(2 * k)

def getResult(N):
    result = ""
    if N == 0:
        result += "0"
    elif N > 0:
        k = pketa(N)
        for i in range(k, 0, -2):
            j = int((i+1)/2)
            if abs((sigma4jou(j) - N) // (2 ** (i-1))) % 2 == 0:
                result += "1"
            else:
                result += "0"
            if i > 1:
                if abs(((sigma4jou(j) - N)) // (2 ** (i-2))) % 2 == 1:
                    result += "1"
                else:
                    result += "0"
    elif N < 0:
        k = mketa(N)
        for i in range(k, 0, -2):
            j = int(i/2)
            if abs((N + 2 * sigma4jou(j)) // (2 ** (i-1))) % 2 == 0:
                result += "1"
            else:
                result += "0"
            if i > 1:
                if abs(((N + 2 * sigma4jou(j))) // (2 ** (i-2))) % 2 == 1:
                    result += "1"
                else:
                    result += "0"
    return(result)

N = input()
print(getResult(N))

Fixed submission:
def sigma4jou(k):
    total = 0
    for i in range(k):
        total += 4 ** (i)
    return(total)

def pketa(N):
    k = 1
    while N - sigma4jou(k) > 0:
        k += 1
    return(2 * k - 1)

def mketa(N):
    k = 1
    while N + 2 * sigma4jou(k) < 0:
        k += 1
    return(2 * k)

def getResult(N):
    result = ""
    if N == 0:
        result += "0"
    elif N > 0:
        k = pketa(N)
        for i in range(k, 0, -2):
            j = int((i+1)/2)
            if abs((sigma4jou(j) - N) // (2 ** (i-1))) % 2 == 0:
                result += "1"
            else:
                result += "0"
            if i > 1:
                if abs(((sigma4jou(j) - N)) // (2 ** (i-2))) % 2 == 1:
                    result += "1"
                else:
                    result += "0"
    elif N < 0:
        k = mketa(N)
        for i in range(k, 0, -2):
            j = int(i/2)
            if abs((N + 2 * sigma4jou(j)) // (2 ** (i-1))) % 2 == 0:
                result += "1"
            else:
                result += "0"
            if i > 1:
                if abs(((N + 2 * sigma4jou(j))) // (2 ** (i-2))) % 2 == 1:
                    result += "1"
                else:
                    result += "0"
    return(result)

N = int(input())
print(getResult(N))
Buggy python submission (verdict: Time Limit Exceeded):
def absFunc(A_, b):
    result = 0
    for a_ in A_:
        result += abs(a_ - b)
    return result
    
input()
A = list(map(int, input().split()))
A_ = []

for i, a in enumerate(A):
    A_.append(a - i - 1)

b = 0
result_o = absFunc(A_, b)
result_n = 0

while True:
    b += 1
    result_n = absFunc(A_, b)
    
    if result_n < result_o:
        result_o = result_n
        continue
    break

b = 0
while True:
    b -= 1
    result_n = absFunc(A_, b)
    
    if result_n < result_o:
        result_o = result_n
        continue
    break

print(result_o)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A_ = []
result = 0

for i, a in enumerate(A):
    A_.append(a - i - 1)

b = sorted(A_)[N//2]

for a_ in A_:
    result += abs(a_ - b)

print(result)
Buggy python submission (verdict: Runtime Error):
stri = input()
stri = stri.replace("+", "1 ").replace("-", "-1 ")
numList = [int(s) for s in stri.split()]

print(sum(intList))

Fixed submission:
stri = input()
stri = stri.replace("+", "1 ").replace("-", "-1 ")
numList = [int(s) for s in stri.split()]

print(sum(numList))
Buggy python submission (verdict: Runtime Error):
import math

 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n,m,K=IA()
a=["" for i in range(0,n)]
for i in range(0,n):
    a[i]=input()

ans=n*m+1
for k in range(0,1<<(n-1)):
    res=0
    temp=[]
    for j in range(0,(n-1)):
        if (k&(1<<(j)))!=0:
            temp.append(j)
            res+=1
    le=len(temp) 
    if le==0:
        temp.append(n-1)
        
    if temp[le-1]!=n-1:
        temp.append(n-1)
    le=len(temp) 
    #print(k)  
    #print(temp)


    
    sum1=[0 for i in range(0,11)]
    flag=0
    for j in range(0,m):
        last=0
        for t in range(0,le):
            for w in range(last,temp[t]+1):
                ## print(str(w)+" "+str(j))
                if a[w][j]=='1':
                    sum1[t]+=1
            last=temp[t]+1
            if sum1[t]>K:
                
                res+=1
                last=0
                sum1=[0 for i in range(0,11)]
                for t1 in range(0,le):
                    for w1 in range(last,temp[t1]+1):
                        if a[w1][j]=='1':
                            sum1[t1]+=1
                    if sum1[t]>K:
                        flag=1
                        res=n*m+1
                        break
                    last=temp[t]+1
                    
                break
        if flag==1:break
       
    ans=min(res,ans)
                
            
    
print(ans)
    
    
    




            



Fixed submission:
import sys,math
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
 
n,m=IA()
def f1(n):
    res=1
    for i in range(1,n+1):
        res*=i
    return res
def f(n):
    if n<2:return 0
    return f1(n)//(f1(n-2)*f1(2))

print(f(n)+f(m))
Buggy python submission (verdict: Runtime Error):
import sys,math
sys.setrecursionlimit(10**9)
import itertools
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n=int(input())
temp=[]
num=0
x=1
for i in range(1,n+1):
  x*=2
for st in itertools.permutations(a,n):
    temp.append(st)
    num+=1
    if num==x-i:break

for x in temp:
  for i in x:
    print(x[i],end="")
  print()
  


Fixed submission:
import sys,math
sys.setrecursionlimit(10**9)
import itertools
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())


n=int(input())


def dfs(s,lim):

    
    if len(s)==n:
        print(s)
    else:
        for i in range(ord('a'),ord(lim)+1):
            
            if i==ord(lim):
                dfs(s+chr(i),chr(ord(lim)+1))
            else:
                dfs(s+chr(i),lim)

dfs('','a')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict

IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n,m=IA()
a=list(IA())
ans=float(0)
for i in  range(0,n):
    if i+m>n:break
    sum1=float(0)
    for j in range(0,m):
        
        sum1+=(a[i+j]+1)/2
    #print(sum1)
    ans=max(ans,sum1)
print("%.12lf"%ans)
N=int(100005)
a=[int(0) for i in range(N)]




Fixed submission:
import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict

IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())

n,m=IA()
a=list(IA())
ans=float(0)

N=int(200005)
s=[int(0) for i in range(N)]

s[1]=a[0]
for i in  range(1,n):
    s[i+1]=s[i]+a[i]
   

    
for i in  range(1,n+1):
   

    if i+m-1>n:break
    #print(s[i+m-1]-s[i-1])
    sum1=(s[i+m-1]-s[i-1]+m)/2

    #print(sum1)
    ans=max(ans,sum1)
    
print("%.12lf"%ans)
Buggy python submission (verdict: Runtime Error):
from queue import PriorityQueue


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
ans=0
MOD = 1000000007

def dfs(u,fa,k):
    temp=k
    if(fa==0): temp-=1
    else: temp-=2
    global ans
    global MOD
    vis[u]=1
    i=0
    for  v in a[u]:
        if(vis[v]==1):continue
        ans=(ans%MOD*(temp-i)%MOD)%MOD
        
        dfs(v,u,k)
        i+=1


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

n,k = IA()
ans=k
a=[ [] for i in range(0,n+1)]
vis=[int(0) for i in range(0,n+1)]

for i in range(0,n-1):
     u,v=IA()
     a[u].append(v)
     a[v].append(u)

dfs(1,0,k)
print(ans)






Fixed submission:
from queue import PriorityQueue
import sys

sys.setrecursionlimit(10**9)

IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

ans=0
MOD = 1000000007

def dfs(u,fa,k):
    temp=k
    if(fa==0): temp-=1
    else: temp-=2
    global ans
    global MOD
    vis[u]=1
    i=0
    for  v in a[u]:
        if(vis[v]==1):continue
        ans=(ans%MOD*(temp-i)%MOD)%MOD
        dfs(v,u,k)
        i+=1


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

n,k = IA()
ans=k
a=[ [] for i in range(0,n+1)]
vis=[int(0) for i in range(0,n+1)]

for i in range(0,n-1):
     u,v=IA()
     a[u].append(v)
     a[v].append(u)

dfs(1,0,k)
print(ans)

Buggy python submission (verdict: Runtime Error):
from queue import PriorityQueue


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
ans=1
MOD = 1000000007

def dfs(u,fa,k):
    global ans
    global MOD
    vis[u]=1
    i=0
    for  v in a[u]:
        if(vis[v]==1):continue
        ans=(ans%MOD*(k-i)%MOD)%MOD
        dfs(v,u,k-2)
        i+=1


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

n,m = IA()

a=[[] for i in range(0,n+1)]
vis=[int(0) for i in range(0,n+1)]

for i in range(0,n-1):
     u,v=IA()
     a[u].append(v)
     a[v].append(u)

dfs(1,0,m)
print(ans)






Fixed submission:
from queue import PriorityQueue
import sys

sys.setrecursionlimit(10**9)

IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

ans=0
MOD = 1000000007

def dfs(u,fa,k):
    temp=k
    if(fa==0): temp-=1
    else: temp-=2
    global ans
    global MOD
    vis[u]=1
    i=0
    for  v in a[u]:
        if(vis[v]==1):continue
        ans=(ans%MOD*(temp-i)%MOD)%MOD
        dfs(v,u,k)
        i+=1


IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

n,k = IA()
ans=k
a=[ [] for i in range(0,n+1)]
vis=[int(0) for i in range(0,n+1)]

for i in range(0,n-1):
     u,v=IA()
     a[u].append(v)
     a[v].append(u)

dfs(1,0,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
#import numpy as np
n = int(input())
input = sys.stdin.readline
#a = np.array(list(map(int, input().split())))
a = list(map(int, input().split()))
for i in a:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            print('DENIED')
            exit()
print('APPROVED')

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

if a == b and b == c and c == a:
    print("No")

elif a != b and b != c and c != a:
    print("No")

else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
h, w = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(M)]

th = []

for i in p:
    for n in range(2):
        th.append(i)

print(th)

Fixed submission:
h, w = map(int, input().split())
p = [input() for i in range(h)]

for i in p:
    for n in range(2):
        print(i)
Buggy python submission (verdict: Runtime Error):
import sys


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        find = self.find(x)
        return [i for i in range(self.n) if self.find(i) == find]

    def finds(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.finds())

    def all_group_members(self):
        return {r: self.members(r) for r in self.finds()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.finds())


input = sys.stdin.readline
n, k, l = map(int, input().split())
w = [list(map(int, input().split())) for i in range(k+l)]

ro = w[:k]
ra = w[l:]
answer = ""
d = defaultdict(int)

ro_cl = UnionFind(n)
ra_cl = UnionFind(n)

for p, q in ro:
    ro_cl.union(p-1, q-1)

for p, q in ra:
    ra_cl.union(p-1, q-1)

for i in range(n):
    print(ro_cl.members(i))
    print(ra_cl.members(i))
    if i != 0:
        answer += " "
    answer += str(len([n for n in ro_cl.members(i) if n in ra_cl.members(i)]))
    # d[(ro_cl.find(i), ra_cl.find(i))] += 1

print(answer)


Fixed submission:
import sys

#Union Find

#木の根を求める
def find(x,par):
    if par[x] == x:
        return x
    else:
        return find(par[x],par)

#xとyの属する集合の併合
def unite(x,y,par,rank):
    x = find(x,par)
    y = find(y,par)
    
    if x != y:
        #xとyの属している集合が異なる時
        if rank[x] < rank[y]:
            par[x] = y
        else:
            par[y] = x
            if rank[x]==rank[y]:
                rank[x] += 1

#xとyが同じ集合に属するかの判定
def same(x,y,par):
    return find(x,par) == find(y,par)
    
input = sys.stdin.readline
n,k,L = map(int,input().split())
rpar = [] #親
tpar = []
rrank = [0]*n#木の深さ
trank= [0]*n

#初期化
for i in range(n):
    #par[i]:i rank[i]:0
    rpar.append(i)
    tpar.append(i)


for i in range(k):
    x,y = map(int,input().split())
    unite(x-1,y-1,rpar,rrank)
for i in range(L):
    x,y = map(int,input().split())
    unite(x-1,y-1,tpar,trank)

num = []
d = {}
for i in range(n):
    num.append(find(i,rpar)+find(i,tpar)*10**6)
    if num[-1] in d:
        d[num[-1]] += 1
    else:
        d[num[-1]] = 1
res = ''
for i in range(n):
    if i != 0:
        res += ' '
    
    res += str(d[num[i]])

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = {}
for _ in range(n) :
    s_sub = input()

    if s_sub in s.keys() :
        s[s_sub] += 1
    else :
        s[s_sub] = 1


s_sorted = sorted(s)

for j in s_sorted :
    if s[j] == max(s.values()):
        print(j)


Fixed submission:
n = int(input())
s = {}
for _ in range(n) :
    s_sub = input()
    if s_sub in s.keys() :
        s[s_sub] += 1
    else :
        s[s_sub] = 1


s_sorted1 = sorted(s.items(), key = lambda value: -value[1])
max = s_sorted1[0][1]
ans = []
for j,k in s_sorted1 :
    if k == max :
        ans.append(j)
    else:
        break

for x in sorted(ans):
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: int(x),input().split()))
max = 0
max_list = []

for i in range(n-k+1):
    if max < sum(p[i:i+k]) :
        max = sum(p[i:i+k])
        max_list = p[i:i+k]

e = sum(list(map(lambda x: (1+x)/2,max_list)))
print(e)

Fixed submission:
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: (int(x) + 1)/2,input().split()))
ruiseki = [0]
max = 0
for i in range(n) :
    ruiseki.append(ruiseki[i]+p[i])

for j in range(n - k + 1):
    if max < (ruiseki[j+k] - ruiseki[j]) :
        max = (ruiseki[j+k] - ruiseki[j])


print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: int(x),input().split()))
max = 0
e = list(map(lambda x: (1+x)/2,p))
for i in range(n-k+1):
    if max < sum(e[i:i+k]) :
        max = sum(e[i:i+k])

print(max)


Fixed submission:
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: (int(x) + 1)/2,input().split()))
ruiseki = [0]
max = 0
for i in range(n) :
    ruiseki.append(ruiseki[i]+p[i])

for j in range(n - k + 1):
    if max < (ruiseki[j+k] - ruiseki[j]) :
        max = (ruiseki[j+k] - ruiseki[j])


print(max)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: int(x),input().split()))
max = 0

for i in range(n-k+1):
    ans = sum(list(map(lambda x: (1+x)/2,p[i:i+k])))
    if max < ans :
        max = ans

print(max)


Fixed submission:
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: (int(x) + 1)/2,input().split()))
ruiseki = [0]
max = 0
for i in range(n) :
    ruiseki.append(ruiseki[i]+p[i])

for j in range(n - k + 1):
    if max < (ruiseki[j+k] - ruiseki[j]) :
        max = (ruiseki[j+k] - ruiseki[j])


print(max)
Buggy python submission (verdict: Runtime Error):
a,b = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')


Fixed submission:
n,m = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(lambda x: int(x),input().split()))

count = 1
frag = 0
for i in range(1,n) :
    frag = 0
    for j in range(i) :
        if p[i] > p[j] :
            frag = 1
    if frag == 0 :
        count += 1

print(count)


Fixed submission:
n = int(input())
p = list(map(lambda x: int(x),input().split()))

min_list = [p[0]]
count = 1
for i in range(1,n) :
    if p[i] < min_list[i - 1] :
        min_list.append(p[i])
    else :
        min_list.append(min_list[i - 1])

for j in range(1,n) :
    if p[j] <= min_list[j - 1] :
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(lambda x: int(x), input().split())

print(int(a * b / fractions.gcd(a, b)))

Fixed submission:
a = input()
b = input()

list = ['1','2','3']
list.remove(a)
list.remove(b)

print(list[0])
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(lambda x: int(x), input().split())

print(int(a * b / math.gcd(a, b)))


Fixed submission:
a,b = map(lambda x: int(x), input().split())
c = a
d = b
if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b

print(c*d // b)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
n = int(input())
count = 0
def f(n) :
    if n < 2 :
        return 1
    else:
        return n * f(n-2)

a = f(n)
while a % 10 == 0:
    count+= 1
    a //= 10

print(count)


Fixed submission:
n = int(input())
x = 10
count = 0
if n % 2 == 0:
    while x <= n :
        count += n // x
        x *= 5
    print(count)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
xy = []
xyz =[]
a_list = []
ans = ['None']*n
count_list = []
count = 0
for _ in range(n):
    a = int(input())
    a_list.append(a)
    for i in range(a):
        x,y = map(lambda x: int(x),input().split())
        xy.append([x,y])
    xyz.append(xy)
    xy = []
xyz_all = list(itertools.permutations(xyz))

for i in range(len(list(itertools.permutations(xyz)))):
    for j in range(n):
        for k in range(a_list[j]) :
            hoge = xyz_all[i][j][k][:]
            if ans[hoge[0]-1] == 'None':
                ans[hoge[0]-1] = hoge[1]
            elif ans[hoge[0]-1] != hoge[1]:
                count+= 1
    count_list.append(count)



if ans == [0]*n :
    print(1)
else:
    print(n - min(count_list))


Fixed submission:
import itertools


n = int(input())

all = list(itertools.product([0,1], repeat=n))
xy,xyz = [],[]
for _ in range(n):
    a = int(input())
    for i in range(a):
        x,y = map(lambda x: int(x),input().split())
        xy.append([x,y])
    xyz.append(xy)
    xy = []


test = ['None']*n
ans = []
ans_list = []
j_list = []
bool = True
hoge = 0
for i in range(len(all)):
    for j,k in enumerate(all[len(all) - 1 - i]):
        if k == 1:
            ans.append(xyz[j])
            j_list.append(j)
    ans = list(itertools.chain.from_iterable(ans))

    test = all[len(all) - 1 - i]
    for x in range(len(ans)):
        if test[ans[x][0]-1] != ans[x][1]:
            bool = False
            break

    if bool :
        hoge = all[len(all) - 1 - i]
        break
    bool = True
    test = ['None']*n
    ans = []
    j_list = []
print(sum(hoge))
Buggy python submission (verdict: Runtime Error):
a, b =  (int(x) for x in input.split())
 
if a > 9 or b > 9 :
  print('-1')
else :
  print(a*b)

Fixed submission:
a, b =  (int(x) for x in input().split())
if a > 9 or b > 9 :
  print('-1')
else :
  print(a*b)

Buggy python submission (verdict: Runtime Error):
a, b =  (int(x) for x in input.split())

if a > 9 or b > 9 :
  print(-1)
else :
  print(a*b)


Fixed submission:
a, b =  (int(x) for x in input().split())
if a > 9 or b > 9 :
  print('-1')
else :
  print(a*b)