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

Fixed submission:
import sys

# 実行環境(0:vscode, 1:atcoder)
MODE = 1

# 入力の次元
DIMENSION = 0

# int型に変換
INT_TYPE = 1

if not (MODE):
    with open("input.txt", "r") as f:
        s = f.read()
else:
    s = sys.stdin.read()

if DIMENSION == 0:
    if INT_TYPE == 1:
        s = int(s)
elif DIMENSION == 1:
    if INT_TYPE == 0:
        s = s.split()
    elif INT_TYPE == 1:
        s = [int(x) for x in s.split()]
elif DIMENSION == 2:
    if INT_TYPE == 0:
        s = [x.split() for x in s.splitlines()]
    elif INT_TYPE == 1:
        s = [[int(y) for y in x.split()] for x in s.splitlines()]

if s == 1:
    print(0)
else:

    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])

        if temp != 1:
            arr.append([temp, 1])

        if arr == []:
            arr.append([n, 1])

        return arr

    F = factorization(s)

    cnt = 0
    for i in range(len(F)):
        num = 1
        while 1:
            F[i][1] -= num
            if F[i][1] < 0:
                break
            else:
                num += 1
                cnt += 1
    print(cnt)

Buggy submission (verdict: Runtime Error):
import sys
import sympy

# 実行環境(0:vscode, 1:atcoder)
MODE = 1

# 入力の次元
DIMENSION = 0

# int型に変換
INT_TYPE = 1

if not (MODE):
    with open("input.txt", "r") as f:
        s = f.read()
else:
    s = sys.stdin.read()

if DIMENSION == 0:
    if INT_TYPE == 1:
        s = int(s)
elif DIMENSION == 1:
    if INT_TYPE == 0:
        s = s.split()
    elif INT_TYPE == 1:
        s = [int(x) for x in s.split()]
elif DIMENSION == 2:
    if INT_TYPE == 0:
        s = [x.split() for x in s.splitlines()]
    elif INT_TYPE == 1:
        s = [[int(y) for y in x.split()] for x in s.splitlines()]


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


F = factorization(s)

cnt = 0
for i in range(len(F)):
    num = 1
    while 1:
        F[i][1] -= num
        if F[i][1] < 0:
            break
        else:
            num += 1
            cnt += 1
print(cnt)
Problem p02675 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    n = input().rstrip()

    if n[-1] == "3":
        print("bon")
    elif n[-1] == "2" or n[-1] == "4" or n[-1] == "5" or n[-1] == "7" or n[-1] == "9":
        print("hon")
    else:
        print("pon")


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
import math
 
n = input()
 
if n[len(n)] == 3:
  print("bon")
elif n[len(n)] == 0 or n[len(n)] == 1 or n[len(n)] == 0 or  n[len(n)] == 6 or n[len(n)] == 8:
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
import math

n = input()

if n[len(n)] == 3:
  print("bon")
elif n[len(n)] == 0 or n[len(n)] == 1 or n[len(n)] == 0 or  n[len(n)] == 6 or n[len(n)] == 8:
  print("pon")
else:
  print("hon")

if n == math.inf:
  print("a")
Problem p02732 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# input
n = int(input())
a_list = []
a_dic = {}
for ai in input().split():
    int_ai = int(ai)
    a_list.append(int_ai)
    if int_ai in a_dic:
        a_dic[int_ai] += 1
    else:
        a_dic[int_ai] = 1

a_solution_dic = {}
all_sum_select = 0
for key in list(a_dic.keys()):
    all_sum_select += int(a_dic[key] * (a_dic[key]-1) / 2)
    #a_solution_dic_at_k[key] = int((a_dic[key]-1) * (a_dic[key]-2) / 2)

for k, ak in enumerate(a_list):
    sum_select_at_k = all_sum_select + int((a_dic[ak]-1) * (a_dic[ak]-2) / 2) \
                       - int(a_dic[ak] * (a_dic[ak]-1) / 2)


    print(sum_select_at_k)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# input
n = int(input())
a_list = []
a_dic = {}
for ai in input().split():
    int_ai = int(ai)
    a_list.append(int_ai)
    if int_ai in a_dic:
        a_dic[int_ai] += 1
    else:
        a_dic[int_ai] = 1

a_solution_dic = {}
a_solution_dic_at_k = {}
for key in a_dic:
    if a_dic[key] == 1:
        del a_dic[key]
    a_solution_dic[key] = int(a_dic[key] * (a_dic[key]-1) / 2)
    #a_solution_dic_at_k[key] = int((a_dic[key]-1) * (a_dic[key]-2) / 2)


for k, ak in enumerate(a_list):
    sum_select = 0
    if a_dic[ak] <= 2:
        pass
    else:
        sum_select += int((a_dic[ak]-1) * (a_dic[ak]-2) / 2)
    for key in a_solution_dic:
        if key != ak:
            sum_select += a_solution_dic[key]


    print(sum_select)
Problem p02767 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdin

n = int(input())
x_list_str = stdin.readline().rstrip().split()
x_list = [int(i) for i in x_list_str]

# 体力のリスト
sum_hp_list = []

min_x = min(x_list)
max_x = max(x_list)

if min_x == max_x:
    print(0)
    exit()

for i in range(min_x, max_x):
    sum_hp = 0
    for x in x_list:
        sum_hp += (x-i)**2
    sum_hp_list.append(sum_hp)

print(min(sum_hp_list))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdin

n = int(input())
x_list_str = stdin.readline().rstrip().split()
x_list = [int(i) for i in x_list_str]

# 体力のリスト
sum_hp_list = []

min_x = min(x_list)
max_x = max(x_list)

for i in range(min_x, max_x):
    sum_hp = 0
    for x in x_list:
        sum_hp += (x-i)**2
    sum_hp_list.append(sum_hp)

print(min(sum_hp_list))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

# 体力のリスト
sum_hp_list = []

min_x = min(x_list)
max_x = max(x_list)

for i in range(min_x, max_x):
    sum_hp = 0
    for x in x_list:
        sum_hp += (x-i)**2
    sum_hp_list.append(sum_hp)

print(min(sum_hp_list))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

# 体力のリスト
sum_hp_list = []

min_x = min(x_list)
max_x = max(x_list)

for i in range(min_x, max_x):
    sum_hp = 0
    for x in x_list:
        sum_hp += (x-i)**2
    sum_hp_list.append(sum_hp)

print(min(sum_hp_list))
Problem p02783 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

if h % a == 0:
    print(h // a)
else:
    print(h//a + 1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# RemainingBalls
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a-1, b)
elif t == u:
    print(a, b-1)
Problem p02801 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def resolve():
    c = input()

    print(chr(ord(c)+1))


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def resolve():
    n, m = map(int, input().split())

    if n == m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    resolve()
Problem p02811 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    k, x = map(int, input().split())

    sum_money = k * 500

    if sum_money >= x:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def resolve():
    c = input()

    print(chr(ord(c)+1))


if __name__ == "__main__":
    resolve()
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = list(map(int, input().split()))
ret = (a + b) * [0]
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = []
Y = []
A.sort()
B.sort()
C.sort()

X = A[(a - x):]
Y = B[(b - y):]

idxA = 0
idxB = 0
idxC = c - 1
for i in reversed(range(c)):
    if idxA == x and idxB == y:
        break
    if idxA == x:
        if C[i] > Y[idxB]:
            Y[idxB] = C[i]
            idxB += 1
        else:
            break
    elif idxB == y:
        if C[i] > X[idxA]:
            X[idxA] = C[i]
            idxA += 1
        else:
            break
    elif C[i] <= min(X[idxA], Y[idxB]):
        break
    elif X[idxA] <= Y[idxB]:
        X[idxA] = C[i]
        idxA += 1
    else:
        Y[idxB] = C[i]
        idxB += 1
print((sum(X) + sum(Y)))

Buggy submission (verdict: Runtime Error):
x, y, a, b, c = list(map(int, input().split()))
ret = (a + b) * [0]
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = []
Y = []
A.sort()
B.sort()
C.sort()

X = A[(a - x):]
Y = B[(b - y):]

idxA = 0
idxB = 0
idxC = c - 1
for i in reversed(range(c)):
    if idxA == len(X) and idxB == len(Y):
        break
    if idxA == len(X):
        if C[i] > Y[idxB]:
            Y[idxB] = C[i]
            idxB += 1
        else:
            break
    if idxB == len(Y):
        if C[i] > X[idxA]:
            X[idxA] = C[i]
            idxA += 1
        else:
            break
    if C[i] <= min(X[idxA], Y[idxB]):
        break
    if X[idxA] <= Y[idxB]:
        X[idxA] = C[i]
        idxA += 1
    else:
        Y[idxB] = C[i]
        idxB += 1
print((sum(X) + sum(Y)))

Buggy submission (verdict: Runtime Error):
x, y, a, b, c = list(map(int, input().split()))
ret = (a + b) * [0]
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
X = []
Y = []
A.sort()
B.sort()
C.sort()
if a < x :
    X = ((x - a) * [0]) + A
else:
    X = A[(a - x):]
if b < y:
    Y = ((y - b) * [0]) + B
else:
    Y = B[(b - y):]
idxA = 0
idxB = 0
idxC = c - 1
for i in reversed(range(c)):
    if idxA == len(X) and idxB == len(Y):
        break
    if idxA == len(X):
        if C[idxC] > Y[idxB]:
            Y[idxB] = C[idxC]
            idxB += 1
        else:
            break
    if idxB == len(Y):
        if C[idxC] > X[idxA]:
            X[idxA] = C[idxC]
            idxA += 1
        else:
            break
    if C[idxC] < min(X[idxA], Y[idxB]):
        break
    if X[idxA] <= Y[idxB]:
        X[idxA] = C[idxC]
        idxA += 1
    else:
        Y[idxB] = C[idxC]
        idxB += 1
print((sum(X) + sum(Y)))
Problem p02608 (python)

Fixed submission:
n=int(input())
ans = [0 for _ in range(10001)]
for i in range(1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      v = i*i + j*j + k*k + i*j + j*k + k*i
      if v < 10001:
        ans[v] += 1

for i in range(n):
  print(ans[i+1])

Buggy submission (verdict: Runtime Error):
N=int(input())
ans = [0 for _ in range(10001)]
for i in range(101):
  for j in range(101):
    for k in range(101):
      v = i*i + j*j + k*k + i*j + j*k + k*i
      if v < 10001:
        ans[v] += 1

for i in range(n):
  print(ans[i+1])
Problem p02658 (python)

Fixed submission:

a=int(input())
li = list(map(int,input().split()))
if 0 in li:
  print(0)
  
else:
  result = 1
  for number in li:
    result = result * number
    if result > 10**18:
      print(-1)
      break

  if result <= 10**18:
    print(result)

Buggy submission (verdict: Runtime Error):

a=int(input())
li = list(map(int,input().split()))
if 0 in li:
  print(0)
  
else:
  result = 1
  for number in li:
    result = result * number
    if result > 10**18:
      print(-1)
      break

if result <= 10**18:
  print(result)

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce
a=int(input())
li = list(map(int,input().split()))
j = reduce(mul, nums)
if j >= 10**18:
  print(-1)
else:
  print(j)
Problem p02700 (python)

Fixed submission:
import math
a,b,c,d = map(int,input().split())
t_n = math.ceil(c / b)
a_n = math.ceil(a / d)

if t_n <= a_n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if t_n <= a_n:
    print('YES')
else:
    print('NO')
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = input()
print(a[int(k)-1])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = input()
print(a[k-1])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = input()
print(a[k+1])
Problem p02742 (python)

Fixed submission:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 or w == 1):
  print(1)

elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 || w == 1):
  print(1)

elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Buggy submission (verdict: Runtime Error):
h = input()
w = input()
h_a = h // 2
w_a = w // 2
if((h_a == 0) & (w_a == 0)):
  print(h_a * w_a)
elif((h_a == 1) & (w_a == 0)):
  print((h_a+1) * w_a)
elif((h_a == 0) & (w_a == 1)):
  print(h_a * (w_a + 1))
elif((h_a == 1) & (w_a == 1)):
  print((h_a + 1) * (w_a + 1))
Problem p02743 (python)

Fixed submission:
import math

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

x = c - a - b
if(x <= 0):
  print('No')
elif(4 * a * b < x ** 2):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import cmath

li = list(map(int,input().split()))
a = cmath.sqrt(li[0])
b = cmath.sqrt(li[1])
c = cmath.sqrt(li[2])
if(a+b < c):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import cmath

li = list(map(int,input().split()))
a = cmath.sqrt(li[0])
b = cmath.sqrt(li[1])
c = cmath.sqrt(li[2])
if(a+b < c):
  print('Yes')
else:
  print('No')
Problem p02755 (python)

Fixed submission:
#output <= 1000

nums = [int(e) for e in input().split()]
flag = 0
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    flag = 1
    print(i)
    break

if flag == 0:
    print(-1)

Buggy submission (verdict: Runtime Error):
#output <= 1000

nums = [int(e) for e in input().split()]
flag = 0
for i in range(1,1001):
  if ((((i * 8) // 100) == nums[0]) & (((i * 10) // 100) == nums[1])):
    flag = 1
    print(i)
    break

if flag = 0:
    print(-1)
Problem p02844 (python)

Fixed submission:
N=int(input())
S=input()
ans=0
for i in range(10):
  str_i = str(i)
  i_index=S.find(str_i)
  if i_index==-1:
    continue
  for j in range(10):
    str_j=str(j)
    j_index=S.find(str_j, i_index+1)
    if j_index==-1:
      continue
    for k in range(10):
      str_k=str(k)
      k_index=S.find(str_k, j_index+1) 
      if k_index!=-1:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
ans=0
for i in range(10):
  str_i = str(i)
  i_index==S.find(str_i)
  if i_index==-1:
    continue
  for j in range(10):
    str_j=str(j)
    j_index=S.find(str_j, i_index+1)
    if j_index==-1:
      continue
    for k in range(10):
      str_k=str(k)
      k_index=S.find(str_k, j_index+1) 
      if k_index!=-1:
        ans+=1
print(ans)
Problem p03031 (python)

Fixed submission:
N, M = map(int,input().split())
state = []
for _ in range(M):
  lst = list(map(int, input().split()))
  state.append(lst[1:])#switch numbers each denkyu
p = list(map(int, input().split()))#numbers switches on %2 == pi 
ans = 0
for i in range(2**N):
  total = 0
  for j in range(M):
    cnt = 0
    for s in state[j]:
      s -= 1
      if (i >> s) & 1:#全スイッチのパターン一つ一つについて、各電球の各スイッチがオンになっているか
        cnt += 1
    cnt %= 2
    if cnt == p[j]:
      total += 1
  if total == M:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
state = []
for _ in range(M):
  lst = list(map(int, input().split()))
  state.append(lst[1:])#switch numbers each denkyu
p = list(map(int, input().split()))#numbers switches on %2 == pi 
ans = 0
for i in rage(2**n):
  total = 0
  for j in range(m):
    cnt = 0
    for s in state[j]:
      s -= 1
      if (i >> s) & 1:#全スイッチのパターン一つ一つについて、各電球の各スイッチがオンになっているか
        cnt += 1
    cnt %= 2
    if cnt == p[j]:
      total += 1
  if total == m:
    ans += 1
print(ans)
Problem p03160 (python)

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

DP = [0, abs(h[0]-h[1])]
for i in range(N-2):
  DP += [min(DP[-2] + abs(h[i]-h[i+2]),DP[-1] + abs(h[i+1] - h[i+2]))]
  
print(DP[-1])

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

DP = [0, abs(h[0]-h[1])]

for i in range(N-2):
  DP += min((DP[-2] + abs(h[i]-h[i+2])),(DP[-1] + abs(h[i+2]-h[i+1])))
  
print(DP[-1])
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
DP = [0]
for i in range(N-1):
    act = float("inf")
    for k in range(K):
        if i-k < 0 : continue
        act = min(DP[-1-k] + abs(h[i-k]-h[i+1]) , act)
    DP += [act]
 
print(DP[-1])

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
h = np.array(list(map(int,input().split())))
n,k = nk[0], nk[1] #5,3
DP = np.array([0])
#DP[0] = 0
for i in range(1, n):#0~3 -> 1~4
  act = float("inf")
  for k_ in range(1, k+1):#0~2 -> 1~3
    if i-k_ < 0 : continue
    act = min(DP[i-k_] + abs(h[i-k_]-h[i]), act)#
  DP = np.append(DP, act)#[0,20,]
print(int(DP[-1]))

Buggy submission (verdict: Runtime Error):
3 1
10 20 10
20

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
h = np.array(list(map(int,input().split())))
n,k = nk[0], nk[1] #5,3
DP = np.zeros(n, int)
#DP[0] = 0
for i in range(1, n):#0~3 -> 1~4
  act = float("inf")
  for k_ in range(1, k+1):#0~2 -> 1~3
    if i-k_ < 0 : continue
    act = min(DP[i-k_] + abs(h[i-k_]-h[i]), act)#
  DP[i] = act#[0,20,]
print(DP[-1])

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
h = np.array(list(map(int,input().split())))
n,k = nk[0], nk[1] #5,3
DP = np.full(n, np.inf, int)
DP[0] = 0
for i in range(1, n):#0~3 -> 1~4
  act = float("inf")
  for k_ in range(1, k+1):#0~2 -> 1~3
    if i-k_ < 0 : continue
    act = min(DP[i-k_] + abs(h[i-k_]-h[i]), act)#
  DP[i] = act#[0,20,]
print(DP[-1])

Buggy submission (verdict: Runtime Error):
3 1
10 20 10
20

Buggy submission (verdict: Runtime Error):
nk = list(map(int,input().split()))
li = list(map(int,input().split()))
n,k = nk[0], nk[1] #5,3
DP = [0]
for i in range(1, n):#0~3 -> 1~4
  act = float("inf")
  for k_ in range(1, k+1):#0~2 -> 1~3
    if i-k_ < 0 : continue
    act = min(DP[-k_] + abs(h[i-k_]-h[i]), act)#
  DP+= [act]#[0,20,]
print(DP[-1])
Problem p03162 (python)

Fixed submission:
n=int(input())
abc = [list(map(int, input().split())) for i in range(n)]
#[[10,40,70],[20,50,80],[30,60,90]]
A = [0]
B = [0]
C = [0]
for i in range(n):
  a = abc[i][0] + max(B[-1], C[-1])#10+max(0,0),20+max(40,70)=90,30+max(120,120)=150
  b = abc[i][1] + max(A[-1], C[-1])#40+max(0,0),50+max(10,70)=120,60+max(90,120)=180
  c = abc[i][2] + max(A[-1], B[-1])#70+mac(0,0),80+max(10,40)=120,90+max(90,120)=210
  A += [a]#0,10,90,150
  B += [b]#0,40,120,180
  C += [c]#0,70,120,210
print(max(A[-1], B[-1], C[-1]))

Buggy submission (verdict: Runtime Error):
n=int(input())
abc = [list(map(int, input().split())) for i in range(n)]
#[[10,40,70],[20,50,80],[30,60,90]]
ABC=[[0,0,0]]
#A = [0]
#B = [0]
#C = [0]
for i in range(n):
  a = abc[i][0] + max(ABC[-1][1], ABC[-1][2])#10+max(0,0),20+max(40,70)=90,30+max(120,120)=150
  b = abc[i][1] + max(ABC[-1][0], ABC[-1][2])#40+max(0,0),50+max(10,70)=120,60+max(90,120)=180
  c = abc[i][2] + max(ABC[-1][0], ABC[-1][1])#70+mac(0,0),80+max(10,40)=120,90+max(90,120)=210
  ABC += [[a,b,c]]
  #A += [a]#0,10,90,150
  #B += [b]#0,40,120,180
  #C += [c]#0,70,120,210
print(max(ABC[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
abc = [list(map(int, input().split())) for i in range(n)]
#[[10,40,70],[20,50,80],[30,60,90]]
ABC=[[0,0,0]]
#A = [0]
#B = [0]
#C = [0]
for i in range(n):
  a = abc[i][0] + max(B[-1], C[-1])#10+max(0,0),20+max(40,70)=90,30+max(120,120)=150
  b = abc[i][1] + max(A[-1], C[-1])#40+max(0,0),50+max(10,70)=120,60+max(90,120)=180
  c = abc[i][2] + max(A[-1], B[-1])#70+mac(0,0),80+max(10,40)=120,90+max(90,120)=210
  ABC += [[a,b,c]]
  #A += [a]#0,10,90,150
  #B += [b]#0,40,120,180
  #C += [c]#0,70,120,210
print(max(ABC[-1])
Problem p03281 (python)

Fixed submission:
S = int(input())
ans = 0
count = 0
for i in range(1, S+1, 2):
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1
    count = 0
print(ans)

Buggy submission (verdict: Runtime Error):
https://atcoder.jp/contests/abc106/scoreN = int(input())
#cnt = 0
ans = 0
for i in range(1, N+1, 2):
    cnt = 0 
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)
Problem p03371 (python)

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

if C*2 >= A+B:
    print(A*X+B*Y)
else:
    if X > Y:
        ans=Y*2*C+(X-Y)*A
        ans=min(ans, X*2*C)
    else:
        ans=X*2*C+(Y-X)*B
        ans=min(ans, C*2*Y)
    print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y=map(int,input().split)
a=A*X+B*Y
b=max(X,Y)*C*2
p=B if X<Y else A
c=min(X,Y)*2*C+abs(X-Y)*p
print(min(a,b,c))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=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:
                res += 1
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=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:
                res + = 1
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=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:
              	res + = 1
print(res)
Problem p03455 (python)

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
      if a <= sum(list(map(int, list(str(i)))) <= b:
          ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(n):
      if a <= sum(list(map(int, list(str(i)))) <= b:
          ans += i
print(ans)