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

Fixed submission:
# ABC098 D - Xor Sum 2
n=int(input())
a=list(map(int,input().split()))

l=0
r=1
tmp=a[0]
ans=0

while l<n:
    if r==n:
        ans+=(r-l)
        l+=1
        continue
    if tmp+a[r]==tmp^a[r]:
        tmp=tmp+a[r]
        r+=1
    else:
        ans+=(r-l)
        tmp=tmp-a[l]
        l+=1      

print(ans)

Buggy submission (verdict: Runtime Error):
# ABC098 D - Xor Sum 2
n=int(input())
a=list(map(int,input().split()))

l=0
r=1
tmp=a[0]
ans=0

while l<n:
    if r==n:
        ans+=(r-l)
        l+=1
        continue
    if tmp+a[r]==tmp^a[r]:
        tmp=tmp+a[r]
        j+=1
    else:
        ans+=(j-l)
        tmp=tmp-a[l]
        l+=1      

print(ans)
Problem p03477 (python)

Fixed submission:
# ABC083 A - Libra
a,b,c,d = map(int,input().split())

if a+b > c+d:
    print('Left')
elif a+b == c+d:
    print('Balanced')
elif a+b < c+d:
    print('Right')

Buggy submission (verdict: Runtime Error):
# ABC083 C - Multiple Gift
x,y = map(int,input().split())

ans = 0
while x <= y:
    x *= 2
    ans += 1
print(ans)
Problem p03488 (python)

Fixed submission:
s=input()
x,y=map(int,input().split())
t=s.split("T")
x-=len(t[0])
dx,dy=[],[]

for i,tt in enumerate(t[1:]):
  if i%2==1:
    dx.append(len(tt))
  else:
    dy.append(len(tt))

def is_ok(n,l):
  dp=set([0])
  for d in l:
    t=[]
    for v in dp:
      t.append(v+d)
      t.append(v-d)
    dp=set(t)
  return True if n in dp else False

if is_ok(x,dx) and is_ok(y,dy):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
x,y=map(int,input().split())
t=s.split("T")
x-=len(t[0])
dx,dy=[],[]

for i,tt in enumerate(t[1:]):
  if i%2==1:
    dx.append(len(tt))
  else:
    dy.append(len(tt))

def is_ok(n,l):
  dp=[[0]*16001 for _ in range(len(l)+1)]
  n+=8000
  dp[0][8000]=1
  for i in range(1,len(l)+1):
    for j in range(16001):
      if j+l[i-1]<=16000:
        dp[i][j+l[i-1]]|=dp[i-1][j]
      if j-l[i-1]>=0:
        dp[i][j-l[i-1]]|=dp[i-1][j]
  if dp[len(l)][n]==1:
    return True
  else:
    return False

if is_ok(abs(x),dx) and is_ok(abs(y),dy):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
x,y=map(int,input().split())
t=s.split("T")
x-=len(t[0])
dx,dy=[],[]

for i,tt in enumerate(t[1:]):
  if i%2==1:
    dx.append(len(tt))
  else:
    dy.append(len(tt))

def is_ok(n,l):
  dp=[[0]*18001 for _ in range(len(l)+1)]
  n+=9000
  dp[0][9000]=1
  for i in range(1,len(l)+1):
    for j in range(18001):
      if j+l[i-1]<=18000:
        dp[i][j+l[i-1]]|=dp[i-1][j]
      if j-l[i-1]>=0:
        dp[i][j-l[i-1]]|=dp[i-1][j]
  if dp[len(l)][n]==1:
    return True
  else:
    return False

if is_ok(abs(x),dx) and is_ok(abs(y),dy):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
x,y=map(int,input().split())
t=s.split("T")
x-=len(t[0])
dx,dy=[],[]

for i,tt in enumerate(t[1:]):
  if i%2==1:
    dx.append(len(tt))
  else:
    dy.append(len(tt))

def is_ok(n,l):
  dp=[[0]*20001 for _ in range(len(l)+1)]
  n+=10000
  dp[0][10000]=1
  for i in range(1,len(l)+1):
    for j in range(20001):
      if j+l[i-1]<=20000:
        dp[i][j+l[i-1]]|=dp[i-1][j]
      if j-l[i-1]>=0:
        dp[i][j-l[i-1]]|=dp[i-1][j]
  if dp[len(l)][n]==1:
    return True
  else:
    return False

if is_ok(abs(x),dx) and is_ok(abs(y),dy):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
x,y=map(int,input().split())
t=s.split("T")
x-=len(t[0])
dx,dy=[],[]

for i,tt in enumerate(t[1:]):
  if i%2==1:
    dx.append(len(tt))
  else:
    dy.append(len(tt))

def is_ok(n,l):
  dp=[[False]*20001 for _ in range(len(l)+1)]
  n+=10000
  dp[0][10000]=True
  for i in range(1,len(l)+1):
    for j in range(20001):
      if j+l[i-1]<=20000:
        dp[i][j+l[i-1]]|=dp[i-1][j]
      if j-l[i-1]>=0:
        dp[i][j-l[i-1]]|=dp[i-1][j]
  if dp[len(l)][n]:
    return True
  else:
    return False

if is_ok(abs(x),dx) and is_ok(abs(y),dy):
  print("Yes")
else:
  print("No")
Problem p03503 (python)

Fixed submission:
# ABC080 C - Shopping Street
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
f=[nl() for _ in range(n)]
p=[nl() for _ in range(n)]
o = []
ans = -10**10
for i in range(2**10):
    op = [0]*10
    for j in range(10):
        if ((i>>j)&1):
            op[10-1-j]=1
    if not any(op):
        continue
    else:
        o.append(op)

for oo in o:
    value = 0
    for i,ff in enumerate(f):
        t=0
        for j in range(10):
            if oo[j]==1 and ff[j]==1:
                t+=1
        value += p[i][t]
    ans = max(ans,value)

print(ans)

Buggy submission (verdict: Runtime Error):
# ABC080 C - Shopping Street
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
f=[nl() for _ in range(n)]
p=[nl() for _ in range(n)]
o = []
ans = -10**8
for i in range(2**10):
    op = [0]*10
    for j in range(10):
        if ((i>>j)&1):
            op[n-1-j]=1
    if not any(op):
        continue
    else:
        o.append(op)

for oo in o:
    value = 0
    for i,ff in enumerate(f):
        t=0
        for j in range(10):
            if oo[j]==1 and ff[j]==1:
                t+=1
        value += p[i][t]
    ans = max(ans,value)

print(ans)

Buggy submission (verdict: Runtime Error):
# ABC080 C - Shopping Street
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
f=[nl() for _ in range(n)]
p=[nl() for _ in range(n)]
o = []
ans = -10**8
for i in range(2**10):
    op = [0]*10
    for j in range(10):
        if ((i>>j)&1):
            op[n-1-j]=1
    if not any(op):
        continue
    else:
        o.append(op)

for oo in o:
    value = 0
    for i,ff in enumerate(f):
        # 同じ時刻の店
        t=0
        for j in range(10):
            if oo[j]==ff[j]==1:
                t+=1
        value += p[i][t]
    ans = max(ans,value)

print(ans)
Problem p03575 (python)

Fixed submission:
# ABC075 C - Bridge
def dfs(v):
    visited[v]=True
    for nv in range(n):
        if G[v][nv]==False:
            continue
        if visited[nv]:
            continue
        dfs(nv)

n,m = map(int,input().split())
G = [[False]*n for _ in range(n)]
ans = 0
visited = [False for _ in range(n)]
A,B = [],[]
for i in range(m):
    a,b = map(int,input().split())
    A.append(b-1)
    B.append(a-1)
    G[a-1][b-1]=G[b-1][a-1]=True

for i in range(m):
    G[A[i]][B[i]]=G[B[i]][A[i]]=False
    visited = [False for _ in range(n)]
    dfs(0)
    if all(visited):
        ans += 1
    G[A[i]][B[i]]=G[B[i]][A[i]]=True

print(m-ans)

Buggy submission (verdict: Runtime Error):
atodeyaruyo
Problem p03608 (python)

Fixed submission:
# ABC073 D - joisino's travel
import itertools
N,M,R=map(int, input().split())
r=list(map(int, input().split()))
inf=float("inf")
mat=[[inf]*N for _ in range(N)]

for i in range(M):
    a,b,c=map(int,input().split())
    if mat[a-1][b-1]>c:
        mat[a-1][b-1]=mat[b-1][a-1]=c

for i in range(R):
    r[i]-=1

ans=inf
for k in range(N):
    for i in range(N):
        for j in range(N):
            mat[i][j]=min(mat[i][j],mat[i][k]+mat[k][j])

for rr in itertools.permutations(r,R):
    t_sum=0
    for j in range(1,R):
        t_sum+=mat[rr[j-1]][rr[j]]
    ans=min(ans,t_sum)
print(int(ans))

Buggy submission (verdict: Runtime Error):
# ABC073 D - joisino's travel
import itertools
N,M,R=map(int, input().split())
r=list(map(int, input().split()))
inf=float("inf")
mat=[[inf]*N for _ in range(N)]
dist=[inf]*N
visited=[False]*N
for i in range(M):
    a,b,c=map(int,input().split())
    mat[a-1][b-1]=c
    mat[b-1][a-1]=c

for i in range(R):
    r[i]-=1

ans=inf
for i in range(N):
    for j in range(N):
        for k in range(N):
            mat[i][j]=min(mat[i][j],mat[i][k]+mat[k][j])

for rr in itertools.permutations(r,R):
    t_sum=0
    for j in range(1,R):
        t_sum+=mat[rr[j-1]][rr[j]]
    ans=min(ans,t_sum)
print(int(ans))

Buggy submission (verdict: Runtime Error):
# ABC073 D - joisino's travel
import itertools
N,M,R=map(int, input().split())
r=list(map(int, input().split()))
inf=float("inf")
mat=[[inf]*N for _ in range(N)]
dist=[inf]*N
visited=[False]*N
for i in range(M):
    a,b,c=map(int,input().split())
    mat[a-1][b-1]=mat[b-1][a-1]=c

for i in range(R):
    r[i]-=1

ans=inf
for i in range(N):
    for j in range(N):
        for k in range(N):
            mat[i][j]=min(mat[i][j],mat[i][k]+mat[k][j])

for rr in itertools.permutations(r,R):
    t_sum=0
    for j in range(1,R):
        t_sum+=mat[rr[j-1]][rr[j]]
    ans=min(ans,t_sum)
print(int(ans))
Problem p03635 (python)

Fixed submission:
m,n = map(int,input().split())
print((m-1)*(n-1))

Buggy submission (verdict: Runtime Error):
print((int(input())-1)*(int(input())-1))
Problem p03737 (python)

Fixed submission:
# 
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,b,c = map(str, input().split())
ans = ''
ans = a[0:1]+b[0:1]+c[0:1]
ans = ans.upper()
print(ans)

Buggy submission (verdict: Runtime Error):
# 
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,b,c = map(str, input().split())
ans = ''
ans = a[0:1]+b[0:1]+c[0:1]
ans = ans.upper()
pritn(ans)
Problem p03844 (python)

Fixed submission:
a,op,b = map(str,input().split())
a = int(a)
b = int(b)
print(a+b if op =='+' else a-b)

Buggy submission (verdict: Runtime Error):
a,op,b = map(int,input().split())
print(a+b if op =='+' else a-b)
Problem p03846 (python)

Fixed submission:
# ABC050 C - Lining Up
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
a.sort()

if n%2==0:
    for aa in a:
        if aa%2==0:
            print(0)
            exit()
    
    for i in range(n):
        if i%2==0:
            if a[i]!=a[i+1]:
                print(0)
                exit()
    print((2**(n//2))%mod)
else:
    for aa in a:
        if aa%2==1:
            print(0)
            exit()
    for i in range(n-1):
        if a[0]!=0:
            print(0)
            exit()
        if i%2==1:
            if a[i]!=a[i+1]:
                print(0)
                exit()
    print((2**(n//2))%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
sum = 0
ans = 0
zeroflg = 0

for i in range(len(A)-2):
    if N%2 == 0 and A[0] == 1 and A[N-1] == N-1:
        if N == 2:
            if A[0] == A[1]:
                sum = 2**(N/2)
            else:
                zeroflg = 1
        elif N > 2:
            if A[0] == A[1]:
                if  i%2 == 0 and A[i + 2] - A[i] == 2 and A[i + 1] - A[i] == 0:
                    sum = 2**(N/2)
                elif i%2 == 1 and A[i + 2] - A[i] == 2 and A[i + 1] - A[i] == 2:
                    sum = 2**(N/2)
                else:
                    zeroflg = 1
            else:
                zeroflg = 1
    elif N%2 == 1 and A[0] == 0 and A[N-1] == N-1:
        if N == 1:
            sum = 2**(N//2)
        elif N > 1: 
            if i%2 == 0 and A[i + 2] - A[i] == 2 and A[i + 1] - A[i] == 2:
                sum = 2**(N//2)
            elif i%2 == 1 and A[i + 2] - A[i] == 2 and A[i + 1] - A[i] == 0:
                sum = 2**(N//2)
            else:
                zeroflg = 1

if zeroflg == 1:
    print(ans)
else:
    ans = int(sum)
    ans%(10**9+7)
    print(ans)
Problem p04012 (python)

Fixed submission:
# ABC044 B - 美しい文字列 / Beautiful Strings
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

S = si()
SS = set()
for s in S:
    SS.add(s)

for ss in SS:
    if S.count(ss)%2==1:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
# ABC044 B - 美しい文字列 / Beautiful Strings
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

S = si()
SS = set()
for s in S:
    SS.add(s)

for ss in SS:
    if S.count(SS)%2==1:
        print('No')
        exit()
print('Yes')
Problem p02556 (python)

Fixed submission:
N=int(input())
a,b,c,d=0,1e10,-1e10,1e10
for i in range(N):
  A,B=input().split()
  A=int(A)
  B=int(B)
  a=max(a,A+B)
  b=min(b,A+B)
  c=max(c,A-B)
  d=min(d,A-B)
print(max(abs(a-b),abs(c-d)))

Buggy submission (verdict: Runtime Error):
N=int(input())
a,b,c,d=0,1e10,-1e10,1e10
for i in range(N):
  A,B=int(input().pulit())
  a=max(a,A+B)
  b=min(b,A+B)
  c=max(c,A-B)
  d=min(d,A-B)
print(max(abs(a-b),abs(c-d))
Problem p02613 (python)

Fixed submission:
N=int(input())
a,b,c,d=0,0,0,0
for i in range(N):
  A=input()
  if A=="AC":
    a+=1
  elif A=="WA":
    b+=1
  elif A=="TLE":
    c+=1
  else:
    d+=1
print("AC x",a)
print("WA x",b)
print("TLE x",c)
print("RE x",d)

Buggy submission (verdict: Runtime Error):
N=int(input())
a,b,c,d=0,0,0,0
for i in range(N):
  A=input()
  if A=="AC":
    a+=1
  elif A=="WA":
    b+=1
  elif A=="TLE":
    c+=1
  else:
    d+=1
print("AC x" a)
print("WA x" b)
print("TLE x" c)
print("RE x" d)

Buggy submission (verdict: Runtime Error):
N=input()
a,b,c,d=0,0,0,0
for i in range(N):
  A=input()
  if A=="AC":
    a+=1
  elif A=="WA":
    b+=1
  elif A=="TLE":
    c+=1
  else:
    d+=1
print("AC x" a)
print("WA x" b)
print("TLE x" c)
print("RE x" d)
Problem p02602 (python)

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k):
    if a[i+k] > a[i]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = [0]*(k+2)
ans[0] = 1
for i in range(k):
    ans[0] *= a[i]
print(ans[0])
for i in range(n-k):
    #print(i,ans)
    ans[i+1] = ans[i] * a[i+k] //a[i]
    if ans[i+1] > ans[i]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import operator
import functools
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = [0]*(k+2)
seki = functools.partial(functools.reduce, operator.mul)
ans[0] = seki(a[:k])
for i in range(n-k):
    #print(i,ans)
    ans[i+1] = ans[i] * a[i+k]
    ans[i+1] //= a[i]
for i in range(n-k):
    if ans[i+1] > ans[i]:
        print("Yes")
    else:
        print("No")
Problem p02719 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n >= k:
    print(min(n%k,abs(n%k-k)))
else:
    print(min(n,abs(k%n)))
Problem p02983 (python)

Fixed submission:
l,r = map(int,input().split())
ans = 2019
if r-l+1 >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min( (i*j) % 2019, ans)
    print(ans)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())
if r-l+1 >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min(i*j%2019,ans)
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
lcm = c*d // fractions.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
ans = B-A
print(b-a+1-ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
lcm = c*d // math.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
ans = B-A
print( b-a+1-ans )

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
lcm = c*d // math.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
sum = B-A
print( b-a+1-sum )

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
lcm = c*d // math.gcd(c,d)
A = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm) 
B = (b // c) + (b // d) - (b // lcm)
sum = B-A  #割り切れる個数
print( b-a+1-sum )
Problem p03062 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
num = 0
mi = 10**9
for i in range(n):
    num += abs(a[i])
    if abs(mi) >= abs(a[i]):
        mi = a[i]
cnt = 0
for i in range(n):
    if a[i] < 0:
        cnt += 1
if cnt%2 == 1:
    print(num-2*abs(mi))
else:
    print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
cnt = 0
l3 = abs(a[-3])
l2 = abs(a[-2])
l1 = abs(a[-1])
last = l3 + l2 + l1
if n == 2 and sum(a) >= 0:
    print(abs(sum(a)))
elif n == 2:
    print(max(abs(a[0]),abs(a[1])))
else:
    for i in range(n-3):
        if a[i] < 0:
            a[i] *= -1
            a[i+1] *= -1
        cnt += a[i]
    # +,+,+ or +,-,- or -,-,+ or -,+,-
    #print(cnt,a[-3],a[-2],a[-1])
    if (a[-3] >= 0 and a[-2] >= 0 and a[-1] >= 0) or (a[-3] >= 0 and a[-2] <= 0 and a[-1] <= 0) or (a[-3] <= 0 and a[-2] <= 0 and a[-1] >= 0) or (a[-3] <= 0 and a[-2] >= 0 and a[-1] <= 0):
        print(cnt+last)
    elif (a[-3] <= 0 and a[-2] >= 0 and a[-1] >= 0): # -,+,+
        print(cnt + last - 2*min(l1,l2,l3))
    else:
        print(cnt + last - 2*min(l1,l2))
Problem p03103 (python)

Fixed submission:
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
cnt = 0
i = 0
while cnt < m:
    ans += ab[i][0]*ab[i][1]
    cnt += ab[i][1]
    i += 1
print(ans - (cnt - m)*ab[i-1][0])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
cnt = 0
i = 0
while cnt < m:
    ans += ab[i][0]*ab[i][1]
    cnt += ab[i][1]
    i += 1
print(ans - (cnt - m)*ab[i][0])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab.sort()
ans = 0
cnt = 0
i = 0
while cnt < m:
    ans += ab[i][0]*ab[i][1]
    cnt += ab[i][1]
    i += 1
print(num - (cnt - m)*ab[i][0])
Problem p03150 (python)

Fixed submission:
s = str(input())
n = len(s) - 7
for i in range(n,len(s)):
    if s[:i-n] + s[i:] == "keyence":
        print("YES")
        exit()
print("NO")

Buggy submission (verdict: Runtime Error):
s = str(input())
i = 0
ch = "keyence"
while len(s) > 7:
    if s[i] != ch[i]:
        s = s[:i] + s[i+1:]
    else:
        i += 1
if s == ch:
    print("YES")
else:
    print("NO")
Problem p03399 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
sum1=0
sum2=0
if a<=b:
    sum1=a
else:
    sum1=b
if c<=d:
    sum2=c
else:
    sum2=d
print(sum1+sum2)
Problem p03434 (python)

Fixed submission:
N=int(input())
A= list(map(int,input().split()))
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)
Problem p03485 (python)

Fixed submission:
a,b = map(int,input().split())
if (a+b)%2==1:
    print((a+b)//2+1)
else:
    print((a+b)//2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a+b)%2==1:
    print((a+b)//@2+1)
else:
    print((a+b)//2)
Problem p03523 (python)

Fixed submission:
s = input()
# AKIHABARA
if (s == "AKIHABARA") or (s == "AKIHABAR") or (s == "AKIHABRA") or (s == "AKIHABR") or (s == "AKIHBARA") or (s == "AKIHBAR") or (s == "AKIHBRA") or (s == "AKIHBR") or (s == "KIHABARA") or (s == "KIHABAR") or (s == "KIHABRA") or (s == "KIHABR") or (s == "KIHBARA") or (s == "KIHBAR") or (s == "KIHBRA") or (s == "KIHBR"):
     print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
# AKIHABARA
if (s == "AKIHABARA") or (s == "AKIHABAR") or (s == "AKIHABRA") or (s == "AKIHABR") or (s == "AKIHBARA") or (s == "AKIHBAR") or (s == "AKIHBRA") or (s == "AKIHBR")
or (s == "KIHABARA") or (s == "KIHABAR") or (s == "KIHABRA") or (s == "KIHABR") or (s == "KIHBARA") or (s == "KIHBAR") or (s == "KIHBRA") or (s == "KIHBR"):
     print("YES")
else:
    print("NO")
Problem p03567 (python)

Fixed submission:
s = input()
if "AC" in s:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s in "AC":
  print("Yes")
 else:
  print("No")
Problem p03844 (python)

Fixed submission:
a,b,c = input().split()
if b == "+":
    print(int(a)+int(c))
else:
    print(int(a)-int(c))

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
if b == "+":
    print(a+c)
else:
    print(a-b)
Problem p03853 (python)

Fixed submission:
h,w = map(int,input().split())
for i in range(h):
  c = input()
  print(c)
  print(c)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
for i in range(h):
  c = list(map(int,input().split()))
  print(c)
  print(c)
Problem p02675 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)

def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = input()
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    s=N[-1]
    l1=("2","4","5","7","9")
    l2=("0","1","6","8")
    if s in l1:
        print('hon')
    elif s in l2: print('pon')
    else: print("bon")






if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
a