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

Fixed submission:
#!/usr/bin/env python

import sys

def DBsearch(L,x,narrow):
    n= len(L)
    if n==0: return 0
    if narrow and x in L: return L.index(x)
    last = L[-1]
    if x<last: return n
    if not narrow and x==last: return n
    #
    idx= -1
    i= 0
    j= n-1
    while j>=i:
        if i==j:
            if x>L[i]: idx= i
            break
        #
        mid= i + (j-i)//2
        if x<L[mid]:
            i= mid+1
        elif x==L[mid]:
            if narrow:
                idx= mid
                j  = mid - 1
            else:
                i = mid + 1
        else:
            idx= mid
            j= mid-1
    #
    return idx
#
def lds(L,narrow):
    seq= []
    for x in L:
        if len(seq)==0 or x<seq[-1]:
            seq.append(x)
        elif x==seq[-1]:
            if narrow:
                seq[DBsearch(seq,x,narrow)]= x
            else:
                seq.append(x)
        else:
            seq[DBsearch(seq,x,narrow)]= x
    #
    return len(seq)
#
n= int(sys.stdin.readline())
ai= [ int(sys.stdin.readline()) for _ in range(n) ]
print( lds( ai,False ) )

Buggy submission (verdict: Runtime Error):
import sys

n= int(sys.stdin.readline())
ai= [ int(sys.stdin.readline()) for _ in range(n) ]
c= 1
l= [ -1 ]
for i in range(n-1):
    a = ai[i]
    k= -1
    for j in range(c):
        if l[j]<a:
            k= j
            break
    #
    if k>=0:
        l[k]= ai[i]
    else:
        c+=1
        l.append(None)
#
print( c )
Problem p02985 (python)

Fixed submission:
#!/usr/bin/env python

import sys

n,k = [ int(x) for x in sys.stdin.readline().split() ]
d1 = [ [] for _ in range(n) ]
for _ in range(n-1):
    ai,bi = [ int(x)-1 for x in sys.stdin.readline().split() ]
    d1[ai].append( bi )
    d1[bi].append( ai )
#
flag = [ True ] * n
flag[0] = False
total = k
now = k
nxt = [ d1[0] ]
while nxt:
    tmp= []
    for points in nxt:
        if now!=k: now= k-1
        for v in points:
            if not flag[v]: continue
            flag[v]= False
            tmp.append(v)
            now -= 1
            total= ( total * now ) % 1000000007
    #
    nxt= []
    for v in tmp:
        a= [ vv for vv in d1[v] if flag[vv] ]
        if a: nxt.append( a )
#
print( total )

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

import sys

def fill(i,now):
    global iro, d1, k
    nuttayo = []
    for v in d1[i]:
        if iro[v]==0:
            now-=1
            iro[v]= now
            nuttayo.append(v)
    #
    for v in nuttayo: fill(v,k-1)

n,k = [ int(x) for x in sys.stdin.readline().split() ]
d1 = [ [] for _ in range(n) ]
for _ in range(n-1):
    ai,bi = [ int(x)-1 for x in sys.stdin.readline().split() ]
    d1[ai].append( bi )
    d1[bi].append( ai )
#
iro = [ 0 ] * n
iro[0] = k
fill(0,k)
i= 1
for j in iro: i= ( i * j ) % 1000000007
print( i )
Problem p02995 (python)

Fixed submission:
#!/usr/bin/env python

import sys

def gcd(aa,bb):
    aa, bb = max(aa,bb), min(aa,bb)
    while bb!=0:
        aa,bb=bb,aa%bb
    return aa

def f(n,m):
    nm = n % m
    if nm==0: return n
    else: return n + m - nm
#
a,b,c,d = [ int(x) for x in sys.stdin.readline().split() ]
cd = c * d // gcd(c,d)

# nc
aa = f(a,c)
if aa>b: nc=0
else: nc= (b-aa)//c + 1

# nd
aa = f(a,d)
if aa>b: nd=0
else: nd= (b-aa)//d + 1

# ncd
aa = f(a,cd)
if aa>b: ncd= 0
else: ncd= (b-aa)//cd + 1
#
print( b-a+1 - ( nc + nd - ncd ) )

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

import sys
import math

def f(n,m):
    nm = n % m
    if nm==0: return n
    else: return n + m - nm
#
a,b,c,d = [ int(x) for x in sys.stdin.readline().split() ]
cd = c * d // math.gcd(c,d)

# nc
aa = f(a,c)
if aa>b: nc=0
else: nc= (b-aa)//c + 1

# nd
aa = f(a,d)
if aa>b: nd=0
else: nd= (b-aa)//d + 1

# ncd
aa = f(a,cd)
if aa>b: ncd= 0
else: ncd= (b-aa)//cd + 1
#
print( b-a+1 - ( nc + nd - ncd ) )
Problem p03006 (python)

Fixed submission:
#!/usr/bin/env python

n = int( input() )
xy = []
for _ in range(n): xy.append( [ int(x) for x in input().strip().split() ] )
#
if n==1:
    print( 1 )
    exit()
#
xy.sort( key=lambda x: (x[0],x[1]) )
distmap = dict()
for i in range(n):
    xi,yi = xy[i]
    for j in range(i+1,n):
        xj, yj = xy[j]
        xd = xj - xi
        yd = yj - yi
        k = "{} {}".format(xd,yd)
        distmap[k]= distmap.get(k,0) + 1
#
d = max( distmap.values() )
print( n-d )

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

n = int( input() )
xy = []
for _ in range(n): xy.append( [ int(x) for x in input().strip().split() ] )
#
distmap = dict()
for i in range(n):
    xi,yi = xy[i]
    for j in range(i+1,n):
        xj, yj = xy[j]
        xd = xi - xj
        yd = yi - yj
        k = "{} {}".format(xd,yd)
        distmap[k]= distmap.get(k,0) + 1
#
d = max( distmap.values() )
print( n-d )
Problem p03050 (python)

Fixed submission:
import math
n= int(input())

m = math.floor(n/2)
if n>2:
    q = int( n / m )
    lm= m
    s = n - 1
else:
    s = 0

while( m>1 ):
    m = math.floor(n/(q+1))
    r0 = n % ( m + 1 )
    if r0>=q:
        d= r0  - q
        if d%q==0:
            s+= ( m+1+int(d/q) )
    #
    # for next
    q = int( n/m )
    lm= m
#
print( s )

Buggy submission (verdict: Runtime Error):
import math

m = math.floor(n/2)
if n>2:
    q = int( n / m )
    lm= m
    s = n - 1
else:
    s = 0

while( m>1 ):
    m = math.floor(n/(q+1))
    r0 = n % ( m + 1 )
    if r0>=q:
        d= r0  - q
        if d%q==0:
            s+= ( m+1+int(d/q) )
    #
    # for next
    q = int( n/m )
    lm= m
#
print( s )

Buggy submission (verdict: Runtime Error):
import math

n= int(input())

m = math.floor(n/2)
q = int( n / m )
lm= m

s = n - 1
while( m!=1 ):
    m = math.floor(n/(q+1))
    r0 = n % ( m + 1 )
    if r0>=q:
        d= r0  - q
        if d%q==0:
            s+= ( m+1+int(d/q) )
    #
    # for next
    q = int( n/m )
    lm= m
#
print( s )
Problem p02579 (python)

Fixed submission:
from collections import deque
H,W = list(map(int,input().split()))
start = list(map(lambda x:int(x)-1,input().split()))
goal = list(map(lambda x:int(x)-1,input().split()))
A = [input() for _ in range(H)]
visited = [[0]*W for _ in range(H)]
B = deque([[start[0],start[1],0]])
warp = []
for i in range(-2,3):
    for j in range(-2,3):
            warp.append([i,j])

num = -1

while B:
    y,x,n = B.popleft()
    if visited[y][x] == 1:continue
    if [y,x] == goal:
        num = n
        break
    visited[y][x] = 1
    for dy,dx in [[1,0],[0,1],[-1,0],[0,-1]]:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.appendleft([y+dy,x+dx,n])
    for dy,dx in warp:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.append([y+dy,x+dx,n+1])

print(num)

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W = list(map(int,input().split()))
start = list(map(lambda x:int(x)-1,input().split()))
goal = list(map(lambda x:int(x)-1,input().split()))
A = [input() for _ in range(H)]
visited = [[0]*W for _ in range(H)]
B = deque([[start[0],start[1],0]])
warp = []
for i in range(-2,3):
    for j in range(-2,3):
            warp.append([i,j])

num = 0
# print(start,warp)
while 1:
    y,x,n = B.popleft()
    if visited[y][x] == 1:continue
    if [y,x] == goal:
        num = n
        break
    visited[y][x] = 1
    for dy,dx in [[1,0],[0,1],[-1,0],[0,-1]]:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.appendleft([y+dy,x+dx,n])
    for dy,dx in warp:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.append([y+dy,x+dx,n+1])
    if not B:
        num = -1
        break

print(num)

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W = list(map(int,input().split()))
start = list(map(lambda x:int(x)-1,input().split()))
goal = list(map(lambda x:int(x)-1,input().split()))
A = [input() for _ in range(H)]
visited = [[0]*W for _ in range(H)]
B = deque([[start[0],start[1],0]])
warp = []
for i in range(-2,3):
    for j in range(-2,3):
            warp.append([i,j])

num = 0
# print(start,warp)
while 1:
    y,x,n = B.popleft()
    if visited[y][x] == 1:continue
    if [y,x] == goal:
        num = n
        break
    visited[y][x] = 1
    for dy,dx in [[1,0],[0,1],[-1,0],[0,-1]]:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.appendleft([y+dy,x+dx,n])
    for dy,dx in warp:
        if (y+dy<0)|(x+dx<0)|(y+dy>=H)|(x+dx>=W):continue
        if (A[y+dy][x+dx]==".")&(visited[y+dy][x+dx]==0):
            B.append([y+dy,x+dx,n+1])
    if not B:
        num = -1
        break

print(num)
Problem p04012 (python)

Fixed submission:
w=sorted(list(input()))+["_"];s="Yes" 
for i in range(1,len(w),2):
    if w[i]!=w[i-1]:s="No"
print(s)

Buggy submission (verdict: Runtime Error):
w=sorted(list(input()));s="Yes" 
for i in range(0,len(w),2):
    if w[i]!=w[i+1]:s="No"
print(s)
Problem p04032 (python)

Fixed submission:
s=list(input())
j=len(s)-2
for i in range(j):
    if s[i]==s[i+1]:
        print("{} {}".format(i+1,i+2))
        break
    elif s[i]==s[i+2]:
        print("{} {}".format(i+1,i+3))
        break
else:
    if s[j]==s[j+1]:
        print("{} {}".format(j+1,j+2))
    else:
        print("-1 -1")

Buggy submission (verdict: Runtime Error):
s=list(input())
for i in range(len(s)-2):
    if s[i]==s[i+1]:
        print("{} {}".format(i+1,i+2))
        break
    elif s[i]==s[i+2]:
        print("{} {}".format(i+1,i+3))
        break
else:
    if s[i+1]==s[i+2]:
        print("{} {}".format(i+2,i+3))
    else:
        print("-1 -1")
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(input())
s="".join(sorted(s))
print(s)

Buggy submission (verdict: Runtime Error):
n,l=map(n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(input())
print("".join(sorted(s)))
Problem p02639 (python)

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

for i in range(len(a)):
    if a[i]==0:
        print(i+1)

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

for i in range(x+1):
    for k in range(x-i+1):
        a=4*i+2*k

        if a==y:
            s+=1

if s>=1:
    print("Yes")
else:
    print("No")
Problem p02677 (python)

Fixed submission:
A,B,H,M=map(int,input().split())
import math

m=360*M/60
h=360*H/12+30*M/60

if m>=h:
    p=m-h

else:

    p=h-m


if p==0:
    print(abs(A-B))

else:

    l=math.radians(p)

    ans=(A**2+B**2-2*A*B*math.cos(l))**(1/2)

    print(ans)

Buggy submission (verdict: Runtime Error):
A,B,H,M=map(int,input().split())
import math

m=360*M/60
h=360*H/12+30*M/60

if m>=h:
    p=m-h

else:

    p=h-m

if H==M:
    print(0)
else:


    ans=(A**2+B**2-2*A*B*math.cos(math.radians(p)))**(1/2)

print(ans)
Problem p02687 (python)

Fixed submission:
s=input()

if s=="ARC":

    print("ABC")

else:
    print("ARC")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())

h=list(map(int,input().split()))
low=[]
high=[]

for i in range(m):

    a,b=map(int,input().split())

    if h[a-1]>h[b-1]:

        low.append(b)
        high.append(a)

    elif h[a-1]==h[b-1]:


        low.extend([a,b])

    elif h[a-1]<h[b-1]:

        low.append(a)
        high.append(b)

common=list(set(low)&set(high))

for k in range(len(common)):

    high.remove(common[k])

lh_or=list(set(low) ^ set(high))

g=n-len(lh_or)
high=list(set(high))

print(len(high)+g)
Problem p02705 (python)

Fixed submission:
import math
a=math.pi

R=int(input())

print(2*R*a)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())

a=[]
a=list(input().split())


for k in range(m):

    n=n-int(a[k])

    if n < 0:
        n=-1
        break

print(n)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())

a=[]
a=list(input().split())


for k in range(0,m):

    n=n-int(a[k])

    if n >= 0:
        pass

    else:

        break

print(n)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

flag = True
for i in range(len(S)):
    if S[i] == T[i]:
        pass
    else:
        flag = False
        
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

flag = True
for i in range(len(S)):
    if S{i} == T[i]:
        pass
    else:
        flag = False
        
if flag:
    print("Yes")
else:
    print("No")
Problem p02706 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N - sum(A)
if sum(A) > N:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N - sum(A):
if sum(A) < N
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N - sum(A)
if sum(A) < N
    print(-1)
else:
    print(ans)
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())

X = [0] * N
R = [0] *  N

ans = True
for i in range(M):
    s,c = map(int,input().split())
    
        
    if R[s-1] == 0:
        X[s-1] = c
        R[s-1] = "T"
        
    elif R[s-1] == "T" and X[s-1] != c :
        ans = False
        break
        
if ans:
    if X[0] == 0 and R[0] == 0 and N != 1:
        cnt = "1"
    else:
        cnt = str(X[0])
    for i in range(1,N):
        cnt = cnt + str(X[i])
    
    if len(cnt) == len(str(int(cnt))):
        
        print(cnt)
    else:
        print(-1)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())

X = [0] * N
R = [0] *  N

ans = True
for i in range(M):
    s,c = map(int,input().split())
    if s > N:
        ans = False
        break
        
    if R[s-1] == 0:
        X[s-1] = c
        R[s-1] = "T"
        
    elif R[s-1] == "T" and X[s-1] != c or (s == 1 and c == 0):
        ans = False
        break
        
if ans:
    if i == 0 and X[0] == 0:
            cnt = 1
    else:
        cnt = X[0]
    for i in range(1,N):
        cnt = cnt * 10 + X[i]
        
    print(cnt)

else:
    print(-1)
Problem p02802 (python)

Fixed submission:
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False and (prb in AC) ==  False:
            WA[prb] = 1
        else:
            if (prb in AC) ==  False:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    if (i in AC):
        wa += v
print("{} {}".format(len(AC),wa))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) == True:
        ans_WA += int(sub)
            
print(len(AC.values()),ans_WA)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) = True:
        ans_WA += int(sub)
            
print(len(AC.values()),ans_WA)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) = True:
        ans_WA += sub
            
print(len(AC.values()),ans_WA)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False:
            WA[prb] = 1
        else:
            if AC[prb] == None:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    wa += v
print("{} {}".format(len(AC),wa))
Problem p02861 (python)

Fixed submission:
import itertools
import math
n = int(input())
s = []
for i in range(n):
    x,y = map(int,input().split())
    s.append([x,y])
s = list(itertools.permutations(s))
ans = 0
for i in s:
    for j in range(n-1):
        ans += math.sqrt((i[j][0] - i[j+1][0])**2 + (i[j][1] - i[j+1][1])**2)
print(ans/len(s))

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

N = int(input())
town = list(itertools.permutations(range(N)))
dis = []
for i in range(N):
    s = tuple(map(int,input().split()))
    dis.append(s)
    
ans = 0
for i,j,k in town:
    calc = math.sqrt((dis[i][0]-dis[j][0])**2 + (dis[i][1]-dis[j][1])**2 ) + math.sqrt((dis[j][0]-dis[k][0])**2 + (dis[j][1]-dis[k][1])**2 )
    ans += calc
    
ans/len(town)
Problem p02887 (python)

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

s = S[0]
i = 1
ans = 1
while(True):
    
    if i == len(S):
        break
    if s == S[i]:
        pass
    else:
        ans += 1
        s = S[i]
    i += 1
        
print(ans)

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

s = S[0]
i = 1
ans = 1
while(True):
    if s == S[i]:
        pass
    else:
        ans += 1
        s = S[i]
    i += 1
    if i == len(S):
        break
        
print(ans)
Problem p02909 (python)

Fixed submission:
S = input()
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S = input()
if S == "Sunny":
    print("Cloudy")
elif S == Cloudy:
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S = input()
if S == "Sunny":
    print("Cloudy")
elif S == Cloudy:
    print("Rainy")
else:
    print("Sunny")
Problem p02995 (python)

Fixed submission:
A,B,C,D = map(int,input().split())

import fractions

def f(N):
    red = N//C
    red += N//D
    X = (C * D // fractions.gcd(C, D))
    red -= N//X
    return N - red

ans = f(B) - f(A-1)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
s = lcm(C,D)
X =  A - (A//C + A //D - A//s)
Y =  B - (B//C + B //D - B//s)
print(Y-X)
Problem p03031 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import itertools

ans = 0
N,M = map(int,readline().split())
L = []

for i in range(M):
    k,*S = map(int,readline().split())
    L.append(S)

P = list(map(int,readline().split()))

A = list(itertools.product([0,1],repeat=N))

for i in A:
    sw = [False] * M
    for j in range(M):
        count = 0
        for k in L[j]:
            count += i[k-1]

        if count % 2 == P[j]:
            sw[j] = True
            
    if sum(sw) == M:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import itertools

ans = 0
N,M = map(int,readline().split())
L = []

for i in range(M):
    k,*S = map(int,readline().split())
    L.append(S)

P = list(map(int,readline().split()))

A = list(itertools.product([0,1],repeat=N))

for i in A:
    sw = [False] * N
    for j in range(M):
        count = 0
        for k in L[j]:
            count += i[k-1]

        if count % 2 == P[j]:
            sw[j] = True
            
    if sum(sw) == N:
        ans += 1
print(ans)
Problem p03076 (python)

Fixed submission:
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag):
    output -= 10 - amari
print(output)

Buggy submission (verdict: Runtime Error):
ans = 0
y = []
z = []
for i in range(5):
    X = int(input())
    if X % 10 != 0:
        y.append(10 - X%10)
    z.append(X)
print(sum(z) + sum(y) - max(y))

Buggy submission (verdict: Runtime Error):
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag = True):
    output += amari
print(output)
Problem p03273 (python)

Fixed submission:
H,W = map(int,input().split())
grid = []
for i in range(H):
    a = input()
    l = []
    for i in a:
        l.append(i)
    grid.append(l)
grid_1 = []
delete = []
for i,job in enumerate(grid):
    count = 0
    for j in job:
        if(j == "."):
            count += 1
    if(count != W):
        grid_1.append(job)
count = 0
for i in delete:
    grid.pop(i-count)
    count += 1
grid_3 = []
for Row in zip(*grid_1):
    w = len(Row)
    count = 0
    for j in Row:
        if(j == "."):
            count += 1
    if(count != w):
        grid_3.append(Row)
for Row in zip(*grid_3):
    ans = ""
    for j in Row:
        ans += j
    print(ans)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
grid = []
for i in range(H):
    a = input()
    l = []
    for i in a:
        l.append(i)
    grid.append(l)
grid_1 = []
for i,job in enumerate(grid):
    count = 0
    for j in job:
        if(j == "."):
            count += 1
    if(count != W):
        grid_1.append(job)
count = 0
for i in delete:
    grid.pop(i-count)
    count += 1
grid_3 = []
for Row in zip(*grid_1):
    w = len(Row)
    count = 0
    for j in Row:
        if(j == "."):
            count += 1
    if(count != w):
        grid_3.append(Row)
for Row in zip(*grid_3):
    ans = ""
    for j in Row:
        ans += j
    print(ans)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
grid = []
for i in range(H):
    a = input()
    l = []
    for i in a:
        l.append(i)
    grid.append(l)
grid_1 = []
for i,job in enumerate(grid):
    count = 0
    for j in job:
        if(j == "."):
            count += 1
    if(count != W):
        grid_1.append(job)
count = 0
for i in delete:
    grid.pop(i-count)
    count += 1
grid_3 = []
for Row in zip(*grid_1):
    w = len(Row)
    count = 0
    for j in Row:
        if(j == "."):
            count += 1
    if(count != w):
        grid_3.append(Row)
for Row in zip(*grid_3):
    ans = ""
    for j in Row:
        ans += j
    print(ans)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
grid = []
for i in range(H):
    a,b,c,d = input()
    l = [a,b,c,d]
    grid.append(l)
delete = []
grid_1 = []
for i,job in enumerate(grid):
    count = 0
    for j in job:
        if(j == "."):
            count += 1
    if(count != W):
        grid_1.append(job)
count = 0
for i in delete:
    grid.pop(i-count)
    count += 1
grid_3 = []
for Row in zip(*grid_1):
    w = len(Row)
    count = 0
    for j in Row:
        if(j == "."):
            count += 1
    if(count != w):
        grid_3.append(Row)
for Row in zip(*grid_3):
    ans = ""
    for j in Row:
        ans += j
    print(ans)