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

Fixed submission:
x = int(input())

num = x // 3
rem = x % 3

if rem == 1:
    res = (num+1)*(num**2)

elif rem == 2:
    res = ((num + 1) ** 2) * num

else:
    res = num ** 3

res2 = (x/3)**3
if res > res2:
    print(res)
else:
    print(res2)

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

num = x // 3
rem = x % 3

if rem == 1:
    res = (num+1)*(num**2)

elif rem == 2:
    res = ((num + 1) ** 2) * num

else:
    res = num ** 3

res2 = (x/3)**3
if res > res2:
    print(res)
else:
Problem p02765 (python)

Fixed submission:
N, R = map(int, input().split())
if N < 10:
    print((100*(10-N))+R)
else:
    print(R)

Buggy submission (verdict: Runtime Error):
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Buggy submission (verdict: Runtime Error):
def toStr(n,base):
    convertString = "0123456789ABCDEF"
    if n < base:
        return convertString[n]
    else:
        return toStr(n//base,base) + convertString[n%base]

a,b = map(int,input().split())
print(len(toStr(a,b)))

Buggy submission (verdict: Runtime Error):
n= int(input())
r = int(input())
k = 0
if(n<10):
    k=100*(10-n)+r
    print(k)
else:
    print(r)

Buggy submission (verdict: Runtime Error):
n= int(input())
r = int(input())
k = 0
if(n<10):
    k=100*(10-n)
    print(k)
else:
    print(r)

Buggy submission (verdict: Runtime Error):
n, r = int(input())
k = 0
if(n<10):
    k=100*(10-n)
    print(k)
else:
    print(r)
Problem p02786 (python)

Fixed submission:
h = int(input())

result = 0
i = 1
while h > 0:
    h = h // 2
    result = result + i
    i *= 2

print(result)

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

m = [i for i in input().split()]

result = 0

for i in m:
    result += int(i)

if result >= h:
    print('Yes')
else:
    print('No')

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

m = [i for i in input().split()]

result = 0

for i in m:
    result += int(i)

if result >= h:
    print('Yes')
else:
    print('No')
Problem p02811 (python)

Fixed submission:
K, X = [int(i) for i in input().split()]
print("Yes" if 500*K>=X else "No")

Buggy submission (verdict: Runtime Error):
10
ZABCDBABCQ

Buggy submission (verdict: Runtime Error):
k=int(input())
x=int(input())
k=k*500
if k<x:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
x=int(input())
k=k*500
if k<x:
  print("Yes")
else:
  print("No")
Problem p02582 (python)

Fixed submission:
s = input()

table = {'RRR':3,'RRS':2,'RSR':1,'RSS':1,'SRS':1,'SRR':2,'SSS':0,'SSR':1}

for key,value in table.items():
    if key==s:
        print(value)

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

sLength = set(L)
count = 0

for i in sLength:
    for j in sLength:
        for k in sLength:
            if i!=j and i!=k and j!=k:
                m = max([i,j,k])
                if i+j+k-2*m>0:
                    count+=1

print(count)
Problem p03434 (python)

Fixed submission:
n = int(input())
nums = list(map(int,input().split()))
alice = 0
bob = 0

nums.sort()
while nums:
    alice+=nums.pop()
    if nums:
        bob+=nums.pop()

print(alice-bob)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
alice = 0
bob = 0

nums.sort()
while nums:
    alice+=nums.pop()
    bob+=nums.pop()

print(alice-bob)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if s == t[:len(s)]:
    print("Yes")
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s, t = input().split(" ")
if t.__contains__(s):
    print("Yes")
else:
    print('No')
Problem p02717 (python)

Fixed submission:
x,y,z = map(int, input().split())
temp = y
y = x
x = z
z = temp
print(x,y,z)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()
z = input()
temp = y
y = x
x = z
z = temp
print(x,y,z)
Problem p02719 (python)

Fixed submission:
n,k = map(int,input().split())
if n % k ==0:
    print(0)
else:
    l = [n]
    p = n//k
    c = n-(p*k)
    half = k//2
    while c > half:
        c = abs(c-k)
    l.append(c)
    print(min(l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n % k ==0:
    print(0)
else:
    l = [n]
    p = n//k
    c = n-(p*k)
    half = k//2
    while c > half
        c = abs(c-k)
    l.append()
    print(min(l))
Problem p02658 (python)

Fixed submission:
import sys

N = int(input())
A = list(map(int, input().split()))

if 0 in A:
    print(0)
    sys.exit(0) 

Π = 1
for _ in A:
    Π *= _
    if(Π > 1000000000000000000):
        print(-1)
        sys.exit(0)

print(Π)

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

if 0 in A:
    print(0)
    return 

Π = 1
for _ in A:
    Π *= _
    if(Π > 1000000000000000000):
        print(-1)
        return 

print(Π)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

flag = True

for i in range(len(S)):
    if(S[i] != T[i]):
        flag = False

if(flag):
    print('Yes')
else:
    print('No')

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

if( A + B >= K ):
    if(A >= K):
        print(K)
    else:
        print(A)
else:
    print(+1*A -1*(K-(A+B)))
Problem p02812 (python)

Fixed submission:
def solve():
    N = int(input())
    S = input()
    count = 0

    for i in range(N-2):
        if(S[i] == "A" and S[i+1] == "B" and S[i+2] == "C"):
            count += 1

    print(count)


if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    S = input()
    count = 0

    for i in range(N):
        if(S[i] == "A" and S[i+1] == "B" and S[i+2] == "C"):
            count += 1

    print(count)


if __name__ == "__main__":
    solve()
Problem p02582 (python)

Fixed submission:
s = list(input())

if(s[0] == s[1] == s[2] == "R"):
    ans = 3
elif(s[0] == s[1] == "R" or s[2] == s[1] == "R"):
    ans = 2
elif(s[0] == s[1] == s[2] == "S"):
    ans = 0
else:
    ans = 1

print(ans)

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

if(s[0] == s[1] == s[2] == "R"):
    ans = 3
elif(s[0] == s[1] == "R" or s[2] == s[1] == "R"):
    ans = 2
elif(s[0] == s[1] == s[2] == "S"):
    ans = 0
else:
    ans = 1

pritn(ans)
Problem p02602 (python)

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

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

for i in range(k,n):
    if(a[i] > a[i-k]):
        print("Yes")
    else:
        print("No")

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

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

a_sum = [0 for _ in range(n+1)]
a_sum[0] = 1


a_sum[1:] = np.cumprod(a)
#print(a_sum)

score = [0 for _ in range(n-k+1)]

for i in range(k,n+1):
    score[i-k] = int(a_sum[i]/a_sum[i-k])

#print(score)

for i in range(1,n-k+1):
    if(score[i] > score[i-1]):
        print("Yes")
    else:
        print("No")

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

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

a_sum = [0 for _ in range(n+1)]
a_sum[0] = 1


a_sum[1:] = np.cumprod(a)
#print(a_sum)

score = [0 for _ in range(n-k+1)]

for i in range(k,n+1):
    score[i-k] = int(a_sum[i]/a_sum[i-k])

#print(score)

for i in range(1,n-k+1):
    if(score[i] > score[i-1]):
        print("Yes")
    else:
        print("No")
Problem p02684 (python)

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

a  = [0]*n

a = [int(s) for s in input().split()]

nxt = a[0]

seen = [1]
load = set()
load.add(1)
res = 0
flag = 0
for i in range(k-1):
    #print(seen)
    #print(nxt)
    if not(nxt in load):
        seen.append(nxt)
        load.add(nxt)
        nxt = a[nxt-1]
    else:
        root = i - seen.index(nxt) + 1
        #print(root)
        #print(k-1-i)
        zansa = (k-1-i)%root
        res = seen[seen.index(nxt)+zansa]
        flag = 1
        break


if(flag == 1):
    print(res)
else:
    print(nxt)

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

a  = [0]*n

a = [int(s) for s in input().split()]

nxt = a[0]

seen = [0]*n
seen[0] = 1
#load = []
res = 0
flag = 0
for i in range(k-1):
    #print(seen)
    #print(nxt)
    if not(nxt in seen and i > n):
        seen[i+1] = nxt
        nxt = a[nxt-1]
    else:
        root = i - seen.index(nxt) + 1
        #print(root)
        #print(k-1-i)
        zansa = (k-1-i)%root
        res = seen[seen.index(nxt)+zansa]
        flag = 1
        break


if(flag == 1):
    print(res)
else:
    print(nxt)

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

a  = [0]*n

a = [int(s) for s in input().split()]

nxt = a[0]

seen = []
load = []

for i in range(k-1):
    #print(nxt)
    if not(nxt in seen):
        seen.append(nxt)
        nxt = a[nxt-1]
    else:
        root = i - seen.index(nxt)
        zansa = (k-1-i)%root
        res = seen[seen.index(nxt)+zansa]
        break



print(res)
Problem p02768 (python)

Fixed submission:
import math

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

p = 10**9 + 7


def cmb(n, r):
    total = 1
    for i in range(r):
        total = total * (n - i) % p
        
    return total * pow(math.factorial(r), p - 2, p) % p

total = pow(2, n, p)-1
a_total = cmb(n, a)
b_total = cmb(n, b)
print((total - a_total - b_total) % p)

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

fac = [0 for _ in range(n+1)]
inv = [0 for _ in range(n+1)]
finv = [0 for _ in range(n+1)]

fac[0] =fac[1]= 1
inv[0] =inv[1]= 1
finv[0] = finv[1] = 1

p = 10**9 + 7
#p = 31
#inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
for i in range(2,n+1):
    fac[i] = (fac[i-1]*i)%p
    inv[i] = (p - inv[p%i]*int(p/i)%p)%p
    finv[i] = (finv[i-1]*inv[i])%p
    
#print(fac)
#print(inv)
#print(finv)

def cal(m,k):
    return fac[m]*(finv[k]*finv[m-k]%p)%p

ans=pow(2,n,mod) - 1
ans = (ans - cal(n,a) - cal(n,b))%p

if(ans<0):
    ans = -1*ans

print(ans)
Problem p02780 (python)

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

pi = [0 for _ in range(n)]
si = [0 for _ in range(n)]

pi = [int(s) for s in input().split()]
pi = [(1+s)/2 for s in pi]

si[0] = pi[0]
for i in range(1,n):
    si[i] = si[i-1] + pi[i]

#print(pi)
#print(si)
#print(si[2]-si[0])

ans = 0
if not (n==k):
    for i in range(n-k):
        ans = max(si[i+k]-si[i],ans)
else:
    ans = si[n-1]

print(float(ans))

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

pi = [0 for _ in range(n)]
si = [0 for _ in range(n)]

pi = [int(s) for s in input().split()]
pi = [(1+s)/2 for s in pi]

si[0] = pi[0]
for i in range(1,n):
    si[i] = si[i-1] + pi[i]

#print(pi)
#print(si)
#print(si[2]-si[0])

ans = 0
for i in range(n-k+1):
    ans = max(si[i+k]-si[i],ans)

print(float(ans))
Problem p02803 (python)

Fixed submission:
from collections import deque

h,w = map(int,input().split())
maze = [[False for _ in range(w)] for _ in range(h)]


for i in range(h):
    maze[i] = list(input())

#print(maze)

def bfs(x,y):
    seen = [[False for _ in range(w)] for _ in range(h)]
    dist = [[False for _ in range(w)] for _ in range(h)]
    
    if(maze[y][x] == "#"):
        return [[0]]
    
    dist[y][x] = 0
    d = deque()
    d.append(x + w*y)
    #print(d)
    while d:
        #print(d)
        base = d.popleft()
        #print(base)
        xx = base%w
        yy = base//w
        #print(*seen,sep='\n')
        #print("-------")
        if(seen[yy][xx] == True):
            continue
        else:
            seen[yy][xx] = True
        
        for px,py in [(-1,0),(1,0),(0,-1),(0,1)]:
            #print(xx+px,yy+py)
            if (0<= xx+px < w and 0<= yy+py < h):
                if(maze[yy+py][xx+px] == "." and seen[yy+py][xx+px] == False):
                    d.append(xx+px+(yy+py)*w)
                    dist[yy+py][xx+px] = dist[yy][xx] + 1
    
    return dist

#result = bfs(0,2)  

#print(*result,sep ="\n")
ans = 0
for j in range(h):
    for k in range(w):
        res = 0
        result = bfs(k,j)
        for i in result:
            res = max(max(i),res)
        ans = max(ans,res)
        


print(ans)

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

h,w = map(int,input().split())
maze = [[False for _ in range(w)] for _ in range(h)]


for i in range(h):
    maze[i] = list(input())

#print(maze)

def bfs(x,y):
    seen = [[False for _ in range(w)] for _ in range(h)]
    dist = [[False for _ in range(w)] for _ in range(h)]
    
    if(maze[y][x] == "#"):
        return [[0]]
    
    dist[y][x] = 0
    d = deque()
    d.append(x + w*y)
    #print(d)
    while d:
        #print(d)
        base = d.popleft()
        #print(base)
        xx = base%w
        yy = base//w
        #print(*seen,sep='\n')
        #print("-------")
        if(seen[yy][xx] == True):
            continue
        else:
            seen[yy][xx] = True
        
        for px,py in [(-1,0),(1,0),(0,-1),(0,1)]:
            #print(xx+px,yy+py)
            if (0<= xx+px < w and 0<= yy+py < h):
                if(maze[yy+py][xx+px] == "." and seen[yy+py][xx+px] == False):
                    d.append(xx+px+(yy+py)*w)
                    dist[yy+py][xx+px] = dist[yy][xx] + 1
    
    return dist

result = bfs(0,2)  

#print(*result,sep ="\n")
ans = 0
for j in range(h):
    for k in range(w):
        res = 0
        result = bfs(k,j)
        for i in result:
            res = max(max(i),res)
        ans = max(ans,res)
        


print(ans)
Problem p02606 (python)

Fixed submission:
L,R,d=map(int,input().split())
print(R//d - (L-1)//d)

Buggy submission (verdict: Runtime Error):
L,R,d=map(int,input().split())
print(R//d - (L-1)//d)ac
Problem p02866 (python)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
 
from collections import Counter
q=Counter(d)

# 例外対応
if q[0]!=1 or d[0]!=0:
  print(0)
  exit()

ans = 1
for i in range(1,max(d)+1):
  ans *= q[i-1]**q[i]
  if ans == 0:
    break
print(ans%998244353)

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

from collections import Counter
q=Counter(d)

if q[0]!=1 or d[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]
    if ans == 0:
        break
print(ans%998244353)

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

from collections import Counter
q=Counter(d)

if d[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]
print(ans%998244353)

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

from collections import Counter
q=Counter(d)

if D[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]
print(ans%998244353)

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

from collections import Counter
q=Counter(d)

if D[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]

print(ans%998244353)

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

from collections import Counter
q=Counter(d)

if D[0]!=0:
    print(0)
    exit()

ans=1
for i in range(1,max(D)+1):
    ans*=q[i-1]**q[i]
print(ans%998244353)
Problem p02582 (python)

Fixed submission:
s = input()

if s == 'SSS':
    print(0)
if s == 'RRR':
    print(3)
if s == 'SRR':
    print(2)
if s == 'RRS':
    print(2)
if s == 'SRS':
    print(1)
if s == 'RSR':
    print(1)
if s == 'SSR':
    print(1)
if s == 'RSS':
    print(1)

Buggy submission (verdict: Runtime Error):
import numpy as np

s = input()

li = []
for i in s:
    li.append(i)

if "R" not in li:
    print(0)
    exit()

for i in range(3):
    if li[i] == "R":
        li[i] = 1
    else:
        li[i] = 0

li_array = np.array(li)
temp = np.arange(len(li_array))

temp[li_array>0] = 0
np.maximum.accumulate(temp,out=temp)
left = temp

x_reversed = li_array[::-1]
temp  = np.arange(len(li_array))
temp[x_reversed>0] = 0
np.maximum.accumulate(temp,out=temp)
right = len(li_array) - 1 - temp[::-1]

y = right
y -= left + 1
y[li_array==0] = 0
print(np.max(y)+1)
Problem p02600 (python)

Fixed submission:
x = int(input())

if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <=1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
elif 1800 <= x <= 1999:
    print(1)

Buggy submission (verdict: Runtime Error):
import numpy as np

n, k = map(int,input().split())
a = list(map(int,input().split()))

for i in range(n-k):
    a_i = np.prod(a[i:k+i])
    a_i2 = np.prod(a[i+1:k+i+1])

    if a_i < a_i2:
        print('Yes')
    else:
        print('No')

        a.pop(0)
Problem p02639 (python)

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

count = 0
for i in s:
    if i != 0:
        count+=1
    elif i == 0:
        count+=1
        print(count)

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


for i in range(1, N+1,1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print('Yes')
        break
    elif N == M:
        print('No')
        break
    elif N >= M:
        print('No')
        break
else:
    print('No')
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

for a in range(x+1):
    b = x - a
    if a*2 + b*4 == y:
        print('Yes')
        break
else:
    print('No')

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

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans == 10**18+1:
        print(-1)

else:
    print(ans)
Problem p02657 (python)

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

print(a[0]*a[1])

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

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

print(ans)

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

n = 1

for i in a:
    n *= i
    if n > 10**18:
        print('-1')
        break
else:
    print(n)

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

print(a[0]*a[1])

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))

print(a[0]*a[1])

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

print(a*b)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = int(input())
print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(a*b)
Problem p02658 (python)

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

ans = 1

for i in As:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

else:
    print(ans)

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

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10**18+1)

if ans == 10**18+1:
    print(-1)

print(ans)

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

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10*18+1)
if ans == 10**18+1:
    print('-1')
    break

print(ans)

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

ans = 1

for i in as:
    ans *= i

ans = min(ans, 10*18+1)
if ans == 10**18+1:
    print('-1')\
    break

print(ans)

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

ans = 1

for i in as:
    ans *= i
    ans = min(ans, 10*18+1)
    if ans == 10**18+1:
        print('-1')

else:
    print(ans)

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

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans == 10**18+1:
        print('-1')

else:
    print(ans)

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

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans <= 10**18+1:
        print(-1)

else:
    print(ans)
Problem p02675 (python)

Fixed submission:
n = input()

a = int(n[-1])

if a==2 or a==4 or a==5 or a==7 or a==9:
    print('hon')
elif a==0 or a==1 or a==6 or a==8:
    print('pon')
else:
    print('bon')

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

a = int(n[-1])

if n==2  or n==2  or n==5  or n==7  or n==9:
    print('hon')
elif n== 0 or n==1  or n==6  or n==8:
    print('pon')
else:
    print('bon')

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

a = n[-1]

if a==2 or a==4 or a==5 or a==7 or a==9:
    print('hon')
elif a==0 or a==1 or a==6 or a==8:
    print('pon')
elif a==3:
    print('bon')
Problem p02681 (python)

Fixed submission:
a = [input() for i in range(2)]

s = a[0]
t = a[1]

if s == t[:-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#In[]:
a,b,c,k = map(int,input().split())

ans = 0

ans += min(a,k)
k -= min(a,k)
ans += min(b,k)
k -= min(b,k)
ans += min(c,k)
k -= min(c,k)

print(ans)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(2)]

s = a[0]
t = s[1]

if s == t[:-1]:
    print('Yes')
else:
    print('No')
Problem p02765 (python)

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

if n[0] < 10:
  a = 100*(10-n[0])
  print(n[1]+a)
else:
  print(n[1])

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

n1 = n[0]
n2 = n[1]

if n1 < 10:
  print(n2 - (100*(10-n1)))
else:
  print(n2)
Problem p02645 (python)

Fixed submission:
name = input()
print(name[:3])

Buggy submission (verdict: Runtime Error):
import numpy as np
from numba import njit

@njit(cache=True)
def light(n,a_list):
    outcome= np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        outcome[max(0,i-a_list[i])] += 1
        outcome[min(n,i+a_list[i]+1)] -= 1
    outcome = np.cumsum(outcome)[:-1]
    return outcome
 
for _ in range(k):
    if min(a) == n:
        break
    a = light(n,a)
 
[print(aa,end=' ') for aa in a]
Problem p02647 (python)

Fixed submission:
N, K = map(int, input().split())
import numpy as np
A = np.array(input().split(), dtype=int)
I = np.arange(0, N)
for i in range(K):
  X = np.zeros(N + 1, int)
  np.add.at(X, np.maximum(0, I - A), 1)
  np.add.at(X, np.minimum(N, I + A + 1), -1)
  A = X.cumsum()[:-1]
  if np.all(A == N):
    break
print(*A)

Buggy submission (verdict: Runtime Error):
import numpy as np
from numba import njit

@njit(cache=True)
def light(n,a_list):
    outcome= np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        outcome[max(0,i-a_list[i])] += 1
        outcome[min(n,i+a_list[i]+1)] -= 1
    outcome = np.cumsum(outcome)[:-1]
    return outcome
 
for _ in range(k):
    if min(a) == n:
        break
    a = light(n,a)
 
[print(aa,end=' ') for aa in a]

Buggy submission (verdict: Runtime Error):
@njit(cache=True)
def light(n,a_list):
    outcome= np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        outcome[max(0,i-a_list[i])] += 1
        outcome[min(n,i+a_list[i]+1)] -= 1
    outcome = np.cumsum(outcome)[:-1]
    return outcome
 
for _ in range(k):
    if min(a) == n:
        break
    a = light(n,a)
 
[print(aa,end=' ') for aa in a]
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
def cir(r):
  return 2*math.pi*r
print(cir(r))

Buggy submission (verdict: Runtime Error):
r = int(input())
def cir(r):
  return math.pi*r**2
print(cir(r))

Buggy submission (verdict: Runtime Error):
r = int(input())
def cir(r):
  return math.pi*r**2
print(cir(r))