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

Fixed submission:
def solve():
    n = int(input())
    A = [0] + list(map(int, input().split()))
    for i in range(n // 2, 0, -1):
        t = len([1 for k in range(i, n + 1, i) if A[k] == 1]) & 1
        if A[i] != t:
            A[i] = 1 - A[i]
    print(sum(A))
    print(*list(i for i in range(1, n + 1) if A[i]))
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    n = int(input())
    A = list(map(int, input().split()))
    for i in range(n // 2, 1, -1):
        cnt = 0
        for j in range(n // i, 1, -1):
            if A[i] != (len([1 for k in range(i, n + 1, j) if A[k] == 1]) & 1):
                A[i] = 1 - A[i]
                cnt += 1
        if cnt > 1:
            print(-1)
            return
    if A[0] != (sum(A) & 1):
        A[0] = 1 - A[0]
    print(sum(A))
    print(*list(A[i] for i in range(n) if A[i]))
solve()
Problem p02995 (python)

Fixed submission:
from fractions import gcd
from math import ceil
lcm = lambda x, y: x * y // gcd(x, y)
def solve():
    a, b, c, d = map(int, input().split())
    if c == 1 or d == 1:
        return 0
    def f(x):
        return len(range(ceil(a / x) * x, b + 1, x))
    C = f(c)
    if c == d:
        return b - a + 1 - C
    D = f(d)
    cd = lcm(c, d)
    CD = f(cd)
    return b - a + 1 - (C + D - CD)
print(solve())

Buggy submission (verdict: Runtime Error):
from math import *
lcm = lambda x, y: x * y // gcd(x, y)
def solve():
    a, b, c, d = map(int, input().split())
    C = len(range(ceil(a / c) * c, b + 1, c))
    D = len(range(ceil(a / d) * d, b + 1, d))
    cd = lcm(c, d)
    CD = len(range(ceil(a / cd) * cd, b + 1, cd))
    print(b - a + 1 - (C + D - CD))
solve()
Problem p03006 (python)

Fixed submission:
from collections import defaultdict
from itertools import permutations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    if n == 1:
        return 1
    m = defaultdict(int)
    for i, j in permutations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
    return n - max(m.items(), key=lambda x: x[1])[1]
print(solve())

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import permutations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    m = defaultdict(int)
    for i, j in permutations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
    print(n - max(m.items(), key=lambda x: x[1])[1])
solve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import combinations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    m = defaultdict(int)
    for i, j in combinations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
        m[(XY[j][0] - XY[i][0], XY[j][1] - XY[i][1])] += 1
    print(n - max(m.items(), key=lambda x: x[1])[1])
solve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import combinations
def solve():
    n = int(input())
    XY = [list(map(int, input().split())) for _ in range(n)]
    m = defaultdict(int)
    for i, j in combinations(range(n), 2):
        m[(XY[i][0] - XY[j][0], XY[i][1] - XY[j][1])] += 1
    print(n - max(m.items(), key=lambda x: x[1])[1])
solve()
Problem p03014 (python)

Fixed submission:
def solve():
    h, w = map(int, input().split())
    S = list(input() + '#' for _ in range(h)) + ['#' * (w + 1)]
    H = [[0] * w for _ in range(h + 1)]
    W = [[0] * w for _ in range(h + 1)]
    for r in range(h):
        c = 0
        while c < w:
            if S[r][c] == '.':
                t = S[r][c:].find('#')
                for j in range(c, c + t):
                    W[r][j] = t
                c += t
            c += 1
    for c in range(w):
        r = 0
        while r < h:
            if S[r][c] == '.':
                t = r + 1
                cnt = 1
                while S[t][c] == '.':
                    t += 1
                    cnt += 1
                for i in range(r, t):
                    H[i][c] = cnt
                r = t
            r += 1
    ans = 0
    for r in range(h):
        for c in range(w):
            ans = max(ans, H[r][c] + W[r][c] - 1)
    print(ans)
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    h, w = map(int, input().split())
    S = list(input() + '#' for _ in range(h)) + ['#' * (w + 1)]
    H = [[0] * w for _ in range(h + 1)]
    W = [[0] * w for _ in range(h + 1)]
    def f(r, c, num):
        if W[r][c] == 0:
            if c < w and S[r][c + 1] == '.':
                W[r][c] = f(r, c + 1, num + 1)
            else:
                W[r][c] = num
        return W[r][c]
    def g(r, c, num):
        if H[r][c] == 0:
            if r < h and S[r + 1][c] == '.':
                H[r][c] = g(r + 1, c, num + 1)
            else:
                H[r][c] = num
        return H[r][c]
    ans = 0
    for r in range(h):
        for c in range(w):
            if S[r][c] == '.':
                ans = max(ans, f(r, c, 1) + g(r, c, 1) - 1)
    print(ans)
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    h, w = map(int, input().split())
    S = list(input() + '#' for _ in range(h)) + ['#' * (w + 1)]
    H = [[0] * w for _ in range(h + 1)]
    W = [[0] * w for _ in range(h + 1)]
    def f(r, c, num):
        if W[r][c] == 0:
            if c < w and S[r][c + 1] == '.':
                W[r][c] = f(r, c + 1, num + 1)
            else:
                W[r][c] = num
        return W[r][c]
    def g(r, c, num):
        if H[r][c] == 0:
            if r < h and S[r + 1][c] == '.':
                H[r][c] = g(r + 1, c, num + 1)
            else:
                H[r][c] = num
        return H[r][c]
    ans = 0
    for r in range(h):
        for c in range(w):
            if S[r][c] == '.':
                ans = max(ans, f(r, c, 1) + g(r, c, 1) - 1)
    print(ans)
solve()
Problem p03023 (python)

Fixed submission:
print((int(input()) - 2) * 180)

Buggy submission (verdict: Runtime Error):
print((int(input() - 2) * 180)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)
def solve():
    n = int(input())
    ans = [-1] * (n + 1)
    li = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        li[u].append((v, w))
        li[v].append((u, w))
    def f(i, ans, c):
        if li[i] == []:
            return
        for u, w in li[i]:
            if ans[u] == -1:
                if w % 2 == 0:
                    ans[u] = c
                    f(u, ans, c)
                else:
                    ans[u] = c ^ 1
                    f(u, ans, c ^ 1)
    for i in range(1, n):
        if li[i] != [] and ans[i] == -1:
            ans[i] = 0
            f(i, ans, 0)
    print(*ans[1:], sep="\n")
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    n = int(input())
    ans = [-1] * (n + 1)
    li = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        li[u].append((v, w))
        li[v].append((u, w))
    def f(i, ans, c):
        if li[i] == []:
            return
        for u, w in li[i]:
            if ans[u] == -1:
                if w % 2 == 0:
                    ans[u] = c
                    f(u, ans, c)
                else:
                    ans[u] = c ^ 1
                    f(u, ans, c ^ 1)
    for i in range(1, n):
        if li[i] != [] and ans[i] == -1:
            ans[i] = 0
            f(i, ans, 0)
    print(*ans[1:], sep="\n")
solve()

Buggy submission (verdict: Runtime Error):
def solve():
    n = int(input())
    ans = [-1] * (n + 1)
    li = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        li[u].append((v, w))
        li[v].append((u, w))
    def f(i, ans, c):
        for u, w in li[i]:
            if ans[u] == -1:
                if w % 2 == 0:
                    ans[u] = c
                    f(u, ans, c)
                else:
                    ans[u] = c ^ 1
                    f(u, ans, c ^ 1)
    for i in range(1, n):
        if li[i] != [] and ans[i] == -1:
            ans[i] = 0
            f(i, ans, 0)
    print(*ans[1:], sep="\n")
solve()
Problem p03085 (python)

Fixed submission:
m = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}
print(m[input()])

Buggy submission (verdict: Runtime Error):
m = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}
print(m[input())
Problem p03109 (python)

Fixed submission:
print("Heisei" if input() <= "2019/04/30" else "TBD")

Buggy submission (verdict: Runtime Error):
print("Heisei" if input() <= 2019/04/30 else "TBD")
Problem p03229 (python)

Fixed submission:
def solve():
    n = int(input())
    a = sorted(int(input()) for _ in range(n))
    c0 = n // 2 - 1
    c1 = n // 2
    c2 = n // 2 + 1
    ans = 0
    if n & 1:
        for i in range(c0):
            ans -= a[i] * 2
        for i in range(c2 + 1, n):
            ans += a[i] * 2
        ans += -a[c0] + a[c2] + max(-a[c0] + a[c1], - a[c1] + a[c2])
    else:
        for i in range(c0):
            ans -= a[i] * 2
        for i in range(c1 + 1, n):
            ans += a[i] * 2
        ans += -a[c0] + a[c1]
    return ans
print(solve())

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(input()) for _ in range(n)]
def f(x):
    cnt = 0
    for i in range(len(x) - 1):
        cnt += abs(x[i] - x[i + 1])
    return cnt
ans = []
for B in permutations(A):
    ans.append((f(B), B))
ans.sort(reverse=True)
print(ans[0][0])
Problem p03473 (python)

Fixed submission:
print(48 - int(input()))

Buggy submission (verdict: Runtime Error):
print(24 - int(input())
Problem p03543 (python)

Fixed submission:
n = list(input())
print("Yes" if min(len(set(n[:3])), len(set(n[1:]))) == 1 else "No")

Buggy submission (verdict: Runtime Error):
n = list(input())
print("Yes" if min(len(set(n[:3])), len(set(n[1:])) == 1 else "No")
Problem p02760 (python)

Fixed submission:
x = [input().split() for i in range(3)]
N = int(input())
b = [int(input()) for n in range(N)]
l = [[0]*3, [0]*3, [0]*3]
for val in b:
    for i in range(3):
        for j in range(3):
            if val == int(x[i][j]):
                l[i][j] = 1
if l[0][0] + l[0][1] + l[0][2] == 3:
    print('Yes')
elif l[1][0] + l[1][1] + l[1][2] == 3:
    print('Yes')
elif l[2][0] + l[2][1] + l[2][2] == 3:
    print('Yes')
elif l[0][0] + l[1][0] + l[2][0] == 3:
    print('Yes')
elif l[0][1] + l[1][1] + l[2][1] == 3:
    print('Yes')
elif l[0][2] + l[1][2] + l[2][2] == 3:
    print('Yes')
elif l[0][0] + l[1][1] + l[2][2] == 3:
    print('Yes')
elif l[0][2] + l[1][1] + l[2][0] == 3:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x = [input().split() for i in range(3)]
N = int(input())
b = [int(input()) for n in range(N)]
l = [[0]*3, [0]*3, [0]*3]
for val in b:
    for i in range(3):
        for j in range(3):
            if val == int(x[i][j]):
                l[i][j] = 1
if l[0][0] + l[0][1] + l[0][2] == 3:
    print('Yes')
elif l[1][0] + l[1][1] + l[1][2] == 3:
    print('Yes')
elif l[2][0] + l[2][1] + l[2][2] == 3:
    pritn('Yes')
elif l[0][0] + l[1][0] + l[2][0] == 3:
    print('Yes')
elif l[0][1] + l[1][1] + l[2][1] == 3:
    print('Yes')
elif l[0][2] + l[1][2] + l[2][2] == 3:
    print('Yes')
elif l[0][0] + l[1][1] + l[2][2] == 3:
    print('Yes')
elif l[0][2] + l[1][1] + l[2][0] == 3:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x = [input().split() for i in range(3)]
N = int(input())
b = [int(input()) for n in range(N)]
l = [[0]*3, [0]*3, [0]*3]
for val in b:
    for i in range(3):
        for j in range(3):
            print(val)
            if val == int(x[i][j]):
                l[i][j] = 1
if l[0][0] + l[0][1] + l[0][2] == 3:
    print('Yes')
elif l[1][0] + l[1][1] + l[1][2] == 3:
    print('Yes')
elif l[2][0] + l[2][1] + l[2][2] == 3:
    pritn('Yes')
elif l[0][0] + l[1][0] + l[2][0] == 3:
    print('Yes')
elif l[0][1] + l[1][1] + l[2][1] == 3:
    print('Yes')
elif l[0][2] + l[1][2] + l[2][2] == 3:
    print('Yes')
elif l[0][0] + l[1][1] + l[2][2] == 3:
    print('Yes')
elif l[0][2] + l[1][1] + l[2][0] == 3:
    print('Yes')
else:
    print('No')
Problem p02789 (python)

Fixed submission:
N, M = map(int, input().split())
if M == N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
if M == N:
    print("Yes")
else:
    Print("No")

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
if N == M:
    print("Yes")
else:
    Print("No")
Problem p03796 (python)

Fixed submission:
N = int(input())
P = 1
for n in range(1,N + 1):
    P = (P * n) % ((10**9)+7)
print(P)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = 1
for n in range(1,N + 1):
    P = P * n
print(P %% ((10**9) + 7))
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N > K:
    total = K*X + (N-K)*Y
    print(total)
else:
    total = N*X
    print(total)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
total = K*X + (N-K)*Y
print(total)
Problem p04012 (python)

Fixed submission:
w = input()
w_list = list(w)
w_set = set(w_list)
for val in w_set:
    if w_list.count(val) % 2 == 0:
        continue
    else:
        print('No')
        break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
w = input()
w_list = list(w)
w_set = set(w_list)
for val in w_set:
    if w_list.count(val) % 2 == 0:
        continue
    else:
        print('No')
        break
else:
    continue
    print('Yes')
Problem p04043 (python)

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

if A*B*C == 5*5*7:
    print('YES')
else:
    print('NO')

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

if A * B * C == 5 * 5 * 7:
    print('Yes')
else:
    pritn('No')
Problem p02742 (python)

Fixed submission:
from decimal import Decimal
import sys
n = list(map(int, input().split()))

if n[0] == 1 or n[1] == 1:
    print(1)
    sys.exit()

if n[0] % 2 == 0:
    print(Decimal(int((n[0]/2)*n[1])))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(Decimal(int(n[0]*(n[1]/2))))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(Decimal(int(a+b)))
        sys.exit()

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

if n[0] == 1 or n[1] == 1:
    print(0)

if n[0] % 2 == 0:
    print(int((n[0]/2)*n[1])
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(int(n[0]*(n[1]/2)))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(int(a+b))
        sys.exit()
Problem p02817 (python)

Fixed submission:
n = input().split()

ans = str(n[1])+str(n[0])

print(ans)

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

ans = str(n[0])+str(n[1])

print(ans)
Problem p02911 (python)

Fixed submission:
import numpy as np

n = list(map(int, input().split()))

a = []

for i in range(n[2]):
    a.append(int(input()))

if n[1] > n[2]:
    for c in range(n[0]):
            print('Yes')

else:
    m = [n[1]]*n[0]

    x = np.array(m)
    x -= n[2]
    for j in range(n[2]):
        x[a[j]-1] += 1

    for num in range(n[0]):
        if x[num] <= 0:
            print('No')
        else:
            print('Yes')

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

n = list(map(int, input().split()))

a = []

for i in range(n[2]):
    a.append(int(input()))

if n[1] > n[2]:
    for c in range(n[0):
            print('Yes')

else:
    m = [n[1]]*n[0]

    x = np.array(m)
    for j in range(n[2]):
        x -= 1
        x[a[j]-1] += 1

    for num in range(n[0]):
        if x[num] <= 0:
            print('No')
        else:
            print('Yes')

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

n = list(map(int, input().split()))

if n[1] > n[2]:
    for c in range(n[0):
            print('Yes')
else:
    a = []

    for i in range(n[2]):
        a.append(int(input()))

    m = [n[1]]*n[0]

    x = np.array(m)
    for j in range(n[2]):
        x -= 1
        x[a[j]-1] += 1

    for num in range(n[0]):
        if x[num] <= 0:
            print('No')
        else:
            print('Yes')
Problem p02927 (python)

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

ans = 0

for j in range(i[0]):
    for k in range(i[1]):
        k += 1
        if len(str(k)) >= 2:
            k = str(k)
            if (int(k[-1])>=2)and(int(k[-2])>=2):
                if j+1 == int(k[-1])*int(k[-2]):
                    #print(j+1,int(k[-1]),int(k[-2]))
                    ans += 1
            k = int(k)
        k -= 1

        
print(ans)

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
a  = list(map(int,input().split()))

b = []

for i in range(nk[1]):
    b += a

def bubble_sort(A):
    cnt = 0
    for j in range(len(A)):
        for l in range(len(A)-1, j, -1):
            if A[l] < A[l-1]:
                A[l], A[l-1] = A[l-1], A[l]

                cnt += 1
    return int(cnt)

ans = bubble_sort(b) % 1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
a  = list(map(int,input().split()))

b = []

for i in range(nk[1]):
    b += a

def bubble_sort(A):
    cnt = 0
    for j in range(len(A)):
        for l in range(len(A)-1, j, -1):
            if A[l] < A[l-1]:
                A[l], A[l-1] = A[l-1], A[l]

                cnt += 1
    return int(cnt)

ans = bubble_sort(b)
ans = ans % 1000000007
print(ans)
Problem p02760 (python)

Fixed submission:

#a.append(list(map(int, input().split())))
#b.append(list(map(int, input().split())))
#c.append(list(map(int, input().split())))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))


count = int(input())

for num in range(count):
    x = int(input())
    for y in range(3):
        if a[y] == x:
            a[y] = 0
    for y in range(3):
        if b[y] == x:
            b[y] = 0
    for y in range(3):
        if c[y] == x:
            c[y] = 0

#ans = 0
#ans = a[0] * a[1] * a[2]
#ans += b[0] * b[1] * b[2]
#ans += c[0] * c[1] * c[2]
#ans += a[0] * b[0] * c[0]
#ans += a[1] * b[1] * c[1]
#ans += a[2] * b[2] * c[2]

#if ans == 0:
#    print("Yes")
if a[0]+a[1]+a[2] == 0:
    print("Yes")
elif b[0]+b[1]+b[2] == 0:
    print("Yes")
elif c[0]+c[1]+c[2] == 0:
    print("Yes")
elif a[0] + b[0] + c[0] ==0:
    print("Yes")
elif a[1] + b[1] + c[1] ==0:
    print("Yes")
elif a[2] + b[2] + c[2] ==0:
    print("Yes")
elif a[0] + b[1] + c[2] == 0:
    print("Yes")
elif a[2] + b[1] + c[0] ==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

#a.append(list(map(int, input().split())))
#b.append(list(map(int, input().split())))
#c.append(list(map(int, input().split())))
a= list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))


count = int(input())

for num in range(count):
    x = int(input())
    for y in range(3):
        if a[y] == x:
            a[y] = 0
    for y in range(3):
        if b[y] == x:
            b[y] = 0
    for y in range(3):
        if c[y] == x:
            c[y] = 0

#ans = 0
#ans = a[0] * a[1] * a[2]
#ans += b[0] * b[1] * b[2]
#ans += c[0] * c[1] * c[2]
#ans += a[0] * b[0] * c[0]
#ans += a[1] * b[1] * c[1]
#ans += a[2] * b[2] * c[2]

#if ans == 0:
#    print("Yes")
if a[0]+a[1]+a[2] == 0:
    print("Yes")
elif b[0]+b[1]+b[2] == 0:
    print("Yes")
elif c[0]+c[1]+c[2] == 0:
    print("Yes")
elif a[0] + b[0] + c[0] ==0:
    print("Yes")
elif a[1] + b[1] + c[1] ==0:
    print("Yes")
elif a[2] + b[2] + c[2] ==0:
    print("Yes")
elif a[0] + b[1] + c[2] == 0:
    print("Yes")
elif a[2] + b[1] + c[0] ==0:
    pritn("Yes")
else:
    print("No")
Problem p02732 (python)

Fixed submission:
n = int(input())
l =  input()
s= l.split(" ")
for i in range(len(s)):
    s[i] = int(s[i])
v = dict()
sumi = 0
for i in s:
    if not i in v:
        v[i] = 1
    else:
        v[i]+=1
for i in v:
    if v[i]>=2:
        sumi+=v[i]*(v[i]-1)/2
for i in s:
    if v[i]>=2:

        if v[i]==2:
            print(int(sumi-1))
        else:
            print(int(sumi-v[i]*(v[i]-1)/2+(v[i]-2)*(v[i]-1)/2))
    else:
        print(int(sumi))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
s = list(map(int , input().split()))
v = defaultdict(int)
sumi = 0
for i in s:
    v[i]+=1
for i in v:
    if v[i]>=2:
        sumi+=v[i]*(v[i]-1)/2
for i in s:
    if v[i]>=2:

        if v[i]==2:
            print(int(sumi-1))
        else:
            print(int(sumi-v[i]*(v[i]-1)/2+(v[i]-2)*(v[i]-1)/2))
    else:
        print(int(sum))
Problem p03076 (python)

Fixed submission:
import math
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
def ceil(src, range):
  return ((int)(src / range) + 1 ) * range
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
    t=min(x)
  if s<10:
    y.append(10)
  elif s%10==0:
    y.append(s)
  else:
    y.append(ceil(s,10))
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
def ceil(src, range):
  return ((int)(src / range) + 1 ) * range
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
  y.append(ceil(s,10))
t=min(x)
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
  y.append(round(s,-1))
t=min(x)
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)
Problem p03433 (python)

Fixed submission:
N=int(input())
A=int(input())
if N%500>A:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N,A = map(int,input().split())
if N%500>A:
  print('No')
else:
  print('Yes')
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split())
if a*b%2==0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a*b%2=0:
  print('Even')
else:
  print('Odd')
Problem p02731 (python)

Fixed submission:
import decimal
decimal.getcontext().prec = 20
S = decimal.Decimal(input()) 
s = S/3
print(decimal.Decimal(s**3))

Buggy submission (verdict: Runtime Error):
import decimal
getcontext().prec = 20
S = decimal.Decimal(input()) 
s = S/3
print(decimal.Decimal(s**3))
Problem p02732 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d={}
ans=0
for i in l:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
for i in d.keys():
    x=d[i]*(d[i]-1)//2
    ans+=x
for i in l:
    if d[i]>2:
        print(ans-(d[i]*(d[i]-1)//2)+((d[i]-1)*(d[i]-2)//2))
    elif d[i]==2:
        print(ans-1)
    else:
        print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
d={}
d1={}
ans=0
for i in l:
    if i not in d:
        d[i]=1
        d1[i]=1
    else:
        d[i]+=1
        d1[i]*=d[i]
for i in d1.keys():
    x=d1[i]//(d[i]*(d[i]-1))
    d1[i]=d1[i]//(2*x)
    ans+=d1[i]
for i in l:
    if d[i]>2:
        print(ans-d1[i]+(d1[i]*(abs(d[i]-2))//d[i]))
    elif d[i]==2:
        print(ans-1)
    else:
        print(ans)