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

Fixed submission:
input()
num_list = list(map(int, input().split()))
min_cnt = 999
for num in num_list:
  num_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: min_cnt = num_cnt
      break
    else:
      num = num / 2
      num_cnt += 1
print(min_cnt)

Buggy submission (verdict: Runtime Error):
input()
num_list = list(map(int, input().split()))
min_cnt = 0
for num in num_list:
  min_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: min_cnt = num_cnt
      break
    else:
      num = num / 2
      min_cnt += 1
print(min_cnt)

Buggy submission (verdict: Runtime Error):
input()
num_list = list(map(int, input().split()))
min_cnt = 0
for num in num_list:
  min_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: max_cnt = num_cnt
      break
    else:
      num = num / 2
      min_cnt += 1
print(min_cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
max_cnt = 0
num_list = [] 
for i in range(n):
  num_list.append(int(input()))
for num in num_list:
  num_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt > max_cnt: max_cnt = num_cnt
      break
    else:
      num = num / 2
      num_cnt += 1
print(max_cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
max_cnt = 0
num_list = [] 
for i in range(n):
  num_list.append(int(input()))

for num in num_list:
  num_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt > max_cnt: max_cnt = num_cnt
      break
    else:
      num = num / 2
      num_cnt += 1
print(max_cnt)
Problem p02837 (python)

Fixed submission:
n = int(input())
a = {}
xy = {}
for i in range(n):
    a[i] = int(input())
    xy[i] = {}
    for j in range(a[i]):
        xy[i][j] = list(map(int,input().split()))
ans = []
for i in range(2 ** n):
    flag = []
    k_low = bin(i)[2:]
    if len(k_low) < n:
        k_low = "0" * (n-len(k_low)) + k_low
    for k in k_low:
        flag.append(int(k))
    mujun = 0
    for x in range(len(xy)):
        if flag[x] == 1:
            for y in range(len(xy[x])):
                if flag[xy[x][y][0]-1] != xy[x][y][1]:
                    mujun = 1
    if mujun == 0:
        ans.append(flag)
sum_list = []
for answer in ans:
    sum_list.append(sum(answer))
print(max(sum_list))

Buggy submission (verdict: Runtime Error):
# c
import numpy as np
n = int(input())
a = {}
xy = {}
for i in range(n):
    a[i] = int(input())
    xy[i] = {}
    for j in range(a[i]):
        xy[i][j] = list(map(int,input().split()))

### 自分についての情報を付け加える
for s in range(n):
    xy[s][a[i]] = [s+1,1]

# pさんによる証言とqさんによる証言を比較する
pq_list = [[0 for inki in range(n)] for jinjin in range(n)]
for p in range(n):
    for q in range(n):
        for l in range(len(xy[p])):
            for m in range(len(xy[q])):
                if xy[p][l][0] == xy[q][m][0] and xy[p][l][1] != xy[q][m][1]:
                    pq_list[p][q] += 1

pq_list = np.array(pq_list)
count = 0
while np.sum(pq_list) >= 1:
    max_index = 0
    for i in range(len(pq_list)):
        if sum(pq_list[max_index]) <= sum(pq_list[i]):
            max_index = i
    if sum(pq_list[max_index]) == 0:
        break
    pq_list = np.delete(pq_list,max_index,0)
    pq_list = np.delete(pq_list, max_index, 1)
    count += 1
    
print(n-count)
Problem p02843 (python)

Fixed submission:
from math import ceil,floor
x = int(input())

lower_sum = ceil(x/105)
upper_sum = floor(x/100)
num_list = list(range(lower_sum, upper_sum+1))

for i in num_list:
    for a in range(i+1):
        for b in range(i+1-a):
            for c in range(i+1-a-b):
                for d in range(i+1-a-b-c):
                    for e in range(i+1-a-b-c-d):
                        for f in range(i+1-a-b-c-d-e):
                            if 100*a + 101*b + 102*c + 103*d + 104*e + 105*f == x:
                                print("1")
                                exit()

print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
seq = list(set(list(s)))
genkai_list = []
for i in range(0,1000):
    if 0 <= i <= 9:
        ap = "00" + str(i)
        genkai_list.append(ap)
    elif 10 <= i <= 99:
        ap = "0" + str(i)
        genkai_list.append(ap)
    else:
        genkai_list.append(str(i))
ans = []
for a in range(len(genkai_list)):
    for i in range(len(s)):
        if s[i] == genkai_list[a][0]:
            for j in range(i + 1, len(s)):
                if s[j] == genkai_list[a][1]:
                    for k in range(j + 1, len(s)):
                        if s[k] == genkai_list[a][2]:
                            ans.append(a)
                            break # break1
                    else:  # break1されなかった場合
                        continue
            else:
                continue # jのループが全部回った（2文字目で一致しなかった）ら、iを次の文字に
    else:
        continue # iのループが全部回った（1文字目で一致しなかった）ら、aを次の文字に
                
print(len(set(ans)))
Problem p02844 (python)

Fixed submission:
n = int(input())
s = list(input())
genkai_list = []
for i in range(0,1000):
    if 0 <= i <= 9:
        ap = "00" + str(i)
        genkai_list.append(ap)
    elif 10 <= i <= 99:
        ap = "0" + str(i)
        genkai_list.append(ap)
    else:
        genkai_list.append(str(i))
count = 0
for a in genkai_list:
    try:
        s_ = s[s.index(a[0])+1:]
        s__ = s_[s_.index(a[1])+1:]
        if a[2] in s__:
            count += 1
    except:
        continue
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
seq = list(set(list(s)))
genkai_list = []
for i in range(0,1000):
    if 0 <= i <= 9:
        ap = "00" + str(i)
        genkai_list.append(ap)
    elif 10 <= i <= 99:
        ap = "0" + str(i)
        genkai_list.append(ap)
    else:
        genkai_list.append(str(i))
ans = []
for a in range(len(genkai_list)):
    for i in range(len(s)):
        if s[i] == avcodelist[a][0]:
            for j in range(i + 1, len(s)):
                if s[j] == avcodelist[a][1]:
                    for k in range(j + 1, len(s)):
                        if s[k] == avcodelist[a][2]:
                            ans.append(a)
print(len(set(ans)))
Problem p02899 (python)

Fixed submission:
# ABC 142 C go to school
n = int(input())
s = list(map(int,input().split()))

# ソートされたリストのインデックスを返す
s = sorted(range(len(s)), key=lambda k:s[k])
ans = [x+1 for x in s]
print(*ans)

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


# ソートされたリストのインデックスを返す
for i in range(len(s)):
    print(sorted(range(len(s)), key=lambda k:s[k])[i] + 1, end=" ")
Problem p02921 (python)

Fixed submission:
# abc139 a
s = input()
t = input()
count = 0
for i in range(len(s)):
    if s[i] == t[i]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
input_list = list(map(int, input().split()))
a = input_list[0]
b = input_list[1]
taps = 0
count = 0
taps += a
count += 1

while taps < b:
    taps += a-1
    count += 1
print(count)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = []
largest = 0
second_largest = 0
for i in range(n):
    temp = int(input())
    if temp > largest:
        largest = temp
    elif largest >= temp > second_largest:
        second_largest = temp
    a.append(temp)

for i in range(n):
    if a[i] == largest:
        print(second_largest)
    else:
        print(largest)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
largest = 0
second_largest = 0
for i in range(n):
    temp = int(input())
    if temp > largest:
        largest = temp
    elif largest >= temp > second_largest:
        second_largest = temp
    else:
        continue
    a.append(temp)

for i in range(n):
    if a[i] == largest:
        print(second_largest)
    else:
        print(largest)
Problem p02988 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n-2):
    if (p[i] > p[i+1] > p[i+2]) | (p[i+2] > p[i+1] > p[i]):
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input()))
count = 0
for i in range(n-2):
    if (p[i] > p[i+1]) & (p[i+2] > p[i+1]):
        count += 1
print(count)
Problem p03434 (python)

Fixed submission:
n = int(input())
input_list = list(map(int, input().split()))
input_list.sort(reverse=True)
# aliceは奇数番目のものを、bobは偶数番目のものをとる
a = 0
b = 0
for i in range(n):
    if (i+1) % 2 == 1:
        a += input_list[i]
    else:
        b += input_list[i]
print(a - b)

Buggy submission (verdict: Runtime Error):
n = input()
input_list = list(map(int, input().split()))
input_list.sort(reverse=True)
# aliceは奇数番目のものを、bobは偶数番目のものをとる
alice = 0
bob = 0
for i in range(n):
    if (i+1) % 2 == 1:
        alice += input_list[i]
    else:
        bob += input_list[i]
print(alice - bob)
Problem p03455 (python)

Fixed submission:
#入力がs_1 s_2
#input_list = input().split() str型ならこれでもいいかも
input_list = list(map(int, input().split()))
test = input_list[0]*input_list[1]%2
if test == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
input_list = input().split()
test = input_list[0]*input_list[1]%2
if test == 0:
    print("Even")
else:
    print("Odd")
Problem p03471 (python)

Fixed submission:
input_list = list(map(int, input().split()))
count = input_list[0]
y = input_list[1]
flag = False
for l in range(count + 1):
    for m in range(count - l + 1):
        n = count - l - m
        if 10000 * l + 5000 * m + 1000 * n == y:
            print(l, m, n)
            flag = True
            break
        if flag:
            break
    if flag:
        break
if flag == False:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
count = list(map(int, input().split()))[0]
y = list(map(int, input().split()))[1]
from math import floor

l_lim = floor(y / 10000)
m_lim = floor(y / 5000)
n_lim = floor(y / 1000)

flag = False
for l in range(l_lim + 1):
    for m in range(m_lim + 1):
        for n in range(n_lim + 1):
            if (l+m+n == count)&(10000 * l + 5000 * m + 1000 * n == y):
                print(l, m, n)
                flag = True
                break
        if flag:
            break
    if flag:
        break
if flag == False:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
count = list(map(int, input().split()))[0]
y = list(map(int, input().split()))[1]
from math import floor
import sys

l_lim = floor(y / 10000)
m_lim = floor(y / 5000)
n_lim = floor(y / 1000)

for l in range(l_lim + 1):
    for m in range(m_lim + 1):
        for n in range(n_lim + 1):
            if (l+m+n == count)&(10000 * l + 5000 * m + 1000 * n == y):
                print(l, m, n)
                sys.exit()
print(-1, -1, -1)
Problem p03545 (python)

Fixed submission:
a = input()
input_list = []
for k in a:
    input_list.append(int(k))
n=3
bag = []
fomul_list = []
for i in range(2 ** n):
    sum = input_list[0]
    fomul = str(input_list[0])
    for j in range(3):
        if (i >> j)&1:
            sum += input_list[j+1]
            fomul = fomul + "+" + str(input_list[j+1])
        else:
            sum -= input_list[j+1]
            fomul = fomul + "-" + str(input_list[j+1])
    bag.append(sum)
    fomul_list.append(fomul)
print(fomul_list[bag.index(7)] + "=7")

Buggy submission (verdict: Runtime Error):
a = input()
input_list = []
for k in a:
    input_list.append(int(k))
ans = []
fomul_list = []
for i in range(2 ** n):
    sum = input_list[0]
    fomul = str(input_list[0])
    for j in range(3):
        if (i >> j)&1:
            sum += input_list[j+1]
            fomul = fomul + "+" + str(input_list[j+1])
        else:
            sum -= input_list[j+1]
            fomul = fomul + "-" + str(input_list[j+1])
    bag.append(sum)
    fomul_list.append(fomul)
print(fomul_list[bag.index(7)])
Problem p02756 (python)

Fixed submission:
from collections import deque
def main():
    S = input()
    S = deque([c for c in S])
    Q = int(input())
    rvCt = 0

    for _ in range(Q):
        query = input().split()
        if query[0] == '1':
            rvCt += 1
        else:
            doReverse = False
            if rvCt % 2 == 1:
                doReverse = True

            if query[1] == '1':
                if doReverse:
                    S.append(query[2])
                else:
                    S.appendleft(query[2])
            else:
                if doReverse:
                    S.appendleft(query[2])
                else:
                    S.append(query[2])

    if rvCt % 2 == 1:
        S.reverse()
    
    print(''.join(S))

main()

Buggy submission (verdict: Runtime Error):
from collections import deque
def main():
    S = input()
    S = deque([c for c in S])
    Q = int(input())
    rvCt = 0

    head, tail = deque([]), deque([])
    for _ in range(Q):
        query = input().split()
        if query[0] == '1':
            rvCt += 1
        else:
            if rvCt % 2 == 1:
                S = head + S + tail
                S.reverse()
                head, tail = deque([]), deque([])
            rvCt = 0
            if query[1] == '1':
                head.appendleft(query[2])
            else:
                tail.append(query[2])

    if rvCt % 2 == 1:
        S = head + S + tail
        S.reverse()
    else:
        S = head + S + tail
    
    print(''.join(S))

main()
Problem p02850 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
G = None
ans = None

def dfs(v, parent_c=-1, parent_id=-1):
    global G, ans
    k = 1
    for i in range(len(G[v])):
        edge_id, to = G[v][i]['edge_id'], G[v][i]['to']
        if to == parent_id: continue
        if k == parent_c: k+=1
        ans[edge_id] = k
        k += 1
        dfs(to, parent_c=ans[edge_id], parent_id=v)

def main():
    global G, ans
    N = int(input())
    G = [[] for _ in range(N)]
    ans = [0 for _ in range(N-1)]
    for edge_id in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        G[a].append({'to': b, 'edge_id': edge_id})
        G[b].append({'to': a, 'edge_id': edge_id})
    
    dfs(0)
    print(max(ans))
    for a in ans:
        print(a)

main()

Buggy submission (verdict: Runtime Error):
G = None
ans = None

def dfs(v, parent_c=-1, parent_id=-1):
    global G, ans
    k = 1
    for i in range(len(G[v])):
        edge_id, to = G[v][i]['edge_id'], G[v][i]['to']
        if to == parent_id: continue
        if k == parent_c: k+=1
        ans[edge_id] = k
        k += 1
        dfs(to, parent_c=ans[edge_id], parent_id=v)

def main():
    global G, ans
    N = int(input())
    G = [[] for _ in range(N)]
    ans = [0 for _ in range(N-1)]
    for edge_id in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        G[a].append({'to': b, 'edge_id': edge_id})
        G[b].append({'to': a, 'edge_id': edge_id})
    
    dfs(0)
    print(max(ans))
    for a in ans:
        print(a)

main()
Problem p02882 (python)

Fixed submission:
import math
def main():
    a, b, x = map(float, input().split())
    thX = a * a * b / 2.0
    if x == (a*a*b):
        print(0)
    elif x <= thX:
        h = 2.0 * x / (a * b)
        deg = math.degrees(math.atan(h / b))
        print(90.0 - deg)
    else:
        c = 2.0 * x / (a*a) - b
        deg = math.degrees(math.atan(a / (b-c)))
        print(90.0 - deg)

main()

Buggy submission (verdict: Runtime Error):
import math
def main():
    a, b, x = map(float, input().split())
    thX = a * a * b / 2.0
    if x <= thX:
        h = 2.0 * x / (a * b)
        deg = math.degrees(math.atan(h / b))
        print(90.0 - deg)
    else:
        c = 2.0 * x / (a*a) - b
        deg = math.degrees(math.atan(a / (b-c)))
        print(90 - deg)

main()
Problem p03162 (python)

Fixed submission:
N = int(input())
H = []
for _ in range(N):
    a, b, c = map(int, input().split())
    H.append([a, b, c])

dp = [[float('inf')] * 3 for _ in range(N+1)]
dp[0] = [0, 0, 0]
for i in range(1, N+1):
    dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + H[i-1][0] 
    dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + H[i-1][1]
    dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + H[i-1][2]
print(max(dp[N]))

Buggy submission (verdict: Runtime Error):
N = int(input())
A, B, C = [], [], []
for _ in range(N):
    a, b, c = map(int, input().split())
    A.append(a)
    B.append(b)
    C.append(c)

def helper(idx, happy, last):
    if idx >= N:
        return happy
    if last == 'a':
        return max(helper(idx+1, happy+B[idx], 'b'), helper(idx+1, happy+C[idx], 'c'))
    elif last == 'b':
        return max(helper(idx+1, happy+A[idx], 'a'), helper(idx+1, happy+C[idx], 'c'))
    else:
        return max(helper(idx+1, happy+A[idx], 'a'), helper(idx+1, happy+B[idx], 'b'))


happy_a = helper(1, A[0], 'a')
happy_b = helper(1, B[0], 'b')
happy_c = helper(1, C[0], 'c')

print(max(happy_a, happy_b, happy_c))
Problem p03288 (python)

Fixed submission:
x=int(input())
if x<1200:
    print("ABC")
elif 1200<=x and x<2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
if x<1200:
    print("ABC")
elif 1200<=x and x<2800:
    print("ARC")
else:
    print("AGC")
Problem p03469 (python)

Fixed submission:
# -*- coding: utf-8 -*-

from datetime import datetime, timedelta

S = str(input())
wrong_day = datetime.strptime(S, '%Y/%m/%d')
correct_day = wrong_day + timedelta(days=365)
print(correct_day.strftime('%Y/%m/%d'))

Buggy submission (verdict: Runtime Error):
mochi_list = []
N = int(input())

for i in range(N):
    mochi_list.append(int(input()))

last_mochi = 101
count = 0

for mochi in sorted(mochi_list, reverse=True):
    if mochi < last_mochi:
        count += 1
    last_mochi = mochi

print(count)
Problem p03485 (python)

Fixed submission:
from math import ceil

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

print(ceil((a + b) / 2))

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
counter = Counter(map(int, input().split()))

sum = 0

for a, cnt in counter.items():
    if a > cnt:
        sum += cnt
    else:
        sum += cnt - a

print(sum)
Problem p02732 (python)

Fixed submission:
from math import factorial
N = int(input())
line = input()
l = []
counts = {}
for n in line.split(' '):
  n = int(n)
  if n not in counts:
    counts[n] = 0
  counts[n] += 1
  l.append(n)

comb = {}

for n in counts:
  comb[n] = 0
  count = counts[n]
  if count > 1:
    comb[n] += int(factorial(count)) // 2 // int(factorial(count - 2))

total = sum([comb[n] for n in comb])

for n in l:
  count = counts[n]
  result = total - comb[n]
  if count - 1 > 1:
    result += comb[n] * (count - 2) // count
  print(result)

Buggy submission (verdict: Runtime Error):
from math import factorial

N = int(input())
line = input()
l = []
counts = {}
for n in line.split(' '):
  n = int(n)
  if n not in counts:
    counts[n] = 0
  counts[n] += 1
  l.append(n)

results = {}

for n in counts:
  results[n] = 0
  for m in counts:
    count = counts[m]
    if m == n:
      count -= 1
    if count > 1:
      results[n] += factorial(count) / 2 / factorial(count - 2) 

for n in l:
  print(int(results[n]))
Problem p02866 (python)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
box = [0 for x in range(max(li)+1)]
for i in li:
    box[i] += 1
count = 1

if len(box) > 2:
    for i in range(1, len(box)-1):
        count *= box[i] ** box[i+1]
        count %= 998244353
else:
    count = 1
    
if box[0] != 1 or li[0] != 0:
    count = 0

print(count % 998244353)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int, input().split()))
li = sorted(li)
count = 1
if  not (1 in li and 0 in li) :
    count = 0
else:
    for i in range(2,max(li) + 1):
        a = li.count(i-1)
        b = li.count(i)
        count *= a ** b
print(count % 998244353)A
Problem p02899 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
li = [0 for i in range(n)]
for i in range(n):
    x = a[i]
    li[x-1] = i + 1
for i in range(n):
    print(li[i], end=" ")

Buggy submission (verdict: Runtime Error):
import math
def gcd(x,y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    if  x % y == 0:
        return y
    else:
        return gcd(y, x%y)

def f(n):
    li = []
    m = n
    while True:
        for i in range(2, n + 1):
            if m % i == 0:
                if not i in li:
                    li.append(i)
                    n = n // i
                    break
                else:
                    n = n // i
                    continue
        else:
            break
    return li

a, b = list(map(int, input().split()))
d = gcd(a, b)
print(len(set(f(d))) + 1)
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
h[0] -= 1
             
if n == 1:
      print("Yes")
else:
      for i in range(n-1):
            if h[i] < h[i+1]:
                  h[i+1] -= 1
      for i in range(n-1):
            if h[i+1] < h[i]:
                  print("No")
                  break
      else:
            print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
         
if n == 1:
	print("Yes")
else:
	for i in range(n-1):
		if h[i+1] < h[i]:
		h[i+1] -= 1
	for i in range(n-1):
		if h[i+1] < h[i]:
  			print("No")
  			break
	else:
		print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
     
if n == 1:
	print("Yes")
else:
    for i in range(n-1):
    	if h[i+1] < h[i]:
        h[i+1] -= 1
    for i in range(n-1):
        if h[i+1] < h[i]:
          print("No")
          break
    else:
        print("Yes")

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

if n == 1:
  print("Yes")
else:
  for i in range(n):
    if h[i+1] < h[i]:
      h[i+1] -= 1
  for i in range(n):
    if h[i+1] < h[i]:
      print("No")
      break
  else:
    print("Yes")
Problem p03059 (python)

Fixed submission:
a,b,t = list(map(int, input().split()))
c = t // a
print(c*b)

Buggy submission (verdict: Runtime Error):
a,b,t = list(map(int,input().split()))
printf(t//a * b)
Problem p03071 (python)

Fixed submission:
a, b = list(map(int,input().split()))
if a == b:
  print(2 * a)
else:
  print(max(a,b) * 2 -1)

Buggy submission (verdict: Runtime Error):
    a,b = list(map(int, input().split()))
    if a == b:
      print(2 * a)
    else:
      print(max(a,b) * 2 - 1)

Buggy submission (verdict: Runtime Error):
a,b = list(map(int, input().split()))
if a == b:
  print(2 * a)
else:
  printf(max(a,b) * 2 - 1)
Problem p03076 (python)

Fixed submission:
li = [int(input()) for i in range(5)]
flag = True
for i in range(5):
    if li[i] % 10 == 0:
        flag = True
    else:
        flag = False
        break

if flag:
    print(sum(li))
else: 
    for i in range(1,10):
        for j in range(5):
            if li[j] % 10 == i:
                a = li[j]
                del li[j]
                break
        else:
            continue
        break

    for i in range(4):
        if li[i] % 10 != 0:
            li[i] = (li[i] // 10 + 1) * 10
    print(sum(li) + a)

Buggy submission (verdict: Runtime Error):
li = [int(input()) for i in range(5)]
for i in range(1,10):
    for j in range(5):
        if li[j] % 10 == i:
            a = li[j]
            del li[j]
            break
    else:
        continue
    break

for i in range(4):
    if li[i] % 10 != 0:
        li[i] = (li[i] // 10 + 1) * 10
print(sum(li) + a)