Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03290 (python)

Fixed submission:
n,k = map(int,input().split())
L = []
for i in range(n):
    a,b = map(int,input().split())
    L.append([(i+1)*100,a,b])
#print(L)
ans = 10**10
if k < L[-1][0]*L[-1][1]:
    if k%L[-1][0] != 0:
        ans = (k//L[-1][0]+1)
    else:
        ans = (k//L[-1][0])

for i in range(1<<n):
    li = []
    score,score_zan,cnt = 0,0,0
    for j in range(n):
        if i>>j&1:
            score +=(L[j][0]*L[j][1] + L[j][2])
            cnt +=L[j][1]
            score_zan = k-score
        else:
            li.append(L[j])
    if score > 0 and score_zan <= 0:
        ans = min(ans,cnt)
    li.sort(reverse = True)
    #print(score,li,cnt,score_zan)
    if li and score_zan > 0:
        if score_zan < li[0][0]*li[0][1]:
            ans = min(ans,cnt + score_zan//li[0][0])
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import product
n,k = map(int,input().split())
L = []
for i in range(n):
    a,b = map(int,input().split())
    L.append([0,a,b])
for i in range(n):
    L[i][0] = 100*(i+1)
#print(L)
li = [0,1]
re = []

def cer(v):
    for i in range(n-1,0,-1):
        if v[i] == 0:
            return i
            
for v in product(li,repeat = n):
    score = 0
    scorenomi = 0
    num = 0
    for i in range(n):
        score += (L[i][0]*L[i][1] + L[i][2])*v[i]
        scorenomi +=L[i][0]*L[i][1]*v[i]
        num +=L[i][1]*v[i]
    if score < k:
        j = 1
        score2 = 0
        while j <= L[cer(v)][1]:
            score2 = L[cer(v)][0]*j
            if score + score2 >=k:
                break
            j +=1
        #print(num,i,j,num + j,score,score2,score + score2,v)
    if score+ score2 >=k:
        print(num +j)
        exit()
    re.append([score,scorenomi,num,v])
re.sort()
for i in range(len(re)):
    if re[i][0] >=k:
        print(re[i][2])
        exit()
Problem p03323 (python)

Fixed submission:
a,b = map(int,input().split())
if a<=8 and b<=8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a<=8 and b<=8:
  print("Yay!")
  else:
    print(":(")
Problem p03324 (python)

Fixed submission:
d,n = map(int,input().split())
if d == 0 and 1<=n<=99:
  print(n)
elif d == 0 and n ==100:
  print(101)
elif d == 1 and 1<=n<=99:
  print(100*n)
elif d == 1 and n ==100:
   print(101*n)
elif d == 2 and 1<=n<=99:
  print(10000*n)
elif d == 2 and n ==100:
   print(10100*n)

Buggy submission (verdict: Runtime Error):
d,n = map(int,input().split())
if d == o:
  print(n)
elif d == 1:
  print(100*n)
elif d == 2:
  print(10000*n)
Problem p03328 (python)

Fixed submission:
a,b = map(int,input().split())
print((b-a)*(b-a+1)//2-b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print((b-a)*(b-a+1)//2-b)
Problem p03341 (python)

Fixed submission:
from itertools import accumulate
n = int(input())
L = list(input())

R = L.count("E")

for i in range(n):
    if L[i] == "W":
        L[i] = 1
    elif L[i] == "E":
        L[i] = 0
liw = list(accumulate(L))

for i in range(n):
    if L[i] == 0:
        L[i] = 1
    elif L[i] == 1:
        L[i] = 0

lie = list(accumulate(L))

for i in range(n):
    lie[i] = R-lie[i]

ans = 10**10
for i in range(n):
    west_num = liw[i]
    east_num = lie[i]
    #print(west_num,east_num,L[i])
    if L[i] == 0:
        west_num =max(west_num -1,0)

    ans = min(ans,west_num+east_num)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
L = list(input())
for i in range(n):
    if L[i] == "W":
        L[i] = 0
    else:
        L[i] = 1

ans = 3*(10**5)
for i in range(1,n-1):
    Ll = np.array(L[:i])
    Lr = np.array(L[i+1:])
    Ll = np.cumsum(Ll)
    Lr = np.cumsum(Lr)
    if L[i] == 0:
        ans = min(ans,Ll[-1]+Lr[-1])
    elif L[i] == 1:
        ans = min(ans,len(Ll)-Ll[-1]+len(Lr)-Lr[-1])
    ans = min(ans,len(Ll)-Ll[-1]+Lr[-1])
print(ans)
Problem p03352 (python)

Fixed submission:
x = int(input())
li,p,ans = [],1,0

for b in range(2,int(x**0.5//1)+1):
    while b**p<=x:
        ans = max(ans,b**p)
        p += 1
        li.append(b**(p-1))
        if b**p>x:
            p = 1
            break
if x <= 3:
    print(x)
else:
    print(max(li))

Buggy submission (verdict: Runtime Error):
x = int(input())
li,p,ans = [],1,0

for b in range(2,int(x**0.5//1)+1):
    while b**p<=x:
        ans = max(ans,b**p)
        p += 1
        li.append(b**(p-1))
        if b**p>x:
            p = 1
            break
        
print(max(li))
Problem p03360 (python)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
print(2**k*max(a,b,c) + (a+b+c-max(a,b,c)))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(max(a,b,c)*2**k + (a+b+c-max(a,b,c)))
Problem p03361 (python)

Fixed submission:
H,W = map(int,input().split())
L = []
for i in range(H):
    L.append((input()))
for i in range(H):
    for j in range(W):
        if L[i][j] == "#":
            flag = False
            if i-1 >=0 and L[i-1][j] == "#":
                flag = True
            if i+1 <H and L[i+1][j] == "#":
                flag = True
            if j-1 >=0 and L[i][j-1] == "#":
                flag = True
            if j+1 <W and L[i][j+1] == "#":
                flag = True
            if flag == False:
                print("No")
                exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
L = []
for i in range(H):
    L.append((input()))
for i in range(H):
    for j in range(W):
        if L[i][j] == "#":
            flag = False
            if i-1 >=0 and L[i-1][j] == "#":
                flag = True
            if i+1 <H and L[i+1][j] == "#":
                flag = True
            if j-1 >=0 and L[i][j-1] == "#":
                flag = True
            if j+1 <W and L[i][j+1] == "#":
                flag = True
            if flag == False:
                print("No")
                exit()
if flag:
    print("Yes")
Problem p03370 (python)

Fixed submission:
a,b = map(int,input().split())
li = []
for i in range(a):
  li.append(int(input()))
sum1 = sum(li)
min1 = min(li)
b = b -sum1
print(a+ b//min1)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
li = []
for i in range(a):
  li.append(int(input())
sum1 = sum(li)
min1 = min(li)
b = b -sum1
print(a+ b//min1)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
li = []
for i in range(a):
  li.append(int(input())
sum1 = sum(li)
min1 = min(li)
b = b -sum1
print(a+ b//min1)
Problem p03385 (python)

Fixed submission:
print("Yes" if set(input()) == {"a","b","c"} else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if set(input()) == {a,b,c} else "No")
Problem p03416 (python)

Fixed submission:
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
  i = list(str(i))
  if i == i[::-1]:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
cnt = 0
for i in range(n,m+1):
  s = str(i)
  if s == s[::-1]
    cnt +=1
print(cnt)
Problem p03434 (python)

Fixed submission:
n = int(input())
li = list(map(int,input().split())) 
li.sort(reverse = True)
a,b = 0,0
while li:
    a += li.pop(0)
    if len(li) == 0:
        break
    b += li.pop(0)
print(a-b)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split())) 
li.sort(reverse = True)
a,b = 0,0
while li:
    a += li.pop(0)
    b += li.pop(0)
print(a-b)
Problem p03456 (python)

Fixed submission:
x,y = map(str,input().split())

if int(x+y)**0.5%1 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
if pow(int(a+b),0.5,1) == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(input().split())
if int(a+b)**0.5%1 == 0:
  print("Yes")
else:
  print("No")
Problem p03457 (python)

Fixed submission:
n = int(input())
t,x,y = 0,0,0

for i in range(n):
    T,X,Y = map(int,input().split())
    dt,dx,dy = T-t,abs(X-x),abs(Y-y)
    if dt - (dx + dy) < 0 or (dt - (dx + dy))%2 == 1:
        print("No")
        exit()
    t,x,y = T,X,Y

print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
li = [list(map(int,list(input().split()))) for i in range(n)]

for i in range(len(li)):
    if li[i][0] >= li[i][1] + li[i][2]:
        if (li[i][0] - (li[i][1] + li[i][2]))%2 == 0:
        flag = True
    else:
        flag = False
        break
if flag == True:
    print("Yes")
elif flag == False:
    print("No")
Problem p03478 (python)

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

ans = 0
n = str(n)
num = 1
while num <= int(n):
    sum1 = 0
    for s in str(num):
        sum1 += int(s)
        
    if a <= sum1 <= b:
        ans += num
        
    num += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
sum1 = 0
ans = 0
for i in range(1,n+1):
  for j in range(len(str(i)):
    sum1 +=str(i)[j]
  if a<= sum1 <=b:
    ans += sum1
print(ans)
Problem p03497 (python)

Fixed submission:
from collections import Counter
n,k = map(int,input().split())
L = list( map(int,input().split()))
l = len(L)
L = Counter(L)
L = sorted(list(L.most_common(k)))

ans = 0
for i in range(len(L)):
    ans += L[i][1]
if l >= ans:
    print(l - ans)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k = map(int,input().split())
L = list( map(int,input().split()))
L = np.array(L)
set1,cnt = np.unique(L,return_counts = True)
cnt1 = sorted(cnt)
print(sum(cnt1[:len(cnt1)-k]))
Problem p03502 (python)

Fixed submission:
n = str(input())
wa = ""
for i in n:
  wa += "+"+i

if int(n)%(eval(wa)) == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
n1 = list(input())
n1 = [int(x) for x in n]

num =0
for i in range(len(n1)):
  num += int(n1[i])

if int(n)%num == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
n1 = list(input())
n1 = [int(x) for x in n]

num =0
for i in range(len(n1)):
  num += int(n1[i])

if int(n)%num == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(len(n)):
  num += int(n[i])
if n%num == 0:
  print("Yes")
else:
  print("No")
Problem p03546 (python)

Fixed submission:

import numpy as np
from scipy.sparse.csgraph import floyd_warshall

h,w = map(int,input().split())
d = np.zeros((10,10))
for i in range(10):
    a = list(map(int,input().split()))
    d[i] = a
#print(d)
def WF(b):
    for k in range(10):
        for i in range(10):
            for j in range(10):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
WF(d)
#d = floyd_warshall(d)
L = []
for i in range(h):
    b = list(map(int,input().split()))
    L.append(b)
ans = 0
for i in range(h):
    for j in range(w):
        if L[i][j] == 1 or L[i][j] == -1:
            continue
        else:
            ans += d[L[i][j]][1]
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import floyd_warshall

h,w = map(int,input().split())
d = np.zeros((10,10))
for i in range(10):
    a = list(map(int,input().split()))
    d[i] = a
#print(d)
def WF(b):
    for k in range(10):
        for i in range(10):
            for j in range(10):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
WF(d)
#d = floyd_warshall(d)
L = []
for i in range(h):
    b = list(map(int,input().split()))
    L.append(b)
ans = 0
for i in range(h):
    for j in range(w):
        if L[i][j] == 1 or L[i][j] == -1:
            continue
        else:
            ans += d[L[i][j]][1]
print(int(ans))

Buggy submission (verdict: Runtime Error):
def main():
    import numpy as np

    h,w = map(int,input().split())
    d = np.zeros((10,10))
    for i in range(10):
        a = list(map(int,input().split()))
        d[i] = a
    def WF(b):
        for k in range(10):
            for i in range(10):
                for j in range(10):
                    d[i][j] = min(d[i][j],d[i][k] + d[k][j])
        return d
    WF(d)
    L = []
    for i in range(h):
        b = list(map(int,input().split()))
        L.append(b)
    ans = 0
    for i in range(h):
        for j in range(w):
            if L[i][j] == 1 or L[i][j] == -1:
                continue
            else:
                ans += d[L[i][j]][1]
    print(int(ans))

if __name__ == '__main__':
	main()
Problem p03549 (python)

Fixed submission:
a , b = map(int,input().split())
print((1900*b+(a-b)*100)*2**b)

Buggy submission (verdict: Runtime Error):
a , b = map(int,input())
print((1900*b+(a-b)*100)*2**b)
Problem p03565 (python)

Fixed submission:
a = list(input())
b = list(input())
c = len(a)
d = len(b)
if d > c:
    print("UNRESTORABLE")
    exit()
ans = []
   
for i in range(c-d+1):
    #print(a[i:i+d])
    flag = False
    for j in range(d):
        if a[i:i+d][j] == b[j] or a[i:i+d][j] == "?":
            flag = True
        else:
            flag = False
            break
    li = [] 
    if flag:
        #print(a[i:i+d])
        li = a[:i] + b + a[i+d:]
        for k in range(len(li)):
            if li[k] == "?":
                li[k] = "a"
        ans.append("".join(li))
if ans:
    ans.sort()
    print(ans[0])
else:
    print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = len(a)
d = len(b)

flag = False
for i in range(c-d+1):
    li = [0]*c
    for k in range(c):
        li[k] = a[k]
    for j in range(d):
        if b[j] == a[i+j] or a[i+j] == "?":
            flag = True
            li[i+j] = b[j]
        elif b[j] != a[i+j]:
            flag = False
            break
    else:
        continue
for i in range(c):
    if li[i] == "?":
        li[i] = "a"

if flag:
    print("".join(li))
else:
    print("UNRESTORABLE")
Problem p03575 (python)

Fixed submission:
n,m = map(int,input().split())
d = []
for i in range(m):
    a,b = map(int,input().split())
    a,b = a-1, b-1
    d.append((a,b))
#print(d)
pa = None

def root(a):
    if pa[a] == a:
        return a
    else:
        pa[a] = root(pa[a])
        return pa[a]
def is_same(a,b):
    return root(a) == root(b)
def unite(a,b):
    aa = root(a)
    bb = root(b)
    if aa == bb:
        return
    pa[aa] = bb

ans = 0
for i in range(m):
    pa = [x for x in range(n)]
    for j,v in enumerate(d):
        #(i,j,v)
        if i == j:continue
        a,b = v
        unite(a,b)
    a,b = d[i]
    if not is_same(a,b):
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from copy import deepcopy
n,m = map(int,input().split())
inf = float("inf")
L = [[inf for i in range(n)] for j in range(n)]

for i in range(m):
    a,b = map(int,input().split())
    L[a-1][b-1] = 1
    L[b-1][a-1] = 1
#print(L)
cnt = 0
for i in range(n):
    for j in range(n):
        LL = deepcopy(L)
        LL[i][j] = 0
        LL[j][i] = 0
        LL = floyd_warshall(LL)
        #print(LL)
        for k in LL:
            if inf in k:
                cnt +=1
                break
print(cnt//2)
Problem p03624 (python)

Fixed submission:
s = list(set(list(input())))
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
li = []
for i in range(len(a)):
  if a[i] not in s:
    li.append(a[i])
if len(li) == 0:
    print("None")
else:
    print(min(li))

Buggy submission (verdict: Runtime Error):
s = list(input())
al = "abcdefghijklmnopqrstuvwxyz"
al = list(al)
li = []
for i in range(len(al)):
    if (al[i] not in s):
        li.append(al[i])
        
li.sort()
print(li[0])

Buggy submission (verdict: Runtime Error):
s = list(set(list(input())))
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
li = []
for i in range(len(s)):
  if s[i] not in a:
    li.append(s[i])
print(min(li))
Problem p03633 (python)

Fixed submission:
n = int(input())

def gcd1(a,b):
  while b:
    a,b = b,a%b
  return a

def lcm1(a,b):
  return a*b//gcd1(a,b)
num = 1
for i in range(n):
    num = lcm1(num,int(input()))
print(num)

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

li = []
for i in range(n):
  li.append(int(input()))

def gcd1(a,b):
  while b:
    a,b = b,a%b
  return a

def lcm1(a,b):
  return a*b//gcd1(a,b)
num = li[0]
num = lcm1(li[0],li[1])
for i in range(2,len(li)):
    num = lcm1(num,li[i])
print(num)

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

li = []
for i in range(n):
  li.append(int(input()))

def gcd1(a,b):
  while b:
    a,b = b,a%b
  return a

def lcm1(a,b):
  return a*b//gcd1(a,b)
num = 0
num = lcm1(li[0],li[1])
for i in range(2,len(li)):
    num = lcm1(num,li[i])
print(num)
Problem p03644 (python)

Fixed submission:
n = (int(input()))
if n ==1:
    print(1)
li = []
for i in range(1,n+1):
    if i%2 == 0:
        li.append(i)

li = [bin(x) for x in li]
li = li[::-1]
for i in range(len(li)):
    
    if li[i].count(str(1)) == 1:
        a=((li[i].count(str(0)) -1))
        print(2**a)
        break

Buggy submission (verdict: Runtime Error):
n = (int(input()))
li = []
for i in range(1,n+1):
    if i%2 == 0:
        li.append(i)

li = [bin(x) for x in li]
li = li[::-1]
for i in range(len(li)):
    if li[i].count(str(1)) == 1:
        a=((li[i].count(str(0)) -1))
        break
print(2**a)
Problem p03658 (python)

Fixed submission:
n,k = map(int,input().split())
li = list(map(int,input().split()))
li.sort(reverse = True)
print(sum(li[:k]))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
li = list(map(int,input().split()))
li.sort(reverse = True)
print(sum(li[:k])
Problem p03665 (python)

Fixed submission:
n,p = map(int,input().split())
L = list(map(int,input().split()))
Le = [x for x in L if x%2 == 0]
Lo = [x for x in L if x%2 == 1]

if p == 0:
    if len(Lo) == 0:
        print(2**n)
    else:
        print(2**(n-1))
if p == 1:
    if len(Lo) == 0:
        print(0)
    else:
        print(2**(n-1))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
L = list(map(int,input().split()))
Le = [x for x in L if x%2 == 0]
Lo = [x for x in L if x%2 == 1]
#print(Le,Lo)
def nCr(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
    
if b == 0:
    ev = 0
    od = 1
    while ev <= len(Le)//2:
        ev += nCr(len(Le),ev)
        ev += 2
    while od <= len(Lo)+1:
        od += nCr(len(Lo),od)
        od += 2
elif b == 1:
    ev = 0
    od = 0
    while ev <= len(Le)//2:
        ev += nCr(len(Le),ev)
        ev += 2
    while od <= len(Lo)+1:
        od += nCr(len(Lo),od)
        od += 2
print(ev*od)
Problem p03698 (python)

Fixed submission:
s1 = list(input())
s2 = set(s1)
if len(s1) == len(s2):
  print("yes")
elif len(s1) != len(s2):
  print("no")

Buggy submission (verdict: Runtime Error):
sl = list(input())
s2 = set(s1)
if len(s1) == len(s2):
  print("yes")
elif len(s1) != len(s2):
  print("no")
Problem p03699 (python)

Fixed submission:
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
li.sort()
flag1 = False
flag2 = False
flag3 = False
if sum(li)%10 != 0:
    flag2 = True

for i in range(n):
    if (sum(li) - li[i])%10 != 0 and flag2 == False:
        flag1 = True
        break
    else:
        flag3 =True
    
if flag1:
    print (sum(li) - li[i])
elif flag2:   
    print(sum(li))
elif flag3:
    print(0)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0

while sum1%10==0:
    if L[i] %10 != 0:
        sum1 -= L[i]
        if sum1 < 0:
            sum1 = 0
            break
        if not L:
            print(0)
            exit()
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
if not L:
    print
while sum1%10==0:
    if L[i] %10 != 0:
        sum1 -= L[i]
        if sum1 < 0:
            sum1 = 0
            break
        if not L:
            print(0)
            exit()
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    if L[i] %10 != 0:
        sum1 -= L[i]
        if sum1 < 0:
            sum1 = 0
            break
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    if L[i] %10 != 0:
        sum1 -= L[i]
        sum1 = max(sum1,abs(sum1))
        break
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    if L[i] %10 != 0:
        sum1 -= L[i]
        break
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    sum1 -= L[i]
    if sum1 < 0:
        sum1 = 0
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    sum1 -= L[i]
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
i = 0
while sum1%10==0:
    sum1 -= L[i]
    i +=1
print(sum1)

Buggy submission (verdict: Runtime Error):
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
else:
    i = 0
    while sum1%10==0:
        sum1 -= L[i]
        i +=1
print(sum1)
Problem p03763 (python)

Fixed submission:
from collections import Counter
n = int(input())
L = []
for i in range(n):
    L.append(sorted(list(input())))
set1 = set(L[0])
for i in range(2,n):
    set1 = set1&set(L[i])
li = []
al = "abcdefghijklmnopqrstuvwxyz"
for s in al:
    if s in set1:
        min1 = 10 **10
        for i in range(n):
            a = Counter(L[i])
            min1 = min(min1,a[s])
        li.append((s,min1))
ans = ""
for i in range(len(li)):
    ans += li[i][0]*li[i][1]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s1 = list(input())
s2 = list(input())
s3 = list(input())

ans = ""
a = set(s1)&set(s2)&set(s3)
s1 = [x for x in s1 if x in a]
s2 = [x for x in s2 if x in a]
s3 =[x for x in s2 if x in a]
s1.sort()
s2.sort()
s3.sort()

for i in range(min(len(s1),len(s2),len(s3))):
    if s1[:i+1] == s2[:i+1] == s3[:i+1]:
        ans = "".join(s1[:i+1])
    else:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s1 = list(input())
s2 = list(input())
s3 = list(input())

ans = ""
a = set(s1)&set(s2)&set(s3)
s1 = [x for x in s1 if x in a]
s2 = [x for x in s2 if x in a]
s3 =[x for x in s2 if x in a]
s1.sort()
s2.sort()
s3.sort()
print(s1,s2,s3)
for i in range(min(len(s1),len(s2),len(s3))):
    if s1[:i+1] == s2[:i+1] == s3[:i+1]:
        ans = "".join(s1[:i+1])
    else:
        break
print(ans)
Problem p03838 (python)

Fixed submission:
x,y = map(int,input().split())

if y<x<0 or 0<y<x:
    print(abs(x-y)+2)
elif (y<x and x==0) or (y==0 and y<x):
    print(abs(x-y)+1)
elif x<=y<=0 or 0<=x<=y:
    print(abs(x-y))
elif x<0<y or y<0<x:
    print(abs(abs(x)-abs(y))+1)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())

if y<x<0 or 0<y<x:
    print(abs(x-y)+2)
elif (y<x and x=0) or (y=0 and y<x):
    print(abs(x-y)+1)
elif x<=y<=0 or 0<=x<=y:
    print(abs(x-y))
elif x<0<y or y<0<x:
    print(abs(abs(x)-abs(y))+1)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())

if y<x<0 or 0<y<x:
    print(abs(x-y)+2)
elif y<x=0 or 0=y<x:
    print(abs(x-y)+1)
elif x<=y<=0 or 0<=x<=y:
    print(abs(x-y))
elif x<0<y or y<0<x:
    print(abs(abs(x)-abs(y))+1)