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

Fixed submission:
# 必ずN回以下でループする
N, K = map(int, input().split())
towns = [int(i) for i in input().split()]
arrivedList = [1]
for i in range(N * 2):
    arrivedList.append(towns[arrivedList[-1] - 1])
if K <= N:
    print(arrivedList[K])
    exit()

loop_end = N
loop_start = N - 1
while (arrivedList[loop_end] != arrivedList[loop_start]):
    loop_start -= 1

loop_len = loop_end - loop_start

# Kの値をloop_lenを使って調整する
K = K % loop_len
while K < N:
    K += loop_len

print(arrivedList[K])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
towns = [int(i) for i in input().split()]
arrivedList = [1]
loopCount = 0
previous = 0
for i in range(len(towns)):
    idx = arrivedList[len(arrivedList) - 1] - 1
    current = towns[idx]
    if arrivedList.count(current) == 0:
        arrivedList.append(current)
    else:
        previous = len(arrivedList) - (len(arrivedList)-arrivedList.index(current))
        loopCount = len(arrivedList)-arrivedList.index(current)
        break
    if i == K - 1:
        print(arrivedList[len(arrivedList) - 1])
        exit()
remain = K % loopCount - previous
loopList = arrivedList[previous: previous + loopCount]

print(loopList[remain])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
towns = [int(i) for i in input().split()]
arrivedList = [1]
loopCount = 0
previous = 0
for i in range(len(towns)):
    idx = arrivedList[len(arrivedList) - 1] - 1
    current = towns[idx]
    if arrivedList.count(current) == 0:
        arrivedList.append(current)
    else:
        previous = len(arrivedList) - (len(arrivedList)-arrivedList.index(current))
        loopCount = len(arrivedList)-arrivedList.index(current)
        print(previous,current, loopCount, arrivedList)
        break
    if i == K - 1:
        print(arrivedList[len(arrivedList) - 1])
        exit()
remain = K % loopCount - previous
loopList = arrivedList[previous: previous + loopCount]
print(loopList[remain])
Problem p02741 (python)

Fixed submission:
str = "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"
input_field = [int(i) for i in str.split(", ")]
print(input_field[int(input()) - 1])

Buggy submission (verdict: Runtime Error):
str = "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"
input_field = [int(i) for i in str.split(", ")]
print(input_field[input(int()) - 1])
Problem p02742 (python)

Fixed submission:
# 4 5
import math
field = [int(i) for i in input().split(" ")]
field_num = field[0] * field[1]
if field[0] == 1 or field[1] == 1:
    print(1)
else:
    canFillBlock = 0
    canFillBlock += math.ceil(field[1]/2) * math.ceil(field[0]/2)
    canFillBlock += math.floor(field[1]/2) * math.floor(field[0]/2)
    print(canFillBlock)

Buggy submission (verdict: Runtime Error):
# 4 5
import math
field = [int(i) for i in input().split(" ")]
field_num = field[0] * field[1]
if field_num[0] == 1 or field_num[1] == 1:
    print(1)
else:
    canFillBlock = 0
    canFillBlock += math.ceil(field[1]/2) * math.ceil(field[0]/2)
    canFillBlock += math.floor(field[1]/2) * math.floor(field[0]/2)
    print(canFillBlock)
Problem p03611 (python)

Fixed submission:
import copy
import collections
N = int(input())
seq = [int(i) for i in input().split()]
seqP1 = [i + 1 for i in copy.copy(seq)]
seqM1 = [i - 1 for i in copy.copy(seq)]
mixed = seq + seqM1 + seqP1
print(mixed.count(collections.Counter(mixed).most_common()[0][0]))

Buggy submission (verdict: Runtime Error):
import copy
from statistics import mode
N = int(input())
seq = [int(i) for i in input().split()]
seqP1 = [i + 1 for i in copy.copy(seq)]
seqM1 = [i - 1 for i in copy.copy(seq)]
mixed = seq + seqM1 + seqP1
print(mixed.count(mode(mixed)))
Problem p02548 (python)

Fixed submission:
def func(x):
    ans = 0
    for a in range(1, n):
        for b in range(1, n):
            c = n - a * b
            if c <= 0:
                break
            ans += 1
    return ans

n = int(input())
print(func(n))

Buggy submission (verdict: Runtime Error):
from sympy import isprime
n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

for i in range(len(lst_c)):
    if isprime(lst_c[i]):
        lst_c[i] = 1

#print(lst_c)

cnt = 0
cnt2 = 0
for i in range(len(lst_c)):
    if lst_c[i] != 1:
        for j in range(1,int(lst_c[i]**0.5)+1):
            if lst_c[i]%j ==0:
                cnt += 1
                if lst_c[i]/j == j:
                    cnt2 +=1
                    #print("yes")
        lst_c[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c)*2-cnt2-1)
#print(lst_c)

Buggy submission (verdict: Runtime Error):
from sympy import isprime
n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

for i in range(len(lst_c)):
    if isprime(lst_c[i]):
        lst_c[i] = 1

#print(lst_c)

cnt = 0
cnt2 = 0
for i in range(len(lst_c)):
    if lst_c[i] != 1:
        for j in range(1,int(lst_c[i]**0.5)+1):
            if lst_c[i]%j ==0:
                cnt += 1
                if lst_c[i]/j == j:
                    cnt2 +=1
                    #print("yes")
        lst_c[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c)*2-cnt2-1)
#print(lst_c)
Problem p02658 (python)

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

ans = 1
if 0 in a_lst:
    print(0)
else:
    for a in a_lst:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a_lst = list(map(int,input().split()))

ans = np.prod(a_lst)
if ans > 10**18:
    print("-1")
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a_lst = list(map(int,input().split()))

ans = np.prod(a_lst)
if ans > 10**18
    print("-1")
else:
    print(ans)

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

ans = 1
for a in a_lst:
    ans = ans * a
if ans > 10**18:
    print("-1")
else:
    print(ans
Problem p02719 (python)

Fixed submission:
n,k  = map(int,input().split())
print(min(n%k, abs(k-n%k)))

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

if n>=k:
    if n%k != 1 or n%k != 2 or n%k != 0:
        print(n%(k-1))
    else:
        print(n%k)
elif n<k:
    print(n)
Problem p02756 (python)

Fixed submission:
from collections import deque
s = deque(input())
q = int(input())

cnt = 1
for i in range(q):
    t_f_c = list(input().split())
    if t_f_c[0] == "1":
        cnt *= -1
    elif t_f_c[0] == "2":
        if cnt == 1: #反転-
            if t_f_c[1] == "1":
                s.appendleft(t_f_c[2])
            elif t_f_c[1] == "2":
                s.append(t_f_c[2])
        elif cnt == -1:  #反転+
             if t_f_c[1] == "2":
                s.appendleft(t_f_c[2])
             elif t_f_c[1] == "1":
                s.append(t_f_c[2])
if cnt == 1:
    print("".join(s))
elif cnt == -1:
    s.reverse()
    print("".join(s))

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
cnt = 0
for i in range(q):
    t_f_c = list(input().split())
    #反転する=先末逆転
    if t_f_c[0] == "1":
        cnt  += 1
    #反転しない
    elif t_f_c[0] == "2":
        if cnt % 2 == 0:
            if t_f_c[1] == "1":
                s = t_f_c[2] + s
            elif t_f_c[1] == "2":
                s = s + t_f_c[2]
        elif cnt % 2 == 1:
            if t_f_c[1] == "1":
                s = s + t_f_c[2]
            elif t_f_c[1] == "2":
                s = t_f_c[2] + s
if cnt % 2 == 0:
    print(s)
elif cnt % 2 == 1:
    print("".join((list(s)).reverse()))
Problem p02767 (python)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
lst = [0]*(max(x)-min(x)+1)
for j in range(min(x),max(x)+1):
    for i in range(n):
        lst[j-x[0]] += (x[i]-j)**2
print(min(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
lst = [0]*(max(x)-min(x)+1)
for i in range(n):
    for j in range(max(x)-min(x)+1):
        lst[j-x[0]] += (x[i]-j)**2
print(min(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
lst = [0]*(x[-1]-x[0]+1)
for i in range(n):
    for j in range(x[0],x[-1]+1):
        lst[j-x[0]] += (x[i]-j)**2
print(min(lst))
Problem p02780 (python)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
wa = sum(p[0:k])
next_wa = wa
for i in range(n-k):
    next_wa = next_wa - p[i] + p[i+k]
    if  next_wa > wa:
        wa = next_wa
print(0.5*(wa+k))

Buggy submission (verdict: Runtime Error):
import itertools
n,k = map(int,input().split())
p = list(map(int,input().split()))
num = 0
maxnum = 0
for i in range(n-k+1):
    num = 0.5*(sum(p[i:i+k])+k)
    if num > maxnum:
        maxnum = num
print("{:.6f}".format(maxnum)
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
pena = 0

for i in range(m):
    p,s = map(str,input().split())
    p = int(p)-1 
    if s == "WA" and ac[p] == 0:
        wa[p] += 1
    elif s == "AC" and ac[p] == 0:
        ac[p] = 1
        pena += wa[p]   #waのみの問題はペナルティカウントされないため、acして初めてwaの回数を加算する
    elif ac[p] == 1:
        continue

print(str(sum(ac)) + " " + str(pena))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
pena = 0

for i in range(m):
    p,s = map(str,input().split())
    p = int(p)-1 
    if s == "WA" and ac[p] == 0:
        wa[p] += 1
    elif s == "AC" and ac[p] == 0:
        ac[p] = 1
        pena += wa[p]   #waのみの問題はペナルティカウントされないため、acして初めてwaの回数を加算する
    elif ac[p] == 1:
        continue

print(str(sum(ac)) + " " + str(pena)
Problem p02813 (python)

Fixed submission:
import itertools
import math

n = int(input())
p = list(map(str,input().split()))
q = list(map(str,input().split()))
lst = []
for i in range(n):
    lst.append(str(i+1))
lst_perm = list(itertools.permutations(lst))
a=0
b=0
for i in range(math.factorial(n)):
    if ("".join(p))==("".join(q)):
        if ("".join(p))==("".join(lst_perm[i])):
            a=i
            b=i
    else:
        if ("".join(p))==("".join(lst_perm[i])):
            a = i
        elif ("".join(q))==("".join(lst_perm[i])):
            b = i
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
import itertools
import math

n = int(input())
p = list(map(str,input().split()))
q = list(map(str,input().split()))
lst = []
for i in range(n):
    lst.append(str(i+1))
lst_perm = list(itertools.permutations(lst))
for i in range(math.factorial(n)):
    if ("".join(p))==("".join(lst_perm[i])):
        a = i
    elif ("".join(q))==("".join(lst_perm[i])):
        b = i
print(abs(a-b))
Problem p02843 (python)

Fixed submission:
x = int(input())
dp = [0]*(x+105+1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Buggy submission (verdict: Runtime Error):
x = int(input())
dp = [0]*(x + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])

Buggy submission (verdict: Runtime Error):
x = int(input())
dp = [0]*(x+1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print(dp[x])
Problem p02848 (python)

Fixed submission:
N = int(input())
S = list(input())

lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))

for i in range(len(S)):
    if int(lst_up.index(S[i])+N+1) <= len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N]
    elif  int(lst_up.index(S[i])+N+1) > len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N-26]

lst_2 = "".join(S)
print(lst_2)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input())

lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))
for i in range(len(S)):
    if int(lst_up.index(S[i])+N) <= len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N]
    elif  int(lst_up.index(S[i])+N) > len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N-26]

lst_2 = "".join(S)
print(lst_2)
Problem p02885 (python)

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

num = A - 2*B
if num >= 0:
	print(num)
else:
	print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())

i = 0
while i<len(s)-1:
  if s[i] == s[i+1]:
    del s[i]
  else:
    i += 1
print(len(s))
Problem p02909 (python)

Fixed submission:
S = list(input())
if S[0] == 'S':
    print('Cloudy')
elif S[0] == 'C':
    print('Rainy')
elif S[0] == 'R':
    print('Sunny')

Buggy submission (verdict: Runtime Error):
N = int(input())
n = N - N//2
print(n / N)

S = list(input())
if S[0] == 'S':
    print('Cloudy')
elif S[0] == 'C':
    print('Rainy')
elif S[0] == 'R':
    print('Sunny')
Problem p02939 (python)

Fixed submission:
s = input()

i = 0
lst = [""]
for j in range(1,len(s)+1):
    if lst[-1] != s[i:j]:
        lst.append(s[i:j])
        i = j

print(len(lst)-1)

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

i = 0
lst = []
for j in range(1,len(s)+1):
    if lst[-1] != s[i:j]:
        lst.append(s[i:j])
        i = j

print(len(lst))
Problem p02993 (python)

Fixed submission:
S = list(input())

c = 0
for i in range(3):
  if S[i] != S[i+1]:
    c += 1
if c == 3:
  print('Good')
else:
  print('Bad')

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

c = 0
for i in range(3):
  if S[i] != S[i+1]:
    c += 1
if c == 3:
  print('Good')
else:
  print('Bad')

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

c = 0
for i in range(3):
  if S[i] != S[i+1]:
    c += 1
if c == 3:
  print('GOOD')
else:
  print('BAD')
Problem p03000 (python)

Fixed submission:
from itertools import accumulate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i <= x:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
from itertools import accumlate
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i < x:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools
n,x = map(int,input().split())
lst_l = [0] + list(map(int,input().split()))
lst_wa = list(accumulate(lst_l))
cnt = 0
for i in lst_wa:
    if i < x:
        cnt += 1
print(cnt)
Problem p03076 (python)

Fixed submission:
lst = [input() for _ in range(5)]
check = float("inf")
last_num = 0

for i in lst:
    if int(i[-1]) != 0 and int(i[-1]) < check:
        check = int(i[-1])
        last_num = i
if last_num != 0:
    lst.remove(last_num)

for i in range(len(lst)):
    if int(lst[i]) % 10  != 0:
        lst[i] = (int(lst[i]) + (10 - int(lst[i]) % 10))

print(sum(list(map(int,lst))) + int(last_num))

Buggy submission (verdict: Runtime Error):
lst = [input() for _ in range(5)]
check = float("inf")
last_num = 0

for i in lst:
    if int(i[-1]) != 0 and int(i[-1]) < check:
        check = int(i[-1])
        last_num = i

lst.remove(last_num)

for i in range(4):
    if int(lst[i]) % 10  != 0:
        lst[i] = (int(lst[i]) + (10 - int(lst[i]) % 10))

print(sum(list(map(int,lst))) + int(last_num))
Problem p03086 (python)

Fixed submission:
lst = list(input())
cnt = 0
len_lst = []
for i in lst:
    if i == 'A' or\
       i == 'T' or\
       i == 'C' or\
       i == 'G':
        cnt += 1
        len_lst.append(cnt)
    else:
        len_lst.append(cnt)
        cnt = 0
print(max(len_lst))

Buggy submission (verdict: Runtime Error):
lst = list(input())
cnt = 0
len_lst = []
for i in lst:
    if i == 'A' or\
       i == 'T' or\
       i == 'C' or\
       i == 'G':
        cnt += 1
    else:
        len_lst.append(cnt)
        cnt = 0
print(max(len_lst))
Problem p03101 (python)

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
h,w = map(int,input().split())
plint((H-h)*(W-w))
Problem p03109 (python)

Fixed submission:
Y, M, D = map(str, input().split("/"))
s = ''.join([Y,M,D])

if int(s)>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
Y, M, D = map(int, input().split("/"))
s = ''.join([Y,M,D])

if int(s)>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
Y, M, D = list(map(int, input().split("/")))
s = ''.join([Y,M,D])

if int(s)>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
Y, M, D = list(map(int, input().split("/")))
s = ''.join([Y,M,D])

if s>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = input()
ss = s.replase('/','')

if ss>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = input()
ss = s.split('/')
sss = ''.join(ss)

if sss>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = input()
ss = s.aplit('/')
sss = ''.join(ss)

if sss>20190430:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = ''.join(input().split('/'))
if s>20190430:
    print("TBD")
else:
    print("Heisei")
Problem p03206 (python)

Fixed submission:
d = int(input())
print('Christmas'+' Eve'*(25-d))

Buggy submission (verdict: Runtime Error):
d int(input())
print('Christmas'+' Eve'*(25-d))
Problem p03210 (python)

Fixed submission:
x = int(input())
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
x = int(input)
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')
Problem p03261 (python)

Fixed submission:
n = int(input())
lst = [input() for _ in range(n)]
lstset = set(lst)

if len(lst) != len(lstset):
    print("No")
else:
    cnt = 0
    for i in range(n-1):
        if lst[i][-1] == lst[i + 1][0]:
            cnt += 1
        else:
            break
    if cnt + 1 == len(lst):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [input() for _ in range(n)]
lstset = set(lst)

if len(lst) != len(lstset):
    print("No")
else:
    cnt = 0
    for i in range(n-1):
        if lst[i][-1] == lst[i + 1][0]:
            cnt += 1
        else:
            break
    if cnt + 1 == len(lst):
        print('Yes')
    else:

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [iuput() for _ in range(n-1)]
lstset = set(lst)
if len(lst) != len(lstset):
    print("No")
else:
    cnt = 0
    for i in range(n-1):
        if lst[i][-1] == lst[i][0]:
            cnt += 1
        else:
            break
    if cnt == len(lst):
        print('Yes')
    else:
        print('No')
Problem p03370 (python)

Fixed submission:
N,X = map(int,input().split())
#入力が一文字ずつだから split()は不要
moto = [int(input()) for _ in range(N)]

num = 0
for i in moto:
    num = num + int(i)

X = X - num
#余ったXから最小のmiを作れるだけ作る
k2 = X // min(moto)
#最初作った個数とその後最小のmiのものだけ作った個数の和
print(N + k2)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
moto = list(map(int,input().split()) for _ in range(N))

num = 0
for i in moto:
    num = num + i

k = 0
while X - num > num:
    X = X - num
    k += 1
#余ったXから最小のmiを作れるだけ作る
k2 = X % min(moto)
print(k1 + k2)
Problem p03416 (python)

Fixed submission:
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
    lst = list(str(i))
    if lst[0] == lst[-1] and lst[1] == lst[-2]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
    lst = list(i)
    if lst[0] == lst[-1] and lst[1] == lst[-2]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
    lst = list(i)
    if lst[0] == lst[-1] and lst[1] == lst[-2]:
        cnt += 1
plint(cnt)
Problem p03478 (python)

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

num = 0
for i in range(1,N+1):
    lst = list(str(i))
    s = sum(list(map(int,lst)))
    if A <= s <= B:
        num += i
print(num)

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

num = 0
for i in range(1,N+1):
    lst = list(str(i))
    s = sum(list(map(int,lst))
    if A <= s <= B:
        num += i
print(num)
Problem p03523 (python)

Fixed submission:
s = list(input())

if len(s) >= 9 and "".join(s) != "AKIHABARA":
    print("NO")
elif "".join(s) == "AKIHABARA":
    print("YES")
else:
    for i in range(2**(len(s)+1)):
        lst = [""]*50
        for j in range(len(s)+1):
            if i&(1<<j):
                lst[j] = "A"
        #print(lst)
        
        result = ""               
        for k1,k2 in zip(lst,s+["",""]):
            result += k1+k2
        #print(result)
        if result == "AKIHABARA":
            print("YES")
            exit()
        else:
            continue
    else:
        print("NO")

Buggy submission (verdict: Runtime Error):
ans = "AKIHABARA"


if len(s) >= 9 and s != "AKIHABARA":
    print("NO")
else:
    for i in range(2**(9-len(s)+2)):
        lst = [""]*50
        for j in range(9-len(s)+2):
            if i&(1<<j):
                lst[j] = "A"
        #print(lst)
        
        result = ""               
        for k1,k2 in zip(lst,s+[""]):
            result += k1+k2
        #print(result)
        if result == "AKIHABARA":
            print("YES")
            exit()
        else:
            continue
    else:
        print("NO")
Problem p03610 (python)

Fixed submission:
s = list(input())
array = []
for i in range(len(s)):
    if i % 2 == 0:
        array.append(s[i])
        #print(array)

print("".join(array),end="")

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)
#与えられた文字列をリスト化し分割
lst = list(n)

array = []
for i in range(n):
    array.append(lst[2*i])

new_lst = "".join(array)
print(new_lst)
Problem p03845 (python)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
m = int(input())

for i in range(m):
    lst = list(t)
    p,x = map(int,input().split())
    lst[p-1] = x
    print(sum(lst))

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

for i in range(m):
    lst = list(t)
    p,x = map(int,input().split())
    lst[p-1] = x
    print(sum(lst))

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

for i in range(m):
    lst = list(t)
    p,x = map(int,input().split())
    lst[p-1] = x
    print(sum(lst))
    print(lst)
Problem p04033 (python)

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

if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if ((b-a)-1) % 2  != 0:
        print("Negative")
    else:
        print("Positive")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
lst = list(range(a,b+1))

if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if ((b-a)-1) % 2  != 0:
        print("Negative")
    else:
        print("Positive")