Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import itertools

n = int(input())
x = [list(map(int, input().split())) for i in range(n)]

res = 0
cnt = 0
for v in itertools.permutations(x):
  for i in range(n-1):
    res += np.linalg.norm(np.array(v[i+1])-np.array(v[i]))
  cnt += 1

print((res+0.0)/cnt)


Fixed submission:
import math
import itertools

n = int(input())
x = [list(map(int, input().split())) for i in range(n)]

res = 0
cnt = 0
for v in itertools.permutations(x):
  for i in range(n-1):
    res += math.sqrt((v[i+1][0] - v[i][0]) ** 2 + (v[i+1][1] - v[i][1]) ** 2)
  cnt += 1

print((res+0.0)/cnt)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import itertools

n = map(int, input().split())
x = [list(map(int,input().split())) for i in range(n)]

res = 0
cnt = 0
for v in itertools.permutations(x):
  a = numpy.array(v[0])
  b = numpy.array(v[1])
  res += np.linalg.norm(b-a)
  cnt += 1

print((res+0.0)/cnt)

Fixed submission:
import math
import itertools

n = int(input())
x = [list(map(int, input().split())) for i in range(n)]

res = 0
cnt = 0
for v in itertools.permutations(x):
  for i in range(n-1):
    res += math.sqrt((v[i+1][0] - v[i][0]) ** 2 + (v[i+1][1] - v[i][1]) ** 2)
  cnt += 1

print((res+0.0)/cnt)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import itertools

n = map(int, input().split())
x = [list(map(int,input().split())) for i in range(n)]

res = 0
for v in itertools.combinations(x, 2):
  a = numpy.array(v[0])
  b = numpy.array(v[1])
  res += np.linalg.norm(b-a)

print(res)

Fixed submission:
import math
import itertools

n = int(input())
x = [list(map(int, input().split())) for i in range(n)]

res = 0
cnt = 0
for v in itertools.permutations(x):
  for i in range(n-1):
    res += math.sqrt((v[i+1][0] - v[i][0]) ** 2 + (v[i+1][1] - v[i][1]) ** 2)
  cnt += 1

print((res+0.0)/cnt)
Buggy python submission (verdict: Runtime Error):
s = input()
ans = [0]*(len(s)+1)

for i in range(len(s):
    if s[i] == '<':
        ans[i+1] = ans[i] + 1
for i in range(len(s)-1,-1,-1):
    if s[i] == '>':
        ans[i] = max(ans[i], ans[i+1] + 1)
print(sum(ans))


Fixed submission:
s = input()
ans = [0]*(len(s)+1)

for i in range(len(s)):
    if s[i] == '<':
        ans[i+1] = ans[i] + 1
for i in range(len(s)-1,-1,-1):
    if s[i] == '>':
        ans[i] = max(ans[i], ans[i+1] + 1)
print(sum(ans))
Buggy python submission (verdict: Runtime Error):
l = ["Sunny", "Cloudy", "Rain"]
s = input()
print(l[(l.index(s)+1)%3])

Fixed submission:
l = ["Sunny", "Cloudy", "Rainy"]
s = input()
print(l[(l.index(s)+1)%3])

Buggy python submission (verdict: Runtime Error):
t = ("Sunny", "Cloudy", "Rain")
s = input()
print(t(t.index(s)+1)%3))

Fixed submission:
l = ["Sunny", "Cloudy", "Rainy"]
s = input()
print(l[(l.index(s)+1)%3])
Buggy python submission (verdict: Runtime Error):
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in s:
  if i == 'U' or i == 'D':
    continue
  else:
    if i%2 == 0:
      if i != 'L':
        print("No")
        exit()
    else:
      if i != 'R':
        print("No")
        exit()
print("Yes")

Fixed submission:
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in range(len(s)):
  if s[i] == 'U' or s[i] == 'D':
    continue
  else:
    if i%2 != 0:
      if s[i] != 'L':
        print("No")
        exit()
    else:
      if s[i] != 'R':
        print("No")
        exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
s=list(input())
cnt=0
now=''
for i in range(len(s)):
    now+=s[i]
    if buf!=now:
        buf=now
        now=''
        cnt+=1
print(cnt)


Fixed submission:
s=list(input())
cnt=0
now=''
buf=''
for i in range(len(s)):
    now+=s[i]
    if buf!=now:
        buf=now
        now=''
        cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
s=list(input())
res=1
tmp = ''
bef = s[0]
for i in range(1,len(s)):
    tmp.join(s[i])
    if bef != tmp:
        cnt += 1
        bef = tmp
        tmp = ''
print(cnt)


Fixed submission:
s=list(input())
cnt=0
now=''
buf=''
for i in range(len(s)):
    now+=s[i]
    if buf!=now:
        buf=now
        now=''
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    
    from collections import Counter
    c = Counter(s)
    res = 0
    for i in c.values:
        if i < 2:
            continue
        else:
            res += i * (i-1) // 2
    print(res)
    
if __name__ == '__main__':
    main()
                

Fixed submission:
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    
    from collections import Counter
    c = Counter(s)
    res = 0
    for i in c.values():
        if i < 2:
            continue
        else:
            res += i * (i-1) // 2
    print(res)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    ss = set(s)
    res = 0
    if len(s) == len(ss):
        print(0)
        return
    for i in ss:
        cnt = s.count(i) - 1
        res += (cnt+1)*cnt//2
    print(res)
    
if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    
    from collections import Counter
    c = Counter(s)
    res = 0
    for i in c.values():
        if i < 2:
            continue
        else:
            res += i * (i-1) // 2
    print(res)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    ss = set(s)
    res = 0
    for i in ss:
        cnt = s.count(i) - 1
        res += (cnt+1)*cnt//2
    print(res)
    
if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n = int(input())
    s = ["".join(sorted(input())) for i in range(n)]
    
    from collections import Counter
    c = Counter(s)
    res = 0
    for i in c.values():
        if i < 2:
            continue
        else:
            res += i * (i-1) // 2
    print(res)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-B) # b:asc, -b:desc
    
    res = 0
    q = 0
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) < 0:
            res += heappop(q) * -1 # -r -> r
    print(res)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-b) # b:asc, -b:desc
    
    res = 0
    q = []
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) > 0:
            res += heappop(q) * -1 # -b -> b
    print(res)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[d-1].append(-r) # r:asc, -r:desc
    
    res = 0
    q = 0
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) < 0:
            res += heappop(q) * -1 # -r -> r
    print(res)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-b) # b:asc, -b:desc
    
    res = 0
    q = []
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) > 0:
            res += heappop(q) * -1 # -b -> b
    print(res)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(input()) for i in range(n)]

    for i in range(n):
        res = a[:i] + a[i+1:]
        print(max(res))

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n = int(input())
    a = [int(input()) for i in range(n)]
    b = sorted(a, reverse=True)

    for i in range(n):
        if a[i] == b[0]:
            print(b[1])
        else:
            print(b[0])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    l, r = map(int, input().split())

    res = 2018
    for i in range(l, r):
        for j in range(l+1, r+1):
            mod = (i*j)%2019
            if mod < res:
                res = mod
            if res == 0:
                break
        else:
            continue
        
    print(res)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    l, r = map(int, input().split())

    res = 2018
    for i in range(l, r):
        for j in range(l+1, r+1):
            mod = (i*j)%2019
            if mod < res:
                res = mod
            if res == 0:
                break
        else:
            continue
        break
        
    print(res)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    l, r = map(int, input().split())

    res = 2018
    for i in range(l, r):
        for j in range(l+1, r+1):
            mod = (i*j)%2019
            if mod < res:
                res = mod
            if res == 0:
                break
    print(res)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    l, r = map(int, input().split())

    res = 2018
    for i in range(l, r):
        for j in range(l+1, r+1):
            mod = (i*j)%2019
            if mod < res:
                res = mod
            if res == 0:
                break
        else:
            continue
        break
        
    print(res)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = list(input())
if len(set(a)) != 2:
  print("No")
else:
  print("Yes")


Fixed submission:
s = input()
if len(set(s)) != 2:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
l = list(input())
l[k] = str.lower(l[k])
print("".join(l))

Fixed submission:
n, k = map(int, input().split())
s = input()
l = list(s)
l[k-1] = str.lower(l[k-1])
print("".join(l))
Buggy python submission (verdict: Runtime Error):
def main():
    n,k = map(int,input().split())
    s = input()

    res = []
    buf = '1' # start:1 kara NG->s[0]
    cnt = 0
    for i in range(n):
        if s[i] == buf:
            cnt += 1
        else:
            res.append(cnt)
            buf = s[i]
            cnt = 1
    if cnt != 0:
        res.append(cnt)

    if len(res)%2 == 0:
        res.append(0) # end:1 no kosu

    #from itertools import accumulate
    #rui = list(accumulate(res))
    rui = [0]*(len(res)+1)
    for i in range(len(rui)-1):
        rui[i+1] = rui[i] + res[i]

    for i in range(0,len(res),2): # 1 only
        left = i
        right = min(i+2*k+1, len(res))
        tmp = rui[right] - rui[left]
        ans = max(tmp,ans)
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n,k = map(int,input().split())
    s = input()

    res = []
    buf = '1' # start:1 kara NG->s[0]
    cnt = 0
    for i in range(n):
        if s[i] == buf:
            cnt += 1
        else:
            res.append(cnt)
            buf = s[i]
            cnt = 1
    if cnt != 0:
        res.append(cnt)

    if len(res)%2 == 0:
        res.append(0) # end:1 no kosu

    #from itertools import accumulate
    #rui = list(accumulate(res))
    rui = [0]*(len(res)+1)
    for i in range(len(rui)-1):
        rui[i+1] = rui[i] + res[i]

    ans = 0
    for i in range(0,len(res),2): # 1 only
        left = i
        right = min(i+2*k+1, len(res))
        tmp = rui[right] - rui[left]
        ans = max(tmp,ans)
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a=[int(input()) for _ in [0]*5]
b=[-(-a//10)*10-i for i in a]
print(sum(b)+sum(a)-max(b))

Fixed submission:
a=[int(input()) for _ in [0]*5]
b=[-(-i//10)*10-i for i in a]
print(sum(b)+sum(a)-max(b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
if s.count('R') > s.count('B'):
    print('Yes')
else:
    pritn('No')

Fixed submission:
n=int(input())
s=list(input())
if s.count('R') > s.count('B'):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
def main():
    dic = {'A':'T', 'T':'A', 'G':'T', 'T':'G'}
    b = input()
    print(dic[b])
    
if __name__ == '__main__':
    main()


Fixed submission:
def main():
    dic = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}
    b = input()
    print(dic[b])
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
count=[0]*n

for i in range(1,n):
  count[i] += count[i-1]
  if s[i-1:i+1]=="AC":
    count[i]+=1
for i in range(q):
  l,r=map(int,input().split())
  print(count([r-1]-count[l-1])

Fixed submission:
N,Q=map(int,input().split())
S=input()
count=[0]*N
for i in range(1,N):
    count[i]+=count[i-1]
    if S[i-1:i+1]=="AC":count[i]+=1
for i in range(Q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
Buggy python submission (verdict: Runtime Error):
def main():
    import sys
    input = sys.stdin.readline

    s = input()
    if int(s.strip("'")) < 20190430:
        print('Heisei')
    else:
        print('TBD')
    
if __name__ == '__main__':
    main()



Fixed submission:
def main():
    #import sys
    #input = sys.stdin.readline

    s = input()
    if int(''.join(s.split('/'))) <= 20190430:
        print('Heisei')
    else:
        print('TBD')
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def ngcd(lista):
    from math import gcd
    res = lista[0]
    for i in range(1,len(lista)):
        if res != 1:
            res = gcd(lista[i],res)
    return res

def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(ngcd(a))

if __name__ == '__main__':
    main()


Fixed submission:
import functools, fractions
n=input()
a=list(map(int,input().split()))
print(functools.reduce(fractions.gcd,a))
Buggy python submission (verdict: Runtime Error):
def main():
    n,w = map(int,input().split())
    wv = [list(map(int,input().split())) for _ in range(n)]

    # min -> inf, max -> -1
    dp = [[-1]*(w+1) for _ in range(n+1)]

    # shoki joken
    dp[0] = [0]*(w+1)
    for i in range(n):
        for j in range(w+1):
            # i select or not select
            if j-wv[i][0] >= 0:
                dp[i+1][j] = max(dp[i][j],dp[i][j-w]+v)
            else:
                dp[i+1][j] = dp[i][j]

    print(max(dp[-1]))

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n,wmax = map(int,input().split())
    wv = [list(map(int,input().split())) for _ in range(n)]

    # min -> inf, max -> -1
    dp = [[-1]*(wmax+1) for _ in range(n+1)]

    # shoki joken
    dp[0] = [0]*(wmax+1)
    for i in range(n):
        w,v = wv[i]
        for j in range(wmax+1):
            # i select or not select
            if j-w >= 0:
                dp[i+1][j] = max(dp[i][j],dp[i][j-w]+v)
            else:
                dp[i+1][j] = dp[i][j]

    print(max(dp[-1]))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
z=[abs(t-x*0.006-a) for x in h]
print(x.index(min(z))+1)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
z=[abs(t-x*0.006-a) for x in h]
print(z.index(min(z))+1)
Buggy python submission (verdict: Runtime Error):
def main():
    from sys import stdin
    #r = stdin.readline()[:-1]
    r = stdin.readlines()

    if r[0] == '1':
        print('Hello World')
    else:
        print(r[1] + r[2])
   
if __name__ == '__main__':
    main()



Fixed submission:
def main():
    from sys import stdin
    #r = stdin.readline()[:-1]
    n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    if n == 1:
        print('Hello World')
    else:
        r = [int(stdin.readline()) for i in range(n)]
        print(r[0] + r[1])
   
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    v = list(map(int,input().split()))

    from collections import Counter
    a = Counter(v[::2]).most_common()
    b = Counter(v[1::2]).most_common()

    if a[0][0] != b[0][0]:
        print(n-(a[0][1]+b[0][1]))
    else:
        print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1])))
 
if __name__ == '__main__':
    main()




Fixed submission:
from collections import Counter
n=int(input())
v=list(map(int,input().split()))
a=Counter(v[0::2]).most_common()
b=Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])
if a[0][0]!=b[0][0]:
    print(n-(a[0][1]+b[0][1]))
else:
    print(min(n-(a[1][1]+b[0][1]),n-(a[0][1]+b[1][1])))
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
n,x=map(int,input().split())
x=[abx(x-int(i)) for i in input().split()]
print(reduce(gcd,x))

Fixed submission:
from functools import reduce
from fractions import gcd
N,X=map(int,input().split())
x=[abs(X-int(i)) for i in input().split()]
print(reduce(gcd,x))
Buggy python submission (verdict: Runtime Error):
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    r = int(r)
    if r < 1200:
        print('ABC')
    elif r < 2800
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    r = int(r)
    if r < 1200:
        print('ABC')
    elif r < 2800:
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b=15:
    print('+')
elif a*b=15:
    print('*')
else:
    print('x')

Fixed submission:
a,b=map(int,input().split())
if a+b==15:
    print('+')
elif a*b==15:
    print('*')
else:
    print('x')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
print(sume(abs(a-A[N//2]) for a in A))

Fixed submission:
N=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
print(sum(abs(a-A[N//2]) for a in A))
Buggy python submission (verdict: Runtime Error):
n=input()
print("Yes" if int(n)%sum(map(int,lsit(n)))==0 else "No")

Fixed submission:
n=input()
print("Yes" if int(n)%sum(map(int,list(n)))==0 else "No")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(input())
    x = list(map(int, input().split()))
    x2 = sorted(x)
    med = x2[(n+1)//2-1]
    for i in range(n):
        x3 = sorted(x[:i] + x[i+1:])
        print(x3[n//2-1])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(input())
    x = list(map(int, input().split()))
    x2 = sorted(x)
    med1 = x2[n//2-1]
    med2 = x2[n//2]
    for i in x:
        if i <= med1:
            print(med2)
        else:
            print(med1)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
print(sum(i==i[::-1] for i in range(int(a), int(b)+1)))

Fixed submission:
a,b=map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
from collections import Counter
n=int(input())
s=Counter
for i in range(n):
  s[input()[0]]+=1
print(sum([s[a]*s[b]*s[c] for a,b,c in combinations("MARCH",3)]))

Fixed submission:
from itertools import combinations
from collections import Counter
N=int(input())
S=Counter()
for i in range(N):
    S[input()[0]]+=1
print(sum([S[a]*S[b]*S[c] for a,b,c in combinations("MARCH",3)]))
Buggy python submission (verdict: Runtime Error):
input()
l=sorted(map(int,input().split()))[::-1]
pritn(sum(l[::2])-sum(l[1::2]))

Fixed submission:
input()
l=sorted(map(int,input().split()))[::-1]
print(sum(l[::2])-sum(l[1::2]))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
res = a+b - (c+d)
if res > 0:
  print('Left')
elif res = 0:
  print('Balanced')
else:
  print('Right')

Fixed submission:
a,b,c,d = map(int, input().split())
res = a+b - (c+d)
if res > 0:
  print('Left')
elif res == 0:
  print('Balanced')
else:
  print('Right')
Buggy python submission (verdict: Runtime Error):
s = list(int(input()))
print(sum(s))

Fixed submission:
s = list(input())
n = [int(i) for i in s]
print(sum(n))
Buggy python submission (verdict: Runtime Error):
input()
a=list(map(int,input().split()))
ans=0
while all(a%2==0 for i in A):
  A = [a/2 for a in A]
  ans += 1
print(ans)

Fixed submission:
input()
a=list(map(int,input().split()))
ans=0
while all(i%2==0 for i in a):
  a = [i/2 for i in a]
  ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n,k=map(int,input().split())
c=Counter(input().split())
pritn(sum(sorted(a.values(), reverse=True)[k:]))

Fixed submission:
from collections import Counter
n,k=map(int,input().split())
a=Counter(input().split())
print(sum(sorted(a.values(),reverse=True)[k:]))
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    f = [list(map(int,input().split())) for i in range(n)]
    p = [list(map(int,input().split())) for i in range(n)]
    bit = 1<<10 #全探索2**10
    res = -10**10
    for i in range(1,bit):
        chk = [0]*n
        cnt = 0
        for j in range(10): # 10回分有無判定
            if (i>>j)&1: # 最下位bit判定
                for k in range(n):
                    if f[k][j] == 1:
                        chk[k] += 1
        for l in range(10):
            cnt += p[l][chk[l]]
        res = max(res,cnt)
    print(res)

if __name__ == '__main__':
    main()



Fixed submission:
N=int(input())
F=[int(input().replace(' ',''),2) for i in range(N)]
P=[list(map(int,input().split())) for i in range(N)]
print(max(sum([p[bin(f&i).count('1')] for f,p in zip(F,P)]) for i in range(1,2**10)))