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

Fixed submission:
import collections
n, m = [int(i) for i in input().split()]
todc = collections.defaultdict(lambda: [])
lendc = collections.defaultdict(lambda: -1)


for k in range(m):
    i, j = [int(n) for n in input().split()]
    todc[j] += [i]


def maxlen(n):
    if len(todc[n]) == 0:
        lendc[n] = 0
        return 0
    else:
        m = 0
        for i in todc[n]:
            if lendc[i] == -1:
                lendc[i] = maxlen(i)
            m = max(m, lendc[i]+1)
        return m
       

def maxlen_stack(org_n):
    stack = [org_n]
    while stack:
        n = stack.pop()
        if len(todc[n]) == 0:
            lendc[n] = 0
        else:
            m = 0
            recursive = []
            for i in todc[n]:
                if lendc[i] == -1:
                    recursive.append(i)
                else:
                    m = max(m, lendc[i]+1)
            if recursive:
                stack += [n] + recursive
            else:
                lendc[n] = m         
    return lendc[org_n]

k = 0
for i in range(1, n+1):
    if lendc[i] == -1:
        #lendc[i] = maxlen(i)
        lendc[i] = maxlen_stack(i)
    k = max(k, lendc[i])
print(k)

Buggy submission (verdict: Runtime Error):
import collections
n, m = [int(i) for i in input().split()]
todc = collections.defaultdict(lambda: [])
lendc = collections.defaultdict(lambda: -1)

for k in range(m):
    i, j = input().split()
    todc[int(j)] += [int(i)]

def maxlen(n):
    if len(todc[n]) == 0:
        lendc[n] = 0
        return 0
    else:
        m = 0
        for i in todc[n]:
            if lendc[i] == -1:
                lendc[i] = maxlen(i)
            m = max(m, lendc[i]+1)
        return m

k = 0
for i in range(1, n+1):
    if lendc[i] == -1:
        lendc[i] = maxlen(i)
    k = max(k, lendc[i])
print(k)

Buggy submission (verdict: Runtime Error):
import collections
n, m = [int(i) for i in input().split()]
todc = collections.defaultdict(lambda: [])

for k in range(m):
    i, j = input().split()
    todc[int(j)] += [int(i)]

def maxlen(n):
    if len(todc[n]) == 0:
        return 0
    else:
        m = 0
        for i in todc[n]:
            m = max(m, (maxlen(i)+1))
        return m

k = 0
for i in range(1, n+1):
    k = max(k, maxlen(i))
print(k)

Buggy submission (verdict: Runtime Error):
import collections
n, m = [int(i) for i in input().split()]
todc = collections.defaultdict(lambda: [])

for k in range(m):
    i, j = input().split()
    todc[int(j)] += [int(i)]

def maxlen(n):
    if len(todc[n]) == 0:
        return 0
    else:
        m = 0
        for i in todc[n]:
            m = max(m, (maxlen(i)+1))
        return m

k = 0
for i in range(1, n+1):
    k = max(k, maxlen(i))
    print("k ", i, maxlen(i))
print(k)
Problem p03194 (python)

Fixed submission:
import collections
import math

n, p = [int(i) for i in input().split()]
d = collections.defaultdict(lambda: 0)

def bunkai(q):
	if q == 1:
		return 0
	for i in range(2, math.ceil(math.sqrt(p))):
		if q % i == 0:
			d[i] += 1
			return bunkai(q//i)

if n == 1 or p == 1:
	print(p)
else:
	bunkai(p)
	ans = 1

	for j in d.keys():
		k = d[j]
		if k // n >= 1:
			ans *= j**(k//n)
	print(ans)

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

n, p = [int(i) for i in input().split()]
d = collections.defaultdict(lambda: 0)

def bunkai(q):
	if q == 1:
		return 0
	for i in range(2, math.ceil(math.sqrt(p))):
		if q % i == 0:
			d[i] += 1
			return bunkai(q//i)

if n == 1 or p == 1:
	print(p)
else:
	bunkai(p)
	ans = 1

	for j in d.key
		k = d[j]
		if k // n >= 1:
			ans *= j**(k//n)
	print(ans)
Problem p03240 (python)

Fixed submission:
N = int(input())
S = [[int(i) for i in input().split()] for j in range(N)]
SS = sorted(S,key=lambda x: x[2], reverse=True)

#(x, y)を(0,0)から(100,100)まで試す
def firstlook(si, kohod): 
    for x in range(0, 100+1):
        for y in range(0, 100+1):
            h = si[2]+abs(si[0]-x)+abs(si[1]-y)
            kohod[(x,y)] = h
    return kohod

def lastlook(si, kohod):
    for (x, y) in list(kohod.keys()):
        h = max(kohod[(x,y)]-abs(si[0]-x)-abs(si[1]-y),0)
        if si[2] != h:
            del kohod[(x,y)]
    return kohod

ans = firstlook(SS[0], dict())
for Si in SS[1:]:
    ans = lastlook(Si, ans)

[xy] = list(ans.keys())
print(str(xy[0]) + " " + str(xy[1]) + " "+ str(ans[xy]))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [[int(i) for i in input().split()] for j in range(N)]
SS = sorted(S,key=lambda x: x[2], reverse=True)

#(x, y)を(0,0)から(100,100)まで試す
def firstlook(si, kohod): 
    for x in range(0, 100+1):
        for y in range(0, 100+1):
            h = si[2]+abs(si[0]-x)+abs(si[1]-y)
            kohod[(x,y)] = h
    return kohod

def lastlook(si, kohod):
    for (x, y) in list(kohod.keys()):
        h = max((si[2]+abs(si[0]-x)+abs(si[1]-y)),0)
        if kohod[(x,y)] != h:
            del kohod[(x,y)]
    return kohod

anspre = firstlook(SS[0], dict())
for Si in SS:
    ans = lastlook(Si, anspre)

[xy] = list(ans.keys())
print(str(xy[0]) + " " + str(xy[1]) + " "+ str(ans[xy]))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [[int(i) for i in input().split()] for j in range(N)]
SS = sorted(S,key=lambda x: x[2], reverse=True)

#(x, y)を(0,0)から(100,100)まで試す
def firstlook(si, kohod): 
    for x in range(0, 100+1):
        for y in range(0, 100+1):
            h = max((si[2]+abs(si[0]-x)+abs(si[1]-y)),0)
            kohod[(x,y)] = h
    return kohod

def lastlook(si, kohod):
    for (x, y) in list(kohod.keys()):
        h = max((si[2]+abs(si[0]-x)+abs(si[1]-y)),0)
        if kohod[(x,y)] != h:
            del kohod[(x,y)]
    return kohod

anspre = firstlook(SS[0], dict())
for Si in SS:
    ans = lastlook(Si, anspre)

[xy] = list(ans.keys())
print(str(xy[0]) + " " + str(xy[1]) + " "+ str(ans[xy]))
Problem p03244 (python)

Fixed submission:
n = int(input())
v = [int(i) for i in input().split()]

a, b = dict(), dict()
for i in range(n):
    if i%2 == 0:
        a[v[i]] = a.get(v[i], 0) + 1
    else:
        b[v[i]] = b.get(v[i], 0) + 1
alst = sorted(list(a.items()), key=lambda x: x[1], reverse=True)
blst = sorted(list(b.items()), key=lambda x: x[1], reverse=True)

if alst[0][0] != blst[0][0]:
    print(n-alst[0][1]-blst[0][1])
elif len(alst) == 1 and len(blst) == 1:
    print(blst[0][1])    
elif len(alst) == 1:
    print(n-alst[0][1]-blst[1][1])
elif len(blst) == 1:
    print(n-alst[1][1]-blst[0][1])
elif blst[0][1]+alst[1][1] > alst[0][1]+blst[1][1]:
    print(n-alst[1][1]-blst[0][1])
else:
    print(n-alst[0][1]-blst[1][1])

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
v = [int(i) for i in input().split()]

dummy = (-1, -1)
(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2]
(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2]

if av1 != bv1:
    print(n-ak1-bk1)
elif ak1 < bk1:
    print(n-ak2-bk1)
else:
    print(n-ak1-bk2)
Problem p03999 (python)

Fixed submission:
s = input()
slen = len(s)

def keisan(s):
    smod = s
    wa = 0
    while smod.count("+") != 0:
        wa += int(smod[:smod.index("+")])
        smod = smod[smod.index("+")+1:]
    wa += int(smod)
    return wa

kotae = 0
for i in range(2**(slen-1)):
    ibin = bin(i)[2:]
    si = s
    for j in range(1, len(ibin)+1):
        if ibin[-j] == "1":
            si = si[:slen-j]+"+"+si[slen-j:]
        else:
            pass
    kotae += keisan(si)

print(kotae)

Buggy submission (verdict: Runtime Error):
s = input()
slen = len(s)

kotae = 0
for i in range(2**(slen-1)):
    for j in range(slen-1):
        if i & 1<<j:
            si = si[:slen-j]+"+"+si[slen-j:]
        else:
            pass
    kotae += eval(si)

print(kotae)
Problem p03243 (python)

Fixed submission:
#Bad_Beast
n=int(input())
if n>=100 and n<=111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
#print(res)

Buggy submission (verdict: Runtime Error):
#Bad_Beast
n=int(input())
if n==111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
print(res)
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < =(10**18):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < =(10**18):
            print(s[0])
        else:
            print(s[1])
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]=="1":
        k-=1
    else:
        k=0
    if k<=0:
        print(s[i])
        break

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

if k==1:
    print(s[0])
elif s[0]=="1" and s[1]=="1":
    if s[2]=="1":    
        if k<3:
            print("1")
        else:
            print(s[3])
    else:
        if k<2:
            print("1")
        else:
            print(s[2])
elif s[1]!="1" and s[2]!=1:
    if s[0]=="1" :
        if k <= (10**18):
            print(s[1])
        else :
            print(s[2])
    else:
        if k <= (10**18):
            print(s[0])
        else:
            print(s[1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

if k==1:
    print(s[0])
    
else:
    for i in range(len(s)):
        if s[i]!="1":
            break
    if i!=1 and k<=i:
        print(1)
    elif i!=1 and k>i:    
        print(s[i+1])
        
    elif s[0]=="1" and s[1]!="1":
        if k <= (10**18):
            print(s[1])
        else :
            print(s[2])
    else:
        if k <= (10**18):
            print(s[0])
        else:
            print(s[1])
Problem p03284 (python)

Fixed submission:
# cook your dish here
n,k=list(map(int,input().split()))
if n%k==0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
# cook your dish here
n,k=list(map(int,input().split()))
if n%k==0:
    print(n%k)
else:
    a=[]
    x=int(n/k)
    for i in range(1,x+1):
        r=n-(i*(k-1))
        a.append(abs(r-i))   
    print(min(a))
Problem p03088 (python)

Fixed submission:
import numpy as np
N = int(input())

dp = np.zeros((N+1,4,4,4),dtype="int")

dp[0,3,3,3] = 1
mod = 10**9+7


for l in range(N):
    for c1 in range(4):
        for c2 in range(4):
            for c3 in range(4):
                if dp[l,c3,c2,c1] == 0:
                    continue
                for c0 in range(4):
                    if c0 == 1 and c1 == 2 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 1 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 0 and c2 == 1:
                        continue
                    if c0 == 2 and c1 == 1 and c3 == 0:
                        continue
                    if c0 == 2 and c2 == 1 and c3 == 0:
                        continue
                    dp[l+1,c2,c1,c0] += dp[l,c3,c2,c1]
                    dp[l + 1, c2, c1, c0] %= mod
                    
ans = 0
for c1 in range(4):
    for c2 in range(4):
        for c3 in range(4):
            ans += dp[N,c3,c2,c1]
            ans %= mod
print(ans%mod)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())

dp = np.zeros((N+1,4,4,4),dtype="int")

dp[0,3,3,3] = 1
mod = 10**9+7


for l in range(N):
    for c1 in range(4):
        for c2 in range(4):
            for c3 in range(4):
                if dp[l,c3,c2,c1] == 0:
                    continue
                for c0 in range(4):
                    if c0 == 1 and c1 == 2 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 1 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 0 and c2 == 1:
                        continue
                    if c0 == 2 and c1 == 1 and c3 == 0:
                        continue
                    if c0 == 2 and c2 == 1 and c3 == 0:
                        continue
                    dp[l+1,c2,c1,c0] += dp[l,c3,c2,c1]
                    dp[l + 1, c2, c1, c0] %= mod
                    
ans = 0
for c1 in range(4):
    for c2 in range(4):
        for c3 in range(4):
            ans += dp[N,c3,c2,c1]
            ans %= mod
print(ans%mod)
Problem p03111 (python)

Fixed submission:
import numpy as np

N,A,B,C = map(int,input().split())
target = [A,B,C]
l = []
#ans = math.inf

for _ in range(N):
    l.append(int(input()))


def calc2(v):
    res = 0
    for i in range(3):
        if len(v[i])==0:
            return np.inf
        res += 10*(len(v[i])-1) + abs(sum(v[i]) - target[i])
    return res

v=[[],[],[],[]]
def dfs2(depth=0):
    #global ans
    if depth == N:
        return calc2(v)
    #else:
    ans = np.inf
    for i in range(4):
        #next_v = v.copy()
        #print(i, v, depth, l)
        v[i].append(l[depth])
        ans = min(ans,dfs2(depth+1))
        del v[i][-1]

    return ans

print(dfs2())

Buggy submission (verdict: Runtime Error):
import math

N,A,B,C = map(int,input().split())
target = [A,B,C]
l = []
#ans = math.inf

for _ in range(N):
    l.append(int(input()))


def calc2(v):
    res = 0
    for i in range(3):
        if len(v[i])==0:
            return math.inf
        res += 10*(len(v[i])-1) + abs(sum(v[i]) - target[i])
    return res

v=[[],[],[],[]]
def dfs2(depth=0):
    #global ans
    if depth == N:
        return calc2(v)
    #else:
    ans = math.inf
    for i in range(4):
        #next_v = v.copy()
        #print(i, v, depth, l)
        v[i].append(l[depth])
        ans = min(ans,dfs2(depth+1))
        del v[i][-1]

    return ans
print(dfs2())
Problem p03112 (python)

Fixed submission:
import bisect
import sys

A, B, Q = map(int,input().split())
s = [-(10**18)] + list(map(int, (sys.stdin.readline() for _ in [0]*A))) + [10**18]
t = [-(10**18)] + list(map(int, (sys.stdin.readline() for _ in [0]*B))) + [10**18]


def solve(s,t,x):
    ans = 10**18
    for i in range(2):
        a, b = (s, t) if i==0 else (t, s)
        posX1 = bisect.bisect_left(a,x)
        for j in range(2):
            ax = a[posX1 -j]
            posX2 = bisect.bisect_left(b,ax)
            for k in range(2):
                bx = b[posX2-k]
                ans = min(ans, abs(x-ax)+abs(bx-ax))
    return ans

for _ in range(Q):
    x = int(input())
    print(solve(s,t,x))

Buggy submission (verdict: Runtime Error):
import bisect
import sys
A, B, Q = map(int,input().split())

S = [-10**18] + list(map(int, (sys.stdin.readline() for _ in [0]*A))) + [10**18]
T = [-10**18] + list(map(int, (sys.stdin.readline() for _ in [0]*A))) + [10**18]


for _ in range(Q):
    x = int(input())
    ans = 10**18
    for i in range(2):
        if i == 0:
            a = S
            b = T
        elif i== 1:
            a = T
            b = S

        idx_x = bisect.bisect_left(a,x)
        for j in range(2):
            ax = a[idx_x-j]
            idx_a = bisect.bisect_left(b,ax)
            for k in range(2):
                bx = b[idx_a-k]
                ans = min(ans, abs(ax-x)+abs(bx-ax))
    print(ans)
Problem p03128 (python)

Fixed submission:
N, M = map(int,input().split())
A = list(map(int, input().split()))
cost = [2,5,5,4,5,6,3,7,6]

dp = [-1 for _ in [0]*(N+10)]
dp[0] = 0

for i in range(N+1):
    for a in A:
        if i-cost[a-1] < 0 or dp[i-cost[a-1]] < 0:
            continue
        if dp[i-cost[a-1]]*10 + a > dp[i]:
            dp[i] = dp[i-cost[a-1]]*10 + a
print(dp[N])

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

cost = [2,5,5,4,5,6,3,7,6]


def solve(N, num=0):
    if N < 0:
        return -1
    if N == 0:
        return num
    ans = 0
    for a in A:
        tmp_num = num
        if tmp_num == 0:
            tmp_num += a
        else:
            tmp_num += a*(10**len(str(tmp_num)))
        ans = max(solve(N-cost[a-1],tmp_num),ans)
    return ans

print(solve(N))
Problem p03162 (python)

Fixed submission:
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))

Buggy submission (verdict: Runtime Error):
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))

Buggy submission (verdict: Runtime Error):
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))
Problem p03837 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*M
b = [0]*M
c = [0]*M
for i in range(M):
    input_data = input().split()
    a[i], b[i], c[i] = map(int, input_data)
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = [[MAX for j in range(N)] for i in range(N)]
#dist += MAX

for i in range(N):
    dist[i][i] = 0

for i in range(M):
    dist[a[i]][b[i]] = c[i]
    dist[b[i]][a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = 0
for i in range(M):
    if dist[a[i]][b[i]] < c[i]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*N
b = [0]*N
c = [0]*N
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = np.zeros((N,N))
dist += MAX

for i in range(N):
    dist[i,i] = 0

for i in range(M):
    dist[a[i], b[i]] = c[i]
    dist[b[i], a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i, j] = min(dist[i,j], dist[i,k] + dist[k,j])

ans = 0
for i in range(M):
    if dist[a[i], b[i]] < c[i]:
        ans += 1

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*N
b = [0]*N
c = [0]*N
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = [[MAX for j in range(N)] for i in range(N)]

for i in range(N):
    dist[i][i] = 0

for i in range(M):
    dist[a[i]][b[i]] = c[i]
    dist[b[i]][a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = 0
for i in range(M):
    if dist[a[i]][b[i]] < c[i]:
        ans += 1

print(ans)
Problem p03106 (python)

Fixed submission:
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
lis = num_lis[::-1]
print(lis[K - 1])

Buggy submission (verdict: Runtime Error):
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
print(num_lis[K])

Buggy submission (verdict: Runtime Error):
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
print(num_lis[K]
Problem p03493 (python)

Fixed submission:
char_list = list(input())
num_list = list(map(int, char_list))
out = sum(num_list)
print(out)

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

def is_even(lis):
    return [x for x in lis if x % 2]

mod2_list = is_even(num_list)

i = 0
while mod2_list == []:
    num_list = [x / 2 for x in num_list]
    mod2_list = is_even(num_list)
    i += 1
    
print(i)
Problem p03085 (python)

Fixed submission:
base = ['A','T','C','G']
 
ind = base.index(input())
if(ind%2 == 0):
  print(base[ind+1])
else:
  print(base[ind-1])

Buggy submission (verdict: Runtime Error):
base = ['A','T','C','G']

ind = base.index(input())
if(ind%2 == 0):
  printf(base[ind+1])
else:
  printf(base[ind-1])
Problem p03047 (python)

Fixed submission:
NK = input().split()
NK = [int(s) for s in NK]

out = (NK[0] - NK[1]) + 1

print(out)

Buggy submission (verdict: Runtime Error):
N = input()
K = input()

out = (N - K) + 1

print(out)
Problem p03060 (python)

Fixed submission:
n=int(input())
list_v=list(map(int, input().split()))
list_c=list(map(int, input().split()))
ans = 0
for i in range(n):
  ans_p = list_v[i] - list_c[i]
  if ans_p > 0:
    ans += ans_p
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
list_v=list(map(int, input().split()))
list_c=list(map(int, input().split()))
list_ans = list_v - list_c
ans = 0
for i in range(n):
  if list_ans[i] > 0:
    ans += list_ans[i]
print(ans)
Problem p03067 (python)

Fixed submission:
l = [int(i) for i in input().split()]
l_sorted = sorted(l)
if l[2] == l_sorted[1]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())
if (a < c && c < b) || (b < c && c < a):
  print('Yes')
else:
  print('No')
Problem p03068 (python)

Fixed submission:
n = int(input())
s = list(input())
k = int(input())
c = s[k-1]
for i in range(n):
  if not s[i] == c:
    s[i] = '*'
print("".join(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
c = s[k-1]
for i in range(len(s)):
  if not s[i] == c:
    s[i] = c
print(s)
Problem p03071 (python)

Fixed submission:
l = sorted([int(i) for i in input().split()])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
else:
  print(l[0]+l[1])

Buggy submission (verdict: Runtime Error):
l = sorted([int(input()) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
else:
  print(l[0]+l[1])

Buggy submission (verdict: Runtime Error):
l = sorted([int(input()) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
elif: l[1] == l[0]:
  print(l[0]*2)
else:
  print(l[0]+l[1]-1)

Buggy submission (verdict: Runtime Error):
l = sorted([int(input)) for i in range(2)])
if l[1]-1>=l[0]:
  print(l[1]*2-1)
elif: l[1] == l[0]:
  print(l[0]*2)
else:
  print(l[0]+l[1]-1)
Problem p03076 (python)

Fixed submission:
l = [int(input()) for i in range(5)]
l_0 = [a%10 for a in l]
ar = []
for n in l_0:
  if n != 0:
    ar.append(10-n)
  else:
    ar.append(0)
s = ar.index(max(ar))
ar.pop(s)
ans = sum(l) + sum(ar)
print(ans)

Buggy submission (verdict: Runtime Error):
l = [int(input) in i for range(5)]
l_0 = l % 10
ar = []
for n in l_0:
  if n != 0:
    ar.append(10-n)
  else:
    ar.append(0)
s = l_0.index(max(l_0))
ans = sum(l[l.index()!=s]) + sum(l_0[l_0.index()!=s]) + l[s]
print(ans)