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

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

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

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

if ( N % x ) == 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

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

if ( N % x ) == 0:
    print(( N // X ) * T )
elif ( N % x ) != 0:
    print(( N // X + 1 ) * T )

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

if ( N % x )== 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

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

if N % x == 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

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

if N % x == 0
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

Buggy submission (verdict: Runtime Error):
print(( N // X + 1 ) * T )

Buggy submission (verdict: Runtime Error):
print(( N // X + 1 ) * T )
Problem p03543 (python)

Fixed submission:

N = str(input())

if N[0] == N[1] and N[1] == N[2] :
    print('Yes')

elif N[1] == N[2] and N[2] == N[3]:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):

N = int(input())

if N[0] == N[1] and N[1] == N[2] :
    print('Yes')

elif N[1] == N[2] and N[2] == N[3]:
    print('Yes')

else:
    print('No')
Problem p03555 (python)

Fixed submission:

C1 =str(input())
C2 =str(input())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')

else:
    print('NO')

Buggy submission (verdict: Runtime Error):

C =str(input())


if C[0] == C[5] and C[1] == C[4] and C[2] == C[3]:
    print('Yes')

else:
    print('No')
Problem p04029 (python)

Fixed submission:
N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

print(int( a * b * 0.5 ))

Buggy submission (verdict: Runtime Error):
# 等差数列

N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

# print( a * b / 2 )

# TypeError: can only concatenate str (not "int")
# Nという文字と数字を連結できない??
print(math.floor(a * b / 2 )
Problem p02630 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
total = sum(a)
dct = {}
for i in range(n):
    if a[i] in dct:
        dct[a[i]] += 1
    else:
        dct[a[i]] = 1

for i in range(q):
    b, c = map(int, input().split())
    if b not in dct: dct[b] = 0
    if c not in dct: dct[c] = 0
    total += dct[b] * (c - b)
    print(total)
    
    dct[c] += dct[b]
    dct[b] = 0

Buggy submission (verdict: Runtime Error):
n = int(input())
_a = list(map(int, input().split()))
a = {}
for i in range(n):
    if _a[i] in a:
        a[_a[i]] += 1
    else:
        a[_a[i]] = 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    if b in a:
        if c not in a:
            a[c] = 0
        tmp = a[b]
        a[c] += tmp
        a[b] = 0
        sum_ = 0
        for k in a:
            sum_ += k * a[k]
    print(sum_)
Problem p02719 (python)

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

if k == 1:
    print(0)
    exit()
    
if n > k:
    n = n%k
    print(min(n, abs(n-k)))
else:
    print(min(n, abs(n-k)))

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

if k == 1:
    print(0)
    exit()

gcd = math.gcd(n, k)
print(gcd)
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
   
for i in range(n):
    if l[i] >= k:
        print(n-i)
        exit()
print(0)

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

if 1 == len(l):
    if l[0] >= k:
        print(1)
    else:
        print(0)
    exit()
        
suffix = n // 2
if l[suffix] <= k:
    for i in range(suffix, n+1):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
else:
    for i in range(suffix):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
            
print(0)
Problem p02953 (python)

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

prev = -999
for i in range(n):
    if prev <= h[i]-1: prev = h[i]-1
    elif prev <= h[i]: prev = h[i]
    else:
        print("No")
        exit()

print("Yes")

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

mini = h[0]
for i in range(1,n-1):
    
    if h[i]-1 > mini:
        print("No")
        exit()
    else:
        mini = h[i]
        
if h[n] <= h[n-1]:
    print("No")
    exit()
    
print("Yes")
Problem p03109 (python)

Fixed submission:
y, m, d = map(int, input().split('/'))
if m <= 4:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
y, m, d = map(int, input().split('/'))
print(y, m, def)
if m <= 4:
    print("Heisei")
else:
    print("TBD")
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
cells = []
for i in range(h):
    s = input().split()
    cells.append(s[0])
ans = True
for i in range(1,h-1):
    for j in range(1,w-1):
        if cells[i][j] == '#':
            if cells[i-1][j] != '#' and cells[i+1][j] != '#' and cells[i][j-1] != '#' and cells[i][j+1] != '#':
                ans = False
                break
 
if ans: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
cells = []
cells.append(['.']*(w+2))
for i in range(h):
    l = ['.']
    s = input().split()
    l+=list(s[0])
    l+=['.']
    cells.append(l)
cells.append(['.']*(w+2))

exist_sharp = False
for cell in cells:
    if '#' in cell:
        exist_sharp = True
if not exist_sharp:
    print("No")
    exit()
 
ans = True
for i in range(1,len(cells)-1):
    for j in range(1,len(cells)-1):
        if cells[i][j] == '#':
            if cells[i-1][j] != '#' and cells[i+1][j] != '#' and cells[i][j-1] != '#' and cells[i][j+1] != '#':
                ans = False

if ans: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
cells = []
cells.append(['.']*(w+2))
for i in range(h):
    l = ['.']
    s = input().split()
    l+=list(s[0])
    l+=['.']
    cells.append(l)
cells.append(['.']*(w+2))

ans = True
for i in range(1,len(cells)-1):
    for j in range(1,len(cells)-1):
        if cells[i][j] == '#':
            if cells[i-1][j] != '#' and cells[i+1][j] != '#' and cells[i][j-1] != '#' and cells[i][j+1] != '#':
                ans = False

if ans: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
cells = []
cells.append(['.']*(w+2))
for i in range(h):
    l = ['.']
    s = input().split()
    l+=list(s[0])
    l+=['.']
    cells.append(l)
cells.append(['.']*(w+2))

for i in range(1,len(cells)-1):
    for j in range(1,len(cells)-1):
        if cells[i][j] == '#':
            if cells[i-1][j] == '#':
                pass
            elif cells[i+1][j] == '#':
                pass
            elif cells[i][j-1] == '#':
                pass
            elif cells[i][j+1] == '#':
                pass
            else:
                print("No")
                exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
cells = []
cells.append(['0']*(w+2))
for i in range(h):
    l = [0]
    s = input().split()
    l+=list(s[0])
    l+=[0]
    cells.append(l)
cells.append([0]*(w+2))

is_ok = True
for i in range(1,len(cells)-1):
    for j in range(1,len(cells)-1):
        if cells[i][j] == '#':
            if cells[i-1][j] == '#':
                is_ok = True
            elif cells[i+1][j] == '#':
                is_ok = True
            elif cells[i][j-1] == '#':
                is_ok = True
            elif cells[i][j+1] == '#':
                is_ok = True
            else:
                is_ok = False
        if not is_ok:
            print("No")
            exit()
print("Yes")
Problem p03473 (python)

Fixed submission:
m = int(input())
 
print(24-m+24)

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

print(24-m+24
Problem p03605 (python)

Fixed submission:
s = input()
if '9' in s:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if s in '9':
  print('Yes')
 else:
  print('No')
Problem p03609 (python)

Fixed submission:
x, t = map(int, input().split())
if x-t >= 0:
  print(x-t)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x, t = map(int, input().split())
if x-t >= 0:
  print(x-t)
 else:
  print(0)
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
lo = len(o)
le = len(e)

if lo == le: l = lo
elif lo >= le: l = le
else: l = lo

s = ""
for i in range(l):
        s += o[i]
        s += e[i]
if lo - le == 1:
    s += o[-1]
print(s)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
lo = len(o)
le = len(e)

if lo >= le: l = lo
else: l = le

s = ""
for i in range(l):
        s += o[i]
        s += e[i]
print(s)
Problem p02576 (python)

Fixed submission:
n, m, t = input().split()
z = ((int(n)+int(m))-1)//int(m)
ans = z * int(t) 
print(ans)

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

z = (n+m-1)/m

ans = z * t

print(ans)
Problem p02947 (python)

Fixed submission:
import collections

n = int(input())
s = ["".join(sorted(input())) for i in range(n)]

counter = collections.Counter(s)

ans = 0
for i in counter.values():
   if i > 0:
        ans += i * (i - 1) // 2

print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    s = [["" for j in range(10)] for i in range(n)]

    for i in range(n):
        s[i] = list(input()).sort()

    print(int(count_anagram(s[0], s[1:], 0)))


def count_anagram(s, str_list, total):
    cnt = 0
    tmp = []
    for i, t in enumerate(str_list):
        if s == t:
            cnt += 1
            tmp.append(i)
    if cnt > 0:
        total += (cnt+1) * cnt / 2
        for i in tmp:
            str_list.pop(i)

    if str_list:
        return count_anagram(str_list[0], str_list[1:], total)
    else:
        return total


if __name__ == '__main__':
    main()
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())

def replace(x):
    newx = abs(x-K)
    if newx < K/2:
        print(newx)
    else:
        replace(newx)

replace(N)
Problem p02761 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():

    N, M = map(int, input().split())
    Set = []
    for i in range(M):
        Set.append(list(map(int, input().split())))

    for i in range(10**N):
        num = str(i)
        if len(num) == N and all(num[s-1]==str(c) for s,c in Set):
            print(i)
            break
    else:
        print(-1)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():

    N, M = map(int, input().split())
    Set = []
    for i in range(M):
        Set.append(list(map(int, input().split())))

    for i in range(10**N):
        num = str(i)
        if len(i) == N and all(num[s-1]==str(c) for s,c in Set):
            print(i)
            break
    else:
        print(-1)


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

Fixed submission:
import sys
input = sys.stdin.readline
import itertools

N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

R = list(itertools.permutations(range(1,N+1)))

print(abs(R.index(Q) - R.index(P)))

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

R = list(itertools.permutations(list(range(1,N+1))))
a = 0
b = 0

for i in range(len(R)):
    if list(R[i]) == P:
        a = i+1
    elif list(R[i]) == Q:
        b = i+1
    if a!=0 and b!=0:
        break
        
print(abs(a-b))
Problem p03494 (python)

Fixed submission:
input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = input()
A = np.array(list(map(int, input().split())))
count = 0
while all(a%2==0 for a in A):
    A = A/2
    count+=1
print(count)
Problem p02641 (python)

Fixed submission:
import sys

X, N = map(int, input().split())
P = list(map(int, input().split()))
NL = [ i for i in range(0, 102) if i == X or i not in P ]

if len(P) == 0 or X not in P:
    print(X)
    sys.exit()

idx = NL.index(X)
if NL[idx + 1] - X >= X - NL[idx-1]:
    print(NL[idx-1])
else:
    print(NL[idx+1])

Buggy submission (verdict: Runtime Error):
import sys

X, N = map(int, input().split())
P = list(map(int, input().split()))
NL = [i for i in range(-1000,1000) if i == X or i not in P]

if len(P) == 0:
    print(X)
    sys.exit()

idx = NL.index(X)
if abs(NL[idx + 1]) - X >= abs(NL[idx - 1]) - X ):
    print(NL[idx - 1])
else:
    print(NL[idx + 1])

Buggy submission (verdict: Runtime Error):
import sys

X, N = map(int, input().split())
P = list(map(int, input().split()))

l = [ i for i in range(1,101) ]

if len(P) == 0:
    print(X)
    sys.exit()

idx = l.index(X)

ans = 0
for i in range(1,100):
    if l[idx+i] not in P:
        ans = i
        break

ans1 = 0
for i in range(1,100):
    if l[idx-i] not in P:
        ans1 = i
        break

if ans<ans1:
    print(l[idx+ans])
else:
    print(l[idx-ans1])
Problem p02789 (python)

Fixed submission:
a, b = map(int, input().split())
if a == b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

a, b = map(int, input(), split())
if a == b:
    print("Yes")
else:
    print("No")
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())

print(T + S )

Buggy submission (verdict: Runtime Error):
    S, T = map(str, input().split())

    print(T + S )

Buggy submission (verdict: Runtime Error):
    S, T = map(str, input().split())

    print(T + S )
Problem p02772 (python)

Fixed submission:
N = int(input())
Nx = input().split()
g = []
for x in Nx:
    x = int(x)
    if x % 2 == 0:
        g.append(x)
ans = 0
for i in g:
    if not i % 3 == 0:
        if not i % 5 == 0:
            ans = 1
            break
        else:
          continue
    else:
        continue
if ans == 1:
    print("DENIED")
else:
    print("APPROVED")

Buggy submission (verdict: Runtime Error):
N = int(input())
Nx = input().split()
g = []
for x in Nx:
    if x % 2 == 0:
        g.append(x)

for i in g:
    if not i % 3 == 0:
        if not i % 5 == 0:
            print("DENIED")
            break
    else:
        continue
    print("APPROVED")
Problem p03145 (python)

Fixed submission:
a,b,c=list(map(int,(input()).split()))
print (int(((a)*(b))/2))

Buggy submission (verdict: Runtime Error):
s=int(input())
def is_even(num):
    return num % 2 == 0
list=[]
list.append(s)

def calc(s):
	if is_even(int(s)):
		return (int((s)/2))
		list.append(s)
	else:
		return (int((s)*3+1))
		list.append(s)
	s=int(calc(s))
check=[1,2,4]
for (s) in (check):
	if not (s) in (check):
		calc(s)
else:
	print (int(s)+3)
Problem p02576 (python)

Fixed submission:
n, x, t = input().split()
N = int(n)
X = int(x)
T = int(t)
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
C = int(c)
print(C*T)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = int(input())
T = int(input())
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c*T)

Buggy submission (verdict: Runtime Error):
print("a")
N = int(input("N = ?"))
X = int(input("X = ?"))
T = int(input("T = ?"))
if N % X = 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c)
Problem p02641 (python)

Fixed submission:
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,102))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = ""



    for i in reversed(range(len(l))):
     
        if l[i] != "":

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]          
            
print(kotae)

Buggy submission (verdict: Runtime Error):
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,6))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = 200


    for i in reversed(range(len(l))):
     
  

        if l[i] != 200:

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]
          
            



print(kotae)

Buggy submission (verdict: Runtime Error):
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(1,101))


if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]-1] = 0

    for i in reversed(range(len(l))):
        #print(l[i])
  

        if l[i] != 0:

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]
          
            



print(kotae)
Problem p02658 (python)

Fixed submission:
n = int(input())

a = [int(x) for x in input().split() ]
sum = a[0]

if 0 in a:
        sum = 0
else:
    for i in range(1,len(a)):
        sum = sum * a[i]
        if sum > 10**18:
            break
        


if sum > 10**18:
    print(-1)
else:
    print(sum)

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

a = [int(x) for x in input().split() if x != "1"]
sum = a[0]

if 0 in a:
        sum = 0
else:
    for i in range(1,len(a)):
        sum = sum * a[i]
        if sum > 10**18:
            break
        


if sum > 10**18:
    print(-1)
else:
    print(sum)

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

a = [int(x) for x in input().split() if x != "1"]

sum = a[0]

for i in range(1,len(a)):
    sum = sum * a[i]
    if 0 in a:
        sum = 0
        break
    elif sum > 10**18:
        break
    


if sum > 10**18:
    print(-1)
else:
    print(sum)

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

a = [int(x) for x in input().split() if x != "1"]

sum = a[0]

for i in range(1,len(a)):
    sum = sum * a[i]
    if 0 in a:
        sum = 0
        break
    elif sum > 10**18:
        break
    


if sum > 10**18:
    print(-1)
else:
    print(sum)
Problem p02681 (python)

Fixed submission:
import re

s = input()
t = input()

match_result = re.match(s+".",t)

if match_result:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re

s = input()
t = input()

match_result = re.match(s+".,t)

if match_result:
    print("Yes")
else:
    print("No")
Problem p02761 (python)

Fixed submission:
ok = True

NM = [map(int, input().split())]
N, M = [list(i) for i in zip(*NM)]

l = [-1] * N[0]

if M[0] != 0:
    sc = [map(int, input().split()) for _ in range(M[0])]
    s, c = [list(i) for i in zip(*sc)]

    for i in range(M[0]):
        if l[s[i]-1] == -1:
            l[s[i]-1] = c[i]
        elif l[s[i]-1] != c[i]:
            ok = False
            break
        
if l[0] == 0 and N[0] >= 2:
    ok = False
elif l[0] == -1:
    if N[0] >= 2:
        l[0] = 1
    else:
        l[0] = 0
    
for i in range(1,N[0]):
    if l[i] == -1:
        l[i] = 0
    
ans = ""   
if ok:
    for i in range(len(l)):
        ans = ans + str(l[i])
    print(ans)
else:
    print("-1")

#print(M[0],N[0])
#print(s[0],c[0])

Buggy submission (verdict: Runtime Error):
ok = True

NM = [map(int, input().split())]
N, M = [list(i) for i in zip(*NM)]
sc = [map(int, input().split()) for _ in range(M[0])]
s, c = [list(i) for i in zip(*sc)]

l = [-1] * N[0]


for i in range(M[0]):
    if l[s[i]-1] == -1:
        l[s[i]-1] = c[i]
    elif l[s[i]-1] != c[i]:
        ok = False
        break
        
if l[0] == 0:
    ok = False
elif l[0] == -1:
    l[0] = 1
    
for i in range(1,N[0]):
    if l[i] == -1:
        l[i] = 0
    
ans = ""   
if ok:
    for i in range(len(l)):
        ans = ans + str(l[i])
    print(ans)
else:
    print("-1")

#print(M[0],N[0])
#print(s[0],c[0])
Problem p02801 (python)

Fixed submission:


c = input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break

Buggy submission (verdict: Runtime Error):


c = raw_input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break

Buggy submission (verdict: Runtime Error):
import string

c = raw_input()



ls = string.ascii_lowercase

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break
Problem p02909 (python)

Fixed submission:
s = input()

list = ["","Sunny","Cloudy","Rainy"]

result = list.index(s)%3

print(list[result+1])

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

list = ["Sunny","Cloudy","Rainy"]

result = list.index(s)%3

print(list[result + 1])
Problem p03493 (python)

Fixed submission:


str = input()
print(str.count("1") )

Buggy submission (verdict: Runtime Error):
num = int(input())
x = input().split()
count = 0
TF = True
while TF: 
    
    for i in range(0,num):
        number = int(x[i])
        if(number%2==0):
            x[i] = number/2
            TF = True
        else:
            TF =False
    if TF:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
num = int(input())
x = input().split()
count = 0
TF = True
while TF: 
    count += 1
    for i in range(0,num):
        number = int(x[i])
        if(number%2==0):
            number = number/2
            x[i] =  number
            TF = True
        else:
            TF =False
print(count)
Problem p04001 (python)

Fixed submission:
s = input()

sum = 0

if len(s) > 1:

    l = ["+"] * (len(s) - 1)

    n = 2 ** (len(s) - 1)

    for i in range(n):
        l = ["+"] * (len(s) - 1)
        for j in range(len(l)):
            ls = list(s)
            if (i >> j) & 1:
                l[j] = ""
            for x in range(len(l)):
                
                ls.insert(2*x+1,l[x])
    
        

        maped_list = map(str, ls) 
        mojiretu = ''.join(maped_list)

        sum = sum + eval(mojiretu)

    print(sum)
else:
    print(s)

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

sum = 0

l = ["+"] * (len(s) - 1)

n = 2 ** (len(s) - 1)

for i in range(n):
    l = ["+"] * (len(s) - 1)
    for j in range(len(l)):
        ls = list(s)
        if (i >> j) & 1:
            l[j] = ""
        for x in range(len(l)):
            
            ls.insert(2*x+1,l[x])
   
    

    maped_list = map(str, ls) 
    mojiretu = ''.join(maped_list)

    sum = sum + eval(mojiretu)

print(sum)
Problem p02675 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[-1]=='2' or n[-1]=='4' or n[-1]=='5' or n[-1]=='7' or n[-1]=='9':
  print('hon')
elif n[-1]=='3':
  print('bon')
else:
  print('pon')
Problem p03597 (python)

Fixed submission:
a = int(input())
b = int(input())
print(a * a - b)

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

Buggy submission (verdict: Runtime Error):

a, b = map(int, input().split())
A = 0

print(a * a - b)
Problem p03773 (python)

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

A = a+b
B = A%24
print(B)

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

if (a+b>=24):
    print((a+b)-24)
else:
    print(a+b)
Problem p03814 (python)

Fixed submission:
s = input()
a_index = s.find("A")
z_index = s.rfind("Z")
print(z_index - a_index + 1)

Buggy submission (verdict: Runtime Error):
s = input()
a = s.fin("A")
z = s. find("Z")
print(z - a + 1)