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

Fixed submission:
import sys
sys.setrecursionlimit(10000)

n = input()
k = int(input())
m = {}


def doit(n, k):
    if len(n) == 0:
        return k == 0
    d = int(n[0])
    if (n, k) not in m:
        ret = 0
        for i in range(d + 1):
            if i == d:
                ret += doit(n[1:], k - 1 if i > 0 else k)
            else:
                ret += doit('9' * (len(n) - 1), k - 1 if i > 0 else k)
        m[(n, k)] = ret
    return m[(n, k)]


print(doit(n, k))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100)

n = input()
k = int(input())
m = {}


def doit(n, k):
    if len(n) == 0:
        return k == 0
    d = int(n[0])
    if (n, k) not in m:
        ret = 0
        for i in range(d + 1):
            if i == d:
                ret += doit(n[1:], k - 1 if i > 0 else k)
            else:
                ret += doit('9' * (len(n) - 1), k - 1 if i > 0 else k)
        m[(n, k)] = ret
    return m[(n, k)]


print(doit(n, k))
Problem p03127 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


n = int(input())
a = list(map(int, input().split()))
v = a[0]
for aa in a[1:]:
    v = gcd(v, aa)
print(v)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
v = a[0]
for aa in a[1:]:
    v = math.gcd(v, aa)
print(v)
Problem p02779 (python)

Fixed submission:
d = {}
n = input()
aaa = list(map(int, input().split(' ')))
ans = 'YES'
for a in aaa:
  d[a] = d.get(a, 0) + 1
  if d[a] >= 2:
    ans = 'NO'
print(ans)

Buggy submission (verdict: Runtime Error):
d = [0] * 200001
n = input()
aaa = list(map(int, input().split(' ')))
ans = 'YES'
for a in aaa:
  d[a] += 1
  if d[a] >= 2:
    ans = 'NO'
print(ans)
Problem p03038 (python)

Fixed submission:
import bisect
n, m = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = sorted([-a for a in aaa])[::-1]
len_aaa = len(aaa)

cccbbb = []
for i in range(m):
    b, c = list(map(int, input().split(' ')))
    cccbbb.append((-c, b))
cccbbb = sorted(cccbbb)
ccc = []
for c, b in cccbbb:
    ccc += [c] * b
    if len(ccc) > len_aaa:
        break
ans = 0
for i in range(len_aaa):
    c = ccc[i] if i < len(ccc) else 0
    ans += min(aaa[i], c)
print(abs(ans))

Buggy submission (verdict: Runtime Error):
import bisect
n, m = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = sorted([-a for a in aaa])
len_aaa = len(aaa)

cccbbb = []
for i in range(m):
    b, c = list(map(int, input().split(' ')))
    cccbbb.append((-c, b))
cccbbb = sorted(cccbbb)
for c, b in cccbbb:
    index = bisect.bisect_left(aaa, c)
    if index < len_aaa:
        if b < len_aaa - index + 1:
            ccc = [c] * b
            aaa = (aaa[:index] + ccc + aaa[index:len(aaa) - b])
        else:
            ccc = [c] * (len_aaa - index)
            aaa = (aaa[:index] + ccc)
        print(aaa)
    else:
        break
print(abs(sum(aaa)))

Buggy submission (verdict: Runtime Error):
import bisect
n, m = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
aaa = sorted([-a for a in aaa])
len_aaa = len(aaa)

cccbbb = []
for i in range(m):
    b, c = list(map(int, input().split(' ')))
    cccbbb.append((-c, b))
cccbbb = sorted(cccbbb)
for c, b in cccbbb:
    index = bisect.bisect_left(aaa, c)
    if index < len_aaa:
        ccc = [c] * min(b, len_aaa - index)
        aaa = (aaa[:index] + ccc + aaa[index:max(index, len_aaa - min(b, len_aaa - index))])
        print(aaa)
    else:
        break
print(abs(sum(aaa)))
Problem p03250 (python)

Fixed submission:
a, b, c = list(map(int, input().split(' ')))
print (max(a, b, c) * 9 + a + b + c)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
MOD = int(1e9 + 7)
seeds = []
p = 2
while p*p > M:
  while M % p == 0:
    seeds.append(p)
    M = M // p
  p += 1
if M > 1:
  seeds.append(M)
 
def comb(n, k):
  ans = 1
  for i in range(1, k + 1):
    ans = (ans * (n + 1 - i) // i)
  return ans
 
ans = 1
hogehoge = set(seeds)
for i in hogehoge:
  a_ct = seeds.count(i)
  ans = (ans * comb(a_ct + N-1, min(a_ct, N-1))) % MOD
print(ans)
Problem p03252 (python)

Fixed submission:
aaa = input()
bbb = input()
d = {}
d_rev = {}
ans = 'Yes'
for a, b in zip(aaa, bbb):
  if (a in d and d.get(a) != b) or (b in d_rev and d_rev.get(b) != a):
    ans = 'No'
  d[a] = b
  d_rev[b] = a
print(ans)

Buggy submission (verdict: Runtime Error):
aaa = input()
bbb = input()
d = {}
ans = 'Yes'
for a, b in zip(aaa, bbb):
  if a in d and d.get(a) != b:
    print ('%s %s %s %s' % (aaa, bbb, a,b ))
    ans = 'No'
  d[a] = b
vs = list(d.values())
if max([vs.count(k) for k in vs]) >= 2:
  ans = 'No'
print(ans)
Problem p02897 (python)

Fixed submission:
n = float(input())
print((n - n // 2) / n)

Buggy submission (verdict: Runtime Error):
n = input()
print((n // 2) / n)
Problem p02964 (python)

Fixed submission:
import math

# input
#
# n = 5
# k = 10
# a = [1, 2, 3, 2, 3]

n, k = map(int, input().split())
a = [int(ai) for ai in input().split()]

# make jumpto
#
# 0 -> 6 (5)
# 1 -> 4 (2)
# 2 -> 5 (2)
# 3 -> 7 (3)
# 4 -> 8 (3)

jumpto = [[-1] * n]
la = -1
li = -1
for (ca, ci) in sorted(zip(a, range(n))):
    if ca == la:
        jumpto[0][ci] = jumpto[0][li] + li - ci
        jumpto[0][li] = ci - li
    else:
        jumpto[0][ci] = n
    la = ca
    li = ci

# doubling jumpto
#
# 0 -> 6 ->  9 (8)
# 1 -> 4 ->  8 (6)
# 2 -> 5 -> 11 (8)
# 3 -> 7 -> 10 (6)
# 4 -> 8 -> 12 (7)
#
# 0 -> 6 ->  9 -> 13 -> 17  (16)
# 1 -> 4 ->  8 -> 12 -> 15  (13)
# 2 -> 5 -> 11 -> 14 -> 18  (15)
# 3 -> 7 -> 10 -> 16 -> 19  (15)
# 4 -> 8 -> 12 -> 15 -> 21  (16)

levels = int(math.log(k, 2))
for l in range(1, levels + 1):
    jumpto.append([-1] * n)
    for i in range(n):
        f = jumpto[l - 1][i]
        s = jumpto[l - 1][(i + f + 1) % n]
        jumpto[l][i] = f + 1 + s

# step1
s = 0
while True:
    jumped = False
    for l in range(levels, -1, -1):
        if s + jumpto[l][s % n] < n * k:
            s += jumpto[l][s % n] + 1
            jumped = True
            break
    if not jumped:
        break

# step2
ret = []
while s < n * k:
    if s + jumpto[0][s % n] < n * k:
        s = s + jumpto[0][s % n] + 1
    else:
        ret.append(str(a[s % n]))
        s += 1

print(' '.join(ret))

Buggy submission (verdict: Runtime Error):
import math

# input
#
# n = 5
# k = 10
# a = [1, 2, 3, 2, 3]

n, k = map(int, input().split())
a = [int(ai) for ai in input().split()]

# make jumpto
#
# 0 -> 6 (5)
# 1 -> 4 (2)
# 2 -> 5 (2)
# 3 -> 7 (3)
# 4 -> 8 (3)

jumpto = [[-1] * n]
la = -1
li = -1
for (ca, ci) in sorted(zip(a, range(n))):
    if ca == la:
        jumpto[0][ci] = jumpto[0][li] + li - ci
        jumpto[0][li] = ci - li
    else:
        jumpto[0][ci] = n
    la = ca
    li = ci

# doubling jumpto
#
# 0 -> 6 ->  9 (8)
# 1 -> 4 ->  8 (6)
# 2 -> 5 -> 11 (8)
# 3 -> 7 -> 10 (6)
# 4 -> 8 -> 12 (7)
#
# 0 -> 6 ->  9 -> 13 -> 17  (16)
# 1 -> 4 ->  8 -> 12 -> 15  (13)
# 2 -> 5 -> 11 -> 14 -> 18  (15)
# 3 -> 7 -> 10 -> 16 -> 19  (15)
# 4 -> 8 -> 12 -> 15 -> 21  (16)

levels = int(math.log2(k))
for l in range(1, levels + 1):
    jumpto.append([-1] * n)
    for i in range(n):
        f = jumpto[l - 1][i]
        s = jumpto[l - 1][(i + f + 1) % n]
        jumpto[l][i] = f + 1 + s

# step1
s = 0
while True:
    jumped = False
    for l in range(levels, -1, -1):
        if s + jumpto[l][s % n] < n * k:
            s += jumpto[l][s % n] + 1
            jumped = True
            break
    if not jumped:
        break

# step2
ret = []
while s < n * k:
    if s + jumpto[0][s % n] < n * k:
        s = s + jumpto[0][s % n] + 1
    else:
        ret.append(str(a[s % n]))
        s += 1

print(' '.join(ret))
Problem p02990 (python)

Fixed submission:
n, k = map(int, input().split())
mod = 1000000007
cmb = [[1]]
for i in range(n + 1):
    cmb.append([1])
    for j in range(i):
        cmb[-1].append((cmb[-2][j] + cmb[-2][j + 1]) % mod)
    cmb[-1].append(1)
for i in range(1, k + 1):
    if i > n - k + 1:
        print(0)
    else:
        print((cmb[n - k + 1][i] * cmb[k - 1][i - 1]) % mod)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
mod = 1000000007
cmb = [[1]]
for i in range(n + 1):
    cmb.append([1])
    for j in range(i):
        cmb[-1].append((cmb[-2][j] + cmb[-2][j + 1]) % mod)
    cmb[-1].append(1)
for i in range(1, k + 1):
    print((cmb[n - k + 1][i] * cmb[k - 1][i - 1]) % mod)
Problem p03108 (python)

Fixed submission:
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
group = [i for i in range(n)]
islands = {i: [i] for i in range(n)}
ret = [0] * m + [n * (n - 1) // 2]
for i in range(m - 1, -1, -1):
    a, b = ab[i]
    ga, gb = group[a - 1], group[b - 1]
    if ga == gb:
        ret[i] = ret[i + 1]
    else:
        la, lb = len(islands[ga]), len(islands[gb])
        ret[i] = ret[i + 1] - la * lb
        if la > lb:
            for j in islands[gb]:
                group[j] = ga
                islands[ga].append(j)
        else:
            for j in islands[ga]:
                group[j] = gb
                islands[gb].append(j)
for i in range(1, m + 1):
    print(ret[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
parent = [i for i in range(n)]
count = [1 for i in range(n)]

def root(i):
    if i == parent[i]:
        return i
    parent[i] = root(parent[i])
    return parent[i]

def merge(i, j):
    parent[j] = i
    count[i] += count[j]

ret = [0] * m + [n * (n - 1) // 2]
for i in range(m - 1, -1, -1):
    a, b = ab[i]
    ra, rb = root(a - 1), root(b - 1)
    if ra == rb:
        ret[i] = ret[i + 1]
    else:
        ret[i] = ret[i + 1] - count[ra] * count[rb]
        merge(ra, rb)

for i in range(1, m + 1):
    print(ret[i])
Problem p03209 (python)

Fixed submission:
n, x = map(int, input().split())
def layers(l):
    return 2 ** (l + 2) - 3
def patties(l):
    return 2 ** (l + 1) - 1
def doit(l, x):
    if x >= layers(l):
        return patties(l)
    y = layers(l - 1)
    ret = 0
    if x >= 1:
        ret += doit(l - 1, x - 1)
    if x >= y + 2:
        ret += 1
        ret += doit(l - 1, x - y - 2)
    return ret
print(doit(n, x))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
def doit(l, x):
    layers = 2 ** (l + 1) - 3
    if x >= layers + 2:
        return doit(l - 1, x - layers - 2) + 2 ** l
    elif x >= 1:
        return doit(l - 1, x - 1)
    else:
        return 0
print(doit(n, x))
Problem p03834 (python)

Fixed submission:
s = input()
print(s.replace(',',' '))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace(',',' ')）

Buggy submission (verdict: Runtime Error):
s = input()
print(S.replace(',',' ')）
Problem p02832 (python)

Fixed submission:
n = int(input())
brick = list(map(int, input().split()))
cnt = 0
i = 0
j = 1
while i < n:
    if brick[i] == j:
        cnt += 1
        j += 1
    i += 1
if cnt == 0:
    print(-1)
else:
    print(n - cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
brick = list(map(int, input().split()))
cnt = 0
def Break(brick, i):
    if len(brick) == 0:
        return
    else:
        if i not in brick:
            return
        else:
            j = brick.index(i)
            brick = [brick[k] for k in range(j+1, len(brick))]
            global cnt
            cnt += 1
            Break(brick, i + 1)
Break(brick, 1)
if cnt == 0:
    print(-1)
else:
    print(n - cnt)
Problem p02773 (python)

Fixed submission:
def contest(N, str):
    count = {}

    for s in str:
        if s not in count:
            count[s] = 1

        else:
            count[s] +=  1
    
    ret = sorted(count.items(),key=lambda count: count[1], reverse=True)
    maxnum = ret[0][1]
    
    retVal = []

    for r in ret:
        if r[1] == maxnum:
            retVal.append(r[0])
            
        else:
            break

    result = '\n'.join(sorted(retVal))

    return result


if __name__ == "__main__":
    N = int(input())
    S = []

    for i in range(N):
        S.append(input())

    print(contest(N, S))

Buggy submission (verdict: Runtime Error):
def contest(N, str):
    count = {}

    for s in str:
        if s not in count:
            count[s] = 1

        else:
            count[s] +=  1
    
    ret = sorted(count.items(),key=lambda count: count[1], reverse=True)
    maxnum = ret[0][1]
    
    retVal = []

    for r in ret:
        if r[1] == maxnum:
            retVal.append(r[0])
            
        else:
            break

    result = '\n'.join(sorted(retVal))

    return result


if __name__ == "__main__":
    N = int(input())
    S = []

    for i in range(N):
        S.append(input())

    print(contest(N, str))
Problem p02831 (python)

Fixed submission:
import fractions

A,B = map(int,input().split())

# 最小公約数
gcd = fractions.gcd(A,B)
# 最小公倍数
lcm = int(A*B/gcd)
print(lcm)

Buggy submission (verdict: Runtime Error):
import math

A,B = map(int,input().split())

# 最小公約数
gcd = math.gcd(A,B)
# 最小公倍数
lcm = int(A*B/gcd)
print(lcm)
Problem p02771 (python)

Fixed submission:
n = set(map(int, input().split()))
if len(n) == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]

T = sorted(list(set(S)))
U = [S.count(T[i]) for i in range(len(T))]

for i in range(len(T)):
    if S.count(T[i]) == max(U):
        print(T[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]

T = sorted(list(set(S)))
U = [S.count(T[i]) for i in range(len(T))]

for i in range(len(T)):
    if S.count(T[i]) == max(U):
        print(T[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]

T = set(S)
U = list(T)
V = [S.count(U[i]) for i in range(len(T))]

for i in range(len(T)):
    if S.count(U[i]) != max(V):
        U[i] = ''

for i in range(len(T)):
    if U[i] != '':
        print(U[i])

Buggy submission (verdict: Runtime Error):
import math
A, B, C = map(int, input().split())
if math.gcd(A, math.gcd(B, C)) == max(A, B, C):
    print('No')
else:
    print('Yes')
Problem p02897 (python)

Fixed submission:
N  = int(input())
s = [float(i) for i in range(1,N + 1)]
cnt =0.0
for i in s:
    if i % 2 != 0:
        cnt += 1
tmp = float(len(s))
print(float(cnt/tmp))

Buggy submission (verdict: Runtime Error):
N  = int(input())
s = [float(i) for i in range(1,N + 1)]
cnt =0.0
for i in s:
    if i % 2 != 0:
        cnt += 1
print(float(cnt/tmp))
Problem p02933 (python)

Fixed submission:
a= int(input())
s = input()
if 3200 <= a:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a= map(int, input().split())
s = input()
if 3200 <= a:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a= map(int, input().split())
s = input()
if a <= 3200:
    print(s)
else:
    print('red')
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
s = A - B
test = C - s
if test <=  0:
    test = 0
print(test)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = True
for i in range(1,len(H)):
    if (H[i-1] - H[i]) == 1:
        H[i-1] -= 1
    elif (H[i-1] - H[i]) <= 0:
        continue
    else:
        ans = False
        break
H.reverse()
for i in range(1,len(H)):
    if H[i-1]-H[i] >=  0:
        pass
    else:
        ans = False
        break
if ans:
    print("Yes")
else:
    print("No")
Problem p03011 (python)

Fixed submission:
import itertools
a= list(map(int, input().split()))
result = []
test = list(itertools.permutations(a, 2))
for i in range(len(test)):
    result.append(test[i][0] + test[i][1])
print(min(result))

Buggy submission (verdict: Runtime Error):
import itertools
a= list(map(int, input().split()))
result = []
test = list(itertools.permutations(a, 2))
for i in range(test):
    result.append(test[i][0] + test[i][1])
print(min(result))
Problem p03075 (python)

Fixed submission:
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] <= k:
            result +=1
    else:
        if data[i][0] - data[i][1] <= k:
            result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e)
data = list(itertools.combinations(seq,2))
print(data)
result = 0
for i in range(len(data)):
    if data[i][0] < data[i][1]:
        if data[i][1] - data[i][0] < k:
        result +=1
    else:
        if data[i][0] - data[i][1] < k:
        result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
seq = (a,b,c,d,e,f)
data = list(itertools.combinations(seq,2))
result = 0
for i in range(len(data)):
    if data[i][0] - data[i][1] < k:
        result +=1
if result == len(data):
    print('Yay!')
else:
    print(':(')
Problem p02777 (python)

Fixed submission:
T,S = input().split()
A,B = map(int,input().split())
U = input()
Z = [A+[0,-1][U == T],B+[0,-1][U == S]]
O = map(str,Z)
agy = ' '.join(O)
print(agy)

Buggy submission (verdict: Runtime Error):
T,S = map(str,input().split())
A,B = map(int,input().split())
U = input()
Z = [A+[0,-1][U == T],B+[0,-1][U == S]]
P = " ".join(Z)
print(P)
Problem p02790 (python)

Fixed submission:
a,b = map(int,input().split())
C = min(a,b)
D = max(a,b)
print(str(C)*D)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
A = list(str(a)*b,), B = list(str(b)*a)
C = max(len(A),len(B))
for i in range(C)
  if A[i] > B[i]:
  　　　　print(str(B))
         break
  elif B[i] > A[i]:
         print(str(A))
         break

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
A = list(str(a)*b,) B = list(str(b)*a)
C = max(len(A),len(B))
for i in range(C)
  if A[i] > B[i]:
  　　　　print(str(B))
         break
  elif B[i] > A[i]:
         print(str(A))
         break

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
A = list(str(a)*b,) B = list(str(b)*a)
C = max(len(A),len(B))
for i in range(C)
  if A[i] > B[i]:
  　　　　print(str(B))
         break
  elif B[i] > A[i]:
         print(str(A))
         break
Problem p02829 (python)

Fixed submission:
S = {1,2,3}
A = {int(input())}
B = {int(input())}
C = S - A - B
V = C.pop()
print(V)

Buggy submission (verdict: Runtime Error):
S = {1,2,3}
A = tuple(int(input()))
B = tuple(int(input()))
print(int(S-A-B))
Problem p02835 (python)

Fixed submission:

A = list(map(int,input().split()))
if sum(A) <= 21:
    print("win")
else:
    print("bust")

Buggy submission (verdict: Runtime Error):
A = list(map(int,input.split()))
if sum(A) <= 21:
    print("win")
else:
    print("bust")
Problem p02880 (python)

Fixed submission:
N = int(input())
t = 0
for i in range(1,10):
  if N % i == 0:
    if N / i >= 10:
      continue
    else:
      t = 1
      break
  else:
    continue
if t >0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

  import sympy
A= sympy.factorint(int(input()))
X = list(A)
E = max(X)
if sum(list(A.values()))>2:
  print("NO")
elif E > 9:
  print("No")
else:
  print("Yes")
Problem p02897 (python)

Fixed submission:
S = int(input())
if S%2==0:
    print(0.5)
else:
    print(((S+1)/2)/S)

Buggy submission (verdict: Runtime Error):
S = int(input())
if S%2==0:
    print(0.5)
else:
    print(((N+1)/2)/N)

Buggy submission (verdict: Runtime Error):
S = int(input())
if S%2=0:
    print(0.5)
else:
    print(((N+1)/2)/N)
Problem p02916 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  A[i]-1 > len(C):
        continue
    elif A[i] == a+1 and A[i] != 1:
        r += C[a-1]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  i-1 > len(C)-1 or [A[i-1]-1] >len(C)-1:
        continue
    elif A[i] == a+1 :
        r += C[A[i-1]-1]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  i-1 > len(C)-1:
        continue
    elif A[i] == a+1 :
        r += C[A[i-1]-1]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i-1]]
    if A[i] == a+1 and C[i] in C:
        r += C[i]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]]
    if A[i] == a+1: and C[i] in C
        r += C[i]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]]
    if A[i] == a+1:
        r += C[i]
    a = A[i]
print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N)
    r += B[A[i]]
    if A[i] == a+1:
        r += C[i]
    a = A[i]
print(r)
Problem p02933 (python)

Fixed submission:
a  = int(input())
s = str(input())
if a >= 3200 :
    print(s)
else :
    print("red")

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
if a >= 3200
    print(s)
else 
    print("red")

Buggy submission (verdict: Runtime Error):
if a >=3200
    print(s)
else 
    print("red")

Buggy submission (verdict: Runtime Error):
if a ＞＝　3200
    print(s)
elif
    print("red")
Problem p02951 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a - b > c:
    print(0)
else:
    print(c-a+b)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a - b > c
    print(0)
else
    print(c-a+b)
Problem p02970 (python)

Fixed submission:
N,D = map(int,input().split())
 
if N % (D*2 + 1 ) == 0:
    print(round(N/(D*2 + 1)))
else :
    print(round(N//(D*2 + 1)+1))

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

if N & (D*2 + 1 ) = 0:
    print(N/(D*2 + 1))
else :
    print(round(N//(D*2 + 1)+1))
Problem p02987 (python)

Fixed submission:
a = list(map(str,input()))
if a[0] == a[1] and a[2] == a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] == a[3] and a[1] == a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] == a[2] and a[1] == a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(str,input()))
if a[0] = a[1] and a[2] = a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] = a[3] and a[1] = a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] = a[2] and a[1] = a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a > k:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
a=input()
b = input()
c = input()
d = input()
e = input()
k = input()
if e - a > k:
  print("Yay!")
else:
  print(":(")