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

Fixed submission:
X = int(input())

l = range(-10**3,10**3)

for i in l:
  for j in l:
    if i**5 - j**5 == X:
      print(str(i) + " " + str(j))
      exit()

Buggy submission (verdict: Runtime Error):
X = int(input())

l = range(-10**3:10**3)

for i in l:
  for j in l:
    if i**5 - j**5 == X:
      print("i" + " " + "j")
      exit()
Problem p02696 (python)

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

max = int(A*min(B-1,N)/B)
print(max)

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

max - int(a*min(B-1,N)/B)
print(max)
~
Problem p02713 (python)

Fixed submission:
from math import *

K = int(input())

sum = 0
for i in range(K):
  for j in range(K):
    for k in range(K):
      sum += gcd((i+1),gcd((j+1),(k+1)))

print(sum)

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

K = int(input())

sum = 0
for i in range(K):
  for j in range(K):
    for k in range(K):
      sum += gcd(i,gcd(j,k))

print(sum)
return
Problem p02717 (python)

Fixed submission:
x,y,z = map(int,input().split())
l = []

l.append(z)
l.append(x)
l.append(y)

print(*l)

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
l = []

l[0] = z
l[1] = x
l[2] = y

print(l)

Buggy submission (verdict: Runtime Error):
x,y,z = list(map(int,input().split()))
l = []

l[0] = z
l[1] = x
l[2] = y

print(l)
Problem p02718 (python)

Fixed submission:
N,M = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)
a
s = sum(a)

if a[M-1] >= s/(4*M):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)

s = sum(a)

if a[M-1] >= s/4M:
  print("Yes")
else:
  print("No")
  
return

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = sorted(list(map(int,input().split())),reverse=True)

s = sum(a)

if a[M-1] / s >= 1/4M:
  print("Yes")
else:
  print("No")
  
return
Problem p02719 (python)

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

if N % K == 0:
  print(0)
else:
  q = N // K
  d = N - K*q
  print(min(d,abs(d-K)))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)

N,K = map(int,input().split())

def solve(n,k):
  cand = abs(n-k)
  if n <= cand:
    return n
  else:
    return solve(cand,k)

print(solve(N,K))

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

def solve(n,k):
  cand = abs(n-k)
  if n <= cand:
    return n
  else:
    return solve(cand,k)

print(solve(N,K))

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


while abs(N-K) > N:
  N = abs(N-K)
  
print(N)
Problem p02730 (python)

Fixed submission:
S = input()

def judge(x):
  if "".join(list(reversed(x))) == x:
    return True
  else:
    return False
  
def solve(x):
  if judge(x) and judge(x[0:int((len(x)-1)/2)]) and judge(x[int((len(x)+1)/2):]):
    print("Yes")
  else:
    print("No")
    
    
solve(S)

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

def judge(x):
  if "".join(list(reversed(x))) == x:
    return True
  else:
    return False
  
def solve(x):
  if judge(x) and judge(x[0:(len(x)-1)/2]) and judge(x[(len(x)+1)/2:]):
    print("Yes")
  else:
    print("No")
    
    
solve(S)
Problem p02801 (python)

Fixed submission:
C = input()
print(chr(ord(C)+1))

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

min = N*M - sum(a)

ans = -1

if 0 <= min <= K:
  ans = min
elif min < 0:
  ans = 0
  
print(ans)
Problem p02843 (python)

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

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        for i in range(100,106):
            if k-i >= 0 and memo[k-i]:
                return True
        
        return False
    
    for i in range(x):
        memo[i+1] = dp(i+1)
    return memo[x]



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

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

def solve(x):
    memo = [True] + [False]*x
    def dp(k):
        if k < 0:
            return False
        elif memo[k]:
            return True
        for i in range(100,106):
            if dp(k-i):
                memo[k-i] = True
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

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

def solve(x):
    def dp(x):
        if x == 0:
            return True
        elif x < 0:
            return False
        for i in range(100,106):
            if dp(x-i):
                return True
        
        return False

    return dp(x)



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    for j in range(1,x+1)
        if j in memo.keys():
        	return f(memo[j])
    	for i in range(6):
        	if f(j-100-i):
            	memo[j] = True

    return memo[x]

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

@tail_recursive
def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    elif x in memo.keys():
        return f(memo[x])
    for i in range(6):
        if f(x-100-i):
            memo[x] = True
            return True
    return False

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()
Problem p02917 (python)

Fixed submission:
N = int(input())
b = [10**9] + list(map(int,input().split())) + [10**9]
a = []

for i in range(N):
  a.append(min(b[i],b[i+1]))

print(sum(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
b = [10**9] + list(map(int,input().split())) + [10**9]
a = []
a[0] = b[1]
for i in range(1,N-1):
  a[i] == min(b[i-1],b[i])
  
a[N] = b[N-1]
Problem p02922 (python)

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

i = 0
while True:
  if a + (i-1)*(a-1) >= b:
    ans = i
    break
  i += 1

print(ans)

Buggy submission (verdict: Runtime Error):
def solve(a,b):
  def needTaps(a,b,holes=1,res=0):
    if holes >= b:
      return res
    elif:
      return needTaps(a,b,holes+a-1,res+1)
    
  return needTaps(a,b)

a,b=map(int,input().split())
print(solve(a,b))
Problem p02971 (python)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
first = max(a)
f_id = a.index(max(a))
second = max(a[:f_id] + a[f_id+1:])

for i in range(N):
  if a[i] == first:
    print(second)
  else:
    print(first)

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

N = int(input())
a = [int(input()) for _ in range(N)]

def solve(n,a):
  d = Counter(a)
  d_lst = list(sorted(d.keys()))
  first = d_lst[-1]
  second = d_lst[-2]
  if d[first] != 1:
    return [first]*n
  else: # first は一つだけ
    return [second if a[i] == first else first for i in range(n)]

print(*solve(N,a),sep="\n")
Problem p03037 (python)

Fixed submission:
def solve(l,r):
  l_max = max(l)
  r_min = min(r)
  return max(r_min - l_max + 1, 0)
  
N,M = map(int,input().split())
L = [0]*M
R = [0]*M
for i in range(M):
  L[i],R[i] = map(int,input().split())
print(solve(L,R))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10*7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  elif len(c) == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
N,M = map(int,input().split())
L = [0]*M
R = [0]*M
for i in range(M):
  L[i],R[i] = map(int,input().split())
cards = range(1,N+1)
print(solve(cards,L,R,M))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10*7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
N,M = map(int,input().split())
L = [0]*M
R = [0]*M
for i in range(M):
  L[i],R[i] = map(int,input().split())
cards = range(1,N+1)
print(solve(cards,L,R,M))
Problem p03086 (python)

Fixed submission:
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)
if len(l) == 0:
  print(0)
  exit()
      
m = sorted(l, reverse=True, key=len)
print(len(m[0]))

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)

m = sorted(l, key=len)
print(len(m[-1]))
Problem p03110 (python)

Fixed submission:
N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0

  
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(Input())
x,u = [""]*N
for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += x[i] if u[i] == "JPY" else x[i]*380000.0
       
print(sum)
Problem p03231 (python)

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

# from numba import njit
from math import gcd
# input = stdin.readline

def lcm(x,y):
  return x*y//gcd(x,y)

# @njit
def solve(n,m,s,t):
  L = lcm(n,m)
  G = gcd(n,m)
  s_interval = L//n
  t_interval = L//m
  for i in range(G):
    if s[i*n//G] != t[i*m//G]:
      return -1
  return L
  

def main():
  N,M = map(int,input().split())
  s = input()
  t = input()
  print(solve(N,M,s,t))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit
from math import gcd
# input = stdin.readline

def lcm(x,y):
  return x*y//gcd(x,y)

# @njit
def solve(n,m,s,t):
  L = lcm(n,m)
  
  lst = [""]*L
  s_interval = L//n
  t_interval = L//m
  for i in range(n):
    lst[i*s_interval] = s[i]
  for i in range(m):
    if lst[i*t_interval] =="":
      continue
    if lst[i*t_interval] != t[i]:
      return "-1"
  return L
  

def main():
  N,M = map(int,input().split())
  s = input()
  t = input()
  print(solve(N,M,s,t))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit
from math import gcd
# input = stdin.readline

def lcm(x,y):
  return x*y//gcd(x,y)

# @njit
def solve(n,m,s,t):
  L = lcm(n,m)
  
  lst = [""]*L
  s_interval = L//n
  t_interval = L//m
  for i in range(n):
    lst[i*s_interval] = s[i]
  for i in range(m):
    if lst[i*t_interval] =="":
      continue
    if lst[i*t_interval] != t[i]:
      return -1
  return L
  

def main():
  N,M = map(int,input().split())
  s = input()
  t = input()
  print(solve(N,M,s,t))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit
from math import gcd
# input = stdin.readline

def lcm(x,y):
  return x*y//gcd(x,y)

# @njit
def solve(n,m,s,t):
  L = lcm(n,m)
  
  lst = [""]*L
  s_interval = L//n
  t_interval = L//m
  for i in range(n):
    lst[i*s_interval] = s[i]
  for i in range(m):
    if lst[i*t_interval] =="":
      continue
    if lst[i*t_interval] != t[i]:
      return -1
  return L
  
  
  return n



def main():
  N,M = map(int,input().split())
  s = input()
  t = input()
  print(solve(N,M,s,t))
  return

if __name__ == '__main__':
  main()
Problem p03324 (python)

Fixed submission:
#!/usr/bin/env python3
import sys

def main():
    D, N = map(int, input().split())
    if N != 100:
        print((100**D)*N)
    else:
        print((100**D)*101)
    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

def main():
    D, N = map(int, input().split())
    l = []
    for i in range(1,10000*101):
        if i % (100**D) == 0 and i % (100**(D+1)) != 0:
            l.append(i)
    
    print(l[N-1])

if __name__ == '__main__':
    main()
Problem p03408 (python)

Fixed submission:
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(s)))))

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

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(S)))))

Buggy submission (verdict: Runtime Error):
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(Input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(S)))))

Buggy submission (verdict: Runtime Error):
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(Input()))]

print(max([s.count(s[i]) - t.count(s[i]) for i in range(len(S))]))

Buggy submission (verdict: Runtime Error):
s = [int(input()) for _ in range(int(input()))]
t = [int(input()) for _ in range(int(Input()))]

print(max(
    [s.count(s[i]) - t.count(s[i]) for i in range(len(S))]))
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k In range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
print(ans)
Problem p03470 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, d: "List[int]"):
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    d = [int(input()) for i in range(N)]
    print(len(set(d)))
    return



if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N = int(input())
d = (int(input()) for i in range(N))

print(len(d))
Problem p03549 (python)

Fixed submission:
N,M = map(int,input().split())
ans = (1900*M + 100*(N-M))*(2**M)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int.input().split())
ans = (1900*M + 100*(N-M))*(2**M)
print(ans)
Problem p03555 (python)

Fixed submission:
S = "".join(reversed(input()))
T = "".join(input())

if S == T:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
l = (x if isSquare(x) else -1 for x in range(1,N+1))
print(max(l))
Problem p03636 (python)

Fixed submission:
s = input()

char_number = len(s)

start = s[0]
end   = s[-1]

answer = start + str(char_number - 2) + end
print(answer)

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

char_number = len(s)

start = s[0]
end   = s[-0]

answer = start + str(char_number - 2)in + end
print(answer)

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

char_number = len(s)

start = s[0]
end   = s[-0]

answer = start + char_number + end
print(answer)
Problem p03729 (python)

Fixed submission:
a,b,c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
  print("YES")
else:
  print("NO")

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

if a[-1] == b[0] and b[-1] == c[0]:
  print("YES")
  return
else:
  print("NO")
  return
Problem p03761 (python)

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

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
    # i番目の文字列の中の文字を数える
    d = Counter(a[i])
    for c in (chr(ord("a") + i) for i in range(26)):
      if not c in d.keys():
        alphabetLst[c] = 0
      elif not c in alphabetLst.keys():
        alphabetLst[c] = d[c]
      elif d[c] < alphabetLst[c]:
        alphabetLst[c] = d[c]


  res = []
  for k,v in alphabetLst.items():
    res += [k]*v

  return "".join(res)

def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
... (17 lines) ...


def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()
Problem p03779 (python)

Fixed submission:
def calcTime(x):
  n = 0
  while True:
    if n*(n+1)//2 > x:
   	  return n
    elif n*(n+1)//2 == x:
      return n
    else:
      n += 1

x = int(input())
ans = calcTime(x)
print(ans)

Buggy submission (verdict: Runtime Error):
def calcTime(x,n=0):
  if n*(n+1)//2 >= x:
    return n
  else:
    return calcTime(x,n+1)

x = int(input())
print(calcTime(x))
Problem p03828 (python)

Fixed submission:
MOD = 10**9+7
memo = [0]*10000

N = int(input())

def primeLst(k):
  acc = []
  if k == 1:
    return acc
  f = 2
  while f * f <= k:
    if k % f == 0:
      acc.append(f)
      k //= f
    else:
      f += 1
  if k != 1:
    acc.append(k)
  return acc

for i in range(N):
  l = primeLst(i+1)
  for x in l:
    memo[x] += 1

res = 1
for i in range(1,N):
  res *= memo[i+1] + 1
  res %= MOD

print(res)

Buggy submission (verdict: Runtime Error):
MOD = 10**9+7
memo = [0]*10000

N = int(input())

def primeLst(k):
  acc = []
  if k == 1:
    return acc
  f = 2
  while f * f <= k:
    if k % f == 0:
      acc.append(f)
      k //= f
    else:
      f += 1
  if k != 1:
    acc.append(k)
  return acc

for i in range(N):
  l = primeLst(i+1)
  for x in l:
    memo[x] += 1

res = 1
for i in range(1,N):
  res *= memo[i+1] + 1
  res %= MOD

print(acc)
Problem p03852 (python)

Fixed submission:
s = input()
l = ["a", "i", "u", "e", "o"]
print("vowel" if s in l else "consonant")

Buggy submission (verdict: Runtime Error):
s = input()
l = [chr(ord(a)+i) for i in range(5)]
print("vowel" if s in l else "consonant")
Problem p03945 (python)

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

# from numba import njit

# input = stdin.readline

def calcGroup(s):
  whiteCount = 0
  blackCount = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] == "W":
        whiteCount += 1
      elif s[i] == "B":
        blackCount += 1
      else:
        raise ValueError
    prev = s[i]
  return whiteCount,blackCount

# @njit
def solve(s):
  white,black = calcGroup(s)
  if abs(white-black) == 0:
    return (white-1)*2+1
  else:
    return min(white,black)*2



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit

# input = stdin.readline

def calcGroup(s):
  whiteCount = 0
  blackCount = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] = "":
        pass
      elif s[i] = "W":
        whiteCount += 1
      elif s[i] = "B":
        blackCount += 1
      else:
        raise ValueError
    prev = s[i]
  return whiteCount,blackCount

# @njit
def solve(s):
  # white,black = calcGroup(s)
  return min(calcGroup(s))



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()

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

# from numba import njit

# input = stdin.readline

def calcGroup(s):
  whiteCount = 0
  blackCount = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] = "W":
        whiteCount += 1
      elif s[i] = "B":
        blackCount += 1
      else:
        raise ValueError
    prev = s[i]
  return whiteCount,blackCount

# @njit
def solve(s):
  # white,black = calcGroup(s)
  return min(calcGroup(s))



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()
Problem p03971 (python)

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

a_counter = 0
b_counter = 0

for i in range(N):
  s = S[0]
  if s == "a" and a_counter + b_counter <A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter < B and a_counter + b_counter <A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]

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

a_counter, b_counter = 0

while S != "":
  s = S[0]
  if s == "a" and a_counter + b_counter <=a+b:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter <= b and a_counter + b_counter <=a+b:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]
Problem p03076 (python)

Fixed submission:
a = [int(input()) for i in range(5)]
max = 0
kazu = 0
ans = 0
for i in range(5):
    if a[i]%10 == 0: amari = 0
    else: amari = 10-(a[i]%10)
    if amari >= max:
        max = amari
        kazu = i
for i in range(5):
    if i == kazu: pass
    else:
        if a[i]%10 == 0:
            ans+=a[i]
        else:
            ans+=((int(a[i]/10))*10 +10)
print(ans+a[kazu])

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	vector<int> a(5);
	int max = 0;
	int kazu = 0;
	rep(i,5){
		cin >> a[i];
		int amari;
		if(a[i]%10 == 0) amari = 0;
		else amari = 10-(a[i]%10);
		if(amari >= max){
			max = amari;
			kazu = i;
		}
	}
	int ans = 0;
	rep(i,5){
		if(i == kazu) continue;
		else{
			if(a[i]%10 == 0) ans+=a[i];
			else ans+= ((a[i]/10)*10 + 10);
		}
	}
	cout << ans+a[kazu] << endl;
	return 0;
}
Problem p03102 (python)

Fixed submission:
n, m, c  = map(int, input().split())
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
        a = [int(i) for i in input().split()]
        sum = 0
        for k in range(m):
            sum +=(a[k]*b[k])
        sum+=c
        if sum > 0: ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int n, m, c, ans =0;
	cin >> n >> m >> c;
	vector<int> b(m);
	rep(i,m) cin >> b[i];
	rep(i,n){
		int sum = 0;
		vector<int> a(m);
		rep(j,m){
			cin >> a[j];
			sum += a[j]*b[j];
		}
		sum+=c;
		if(sum > 0) ans++;
	}
	cout << ans << endl;
	return 0;
}
Problem p03110 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans+=x
    else:
        ans+=x*380000
print(ans)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int n;
	double ans=0;
	cin >> n;
	rep(i,n){
		double x; string s;
		cin >> x >> s;
		if(s == "JPY") ans+=x;
		else ans+=380000*x;
	}
	printf("%.15f", ans);
	return 0;
}