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

Fixed submission:
# coding:utf-8
[A, B] = [int(i) for i in input().split(" ")]
if (1 <= A <= 9) and (1 <= B <= 9):
    print(A*B)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
A,B = [int(i) for i in input().split]
if (1 <= A <= 9) and (1 <= B <= 9):
    print(A*B)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
A,B = [int(i) for i in input().split]
if (1 <= A <= 9) and (1 <= B <= 9):
    print(A*B)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
A = int(input())
B = int(input())
if (1 <= A <= 9) and (1 <= B <= 9):
    print(A*B)
else:
    print(-1)
Problem p02835 (python)

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

sum = 0
for i in number:
 sum += i
 
if(sum>21): 
 print("bust")
else:
 print("win")

Buggy submission (verdict: Runtime Error):
number = input().split()

for i in number:
 sum = sum + i
 
if(sum>21): 
 print("bust")
else:
 print("win")
Problem p02835 (python)

Fixed submission:
sum = 0;
x = list(map(int,input().split()))
for i in x:
    sum += i
if sum > 21:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
sum = 0;
for i in range(3):
    x = input()
    num_x = int(x)
    sum += num_x
if sum >= 21:
    print("bust")
else:
    print("win")
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(map(str, input()))

if S[K-1] == 'A':
    S[K-1] = 'a'
elif S[K-1] == 'B':
    S[K-1] = 'b'
else:
    S[K-1] = 'c'
    
T = ''.join(S)

print(T)

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

if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
else:
    S[K] = 'c'
    
T = ''.join(S)

print(T)

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

if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
else:
    S[K] = 'c'

print(S)
Problem p03072 (python)

Fixed submission:
N = int(input()) 
hotel = list(map(int, input().split())) #入力してint型リストに格納
view = 1

for i in range (1, N, 1):
    judge = 1
    for j in range (0, i, 1):
        if hotel[i] >= hotel[j]:
            pass#何もしない
        else:
            judge = 0
            break
    if judge == 1:
        view += 1

print (view)

Buggy submission (verdict: Runtime Error):
N = int(input()) 
hotel = [int(input()) for i in range(N)] #リストの内包表記
view = 1

for i in range (1, N, 1):
    judge = 1
    for j in range (0, i, 1):
        if hotel[i] >= hotel[j]:
            pass#何もしない
        else:
            judge = 0
            break
    if judge == 1:
        view += 1

print (view)

Buggy submission (verdict: Runtime Error):
N = int(input()) 
hotel = list(map(int, input().split())) #入力してint型リストに格納
view = 1

for i in range (1, N-1, 1):
    judge = 1
    for j in range (0, i, 1):
        if hotel[i] >= hotel[j]:
            pass　#何もしない
        else:
            judge = 0
    if judge == 1:
        view += 1

print (view)
Problem p02859 (python)

Fixed submission:
r = int(input())
 
r1 = 1
 
print(int(r**2))

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

r1 = 1

printint(((r**2)/(r1**2)))
Problem p02879 (python)

Fixed submission:
a,b = map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
    print(a*b)
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
a.b = map(int,input().split())
if 1<=a<=9 and 1<=b<=9:
    print(a*b)
elif:
    print("-1")
Problem p02835 (python)

Fixed submission:
values = input().split()
values = [int(x) for x in values]

sum = 0

for val in values:
    sum += val

if sum >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
values = input()
values = [int(x) for x in values]
 
sum = 0
 
for val in values:
  sum += val
  
if sum >= 22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
values = input()
values = [int(x) for x in values]

sum = 0

for val in values:
  sum += val
  
if val >= 22:
  print("bust")
else:
  print("win")
Problem p02835 (python)

Fixed submission:
A1, A2, A3 = [int(x) for x in input().split(' ')]
if A1 + A2 + A3 >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
A1, A2, A3 = input().split(' ')
if A1 + A2 + A3 >= 22:
    return 'bust'
else:
    return 'win'
Problem p02836 (python)

Fixed submission:
str = input()
lst = list(str)
count = 0

for i in range(int(len(lst)/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)

Buggy submission (verdict: Runtime Error):
str = input()
lst = list(reversed(str))
lst.insert(0," ")
count = 0

for i in lst[1:]:
  if lst[i] != lst[-i]:
    count += 1
  else:
    pass
print(count)
Problem p02835 (python)

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

if A + B + C >= 22:
  print("bust")
else:
  print("win")

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

if A + B + C >= 22:
  print("bust")
else:
  print("win")

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

if A + B + C >= 22:
  print("bust")
else:
  print("win")
Problem p02951 (python)

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

if c - (a - b) < 0:
    print(0)
else:
    print(c - (a - b))

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

if c - (a - b) < 0:
    print(0)
else:
    print(c - remain)
Problem p02987 (python)

Fixed submission:
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
if s[0] == s[1] and s[2] == s[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
cmp = s[0]
cnt = 0
for i in range(1, n):
    if s[i] == cmp:
        cnt += 1
    else:
        cnt -= 1
if cnt == 0:
    print('Yes')
else:
    print('No')
Problem p02990 (python)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0:
        return 1
    a = reduce(mul, range(n, n-r, -1))
    b = reduce(mul, range(1, r+1))
    return a//b

n, k = map(int, input().split())
mod = pow(10, 9) + 7

for i in range(k):
    if i > n-k:
        print(0)
    else:
        b = cmb(k-1, i)
        r = cmb(n-k+1, i+1)
        print(int((b*r)%mod))

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    a = reduce(mul, range(n, n - r, -1))
    b = reduce(mul, range(1,r + 1))
    return a//b

n, k = map(int, input().split())
mod = pow(10, 9) + 7

for i in range(k):
    b = cmb(k-1, i)
    r = cmb(n-k+1, i+1)
    print(int((b*r)%(mod)))

Buggy submission (verdict: Runtime Error):
import itertools
import math
from scipy.special import comb

n, k = map(int, input().split())
mod = pow(10, 9)+7

for i in range(k):
    b = comb(k-1, i)
    r = comb(n-k+1, i+1)
    # print(n-k+1, i+1)
    print(int((b*r)%(mod)))
Problem p03038 (python)

Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
a = list(map(int, input().split()))
add = defaultdict(int)
for i in a:
    add[i] += 1
for i in range(m):
    b, c = map(int, input().split())
    add[c] += b

output = 0
cnt = 0
print()
for i, v in sorted(add.items(), reverse=True):
    if cnt+v >= n:
        output += i*(n-cnt)
        break
    else:
        output += i*v
        cnt += v
print(output)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n, m = map(int, input().split())
a = list(map(int, input().split()))
add = defaultdict(int)
for i in range(m):
    b, c = map(int, input().split())
    add[c] += b
add = sorted(add)
for i, v in add.items():
    a += [i]*v
    a.sort(reverse=True)
    if a[n] >= i:
        break
print(sum(a[:n]))
Problem p03286 (python)

Fixed submission:
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):

        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            tmp += "1"
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            if j == 0:
                return tmp + str(m%2)
            else:
                tmp += "0"


if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 60):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 60, "")
    print(result.lstrip("0"))

Buggy submission (verdict: Runtime Error):
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):
        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            tmp += "1"
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            tmp += "0"

if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 30):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 30, "")
    print(result.lstrip("0"))

Buggy submission (verdict: Runtime Error):
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):
        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            print(ranges[j-1], j)
            tmp += "1"
            print(tmp)
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            tmp += "0"

if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 30):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 30, "")
    print(result.lstrip("0"))
Problem p03315 (python)

Fixed submission:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    elif o == '-':
        output -= 1
    else:
        pass
print(output)

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

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

sn = digits(n)
if n % sn == 0:
    print('Yes')
else:
    print('No')

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

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

sn = digits(n)
if n % sn == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    else if o == '-':
        output -= 1
    else:
        pass
print(output)
Problem p02835 (python)

Fixed submission:
a, b, c = map(int, input().split())
sum = a + b + c
if sum>=22:
    print('bust') 
else:
    print('win')

Buggy submission (verdict: Runtime Error):
sum=0
i = 1
while i < 4:
  val = int(input(""))
  sum+=val
  i += 1

if sum>=22:
    print('bust') 
else:
    print('win')

Buggy submission (verdict: Runtime Error):
sum=0
i = 1
while i < 4:
  val = int(input(""))
  sum+=val
  i += 1

if sum>=22:
    print('bust') 
else:
    print('win')
Problem p02951 (python)

Fixed submission:
A = [int(x) for x in input().split()]
a = A[0]
b = A[1]
c = A[2]
zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

a = int(args[1])
b = int(args[2])
c = int(args[3])

zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

a = int(args[1])
b = int(args[2])
c = int(args[3])

zan = 0
if a >= b:
    zan = a - b
res = c - zan
if res <= 0:
    res = 0
print(res)
Problem p03012 (python)

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

for T in range(N-1):
    S1 = 0
    S2 = 0
    for i in range(T+1):
        S1 += l[i]
    for i in range(T+1,N):
        S2 += l[i]
    if T == 0:
        min = abs(S1-S2)
    elif abs(S1-S2) < min:
        min = abs(S1-S2)

print(min)

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

for T in range(N-1):
    S1 = 0
    S2 = 0
    for i in range(T+1):
        S1 += l[i]
    for i in range(T+1,N):
        S2 += l[i]
    if T == 0:
        min = abs(S1-S2)
    else if abs(S1-S2) < min:
        min = abs(S1-S2)

print(min)
Problem p02847 (python)

Fixed submission:
i = str(input())
day = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']

if i == 'SUN':
    print(7)
else:
    print(len(day) - day.index(i) - 1)

Buggy submission (verdict: Runtime Error):
i = str(input())
day = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']

if len(day) - day.index(i) == 0:
    print(7)
  else:
    print(len(day) - day.index(i))
Problem p02835 (python)

Fixed submission:
a=input().split(" ")
sumInput=0
for num in a:
  sumInput=sumInput+int(num)
if sumInput>21:
	print("bust")
else:
  	print("win")

Buggy submission (verdict: Runtime Error):
a=input()
sumInput=0
for num in a:
  sumInput=sumInput+num
print sumInput
Problem p02835 (python)

Fixed submission:
A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())

lst = np.array([int(i) for i in input().split()])

sum = 0
for i in range(N):
    for j in range(i+1, N):
        sum += (lst[i] ^ lst[j]) 

print(int(sum % (1e9+7)))
Problem p02836 (python)

Fixed submission:
import math
kaibun = input()
count = 0
lenstr = len(kaibun)

if lenstr%2 ==0:
  left = kaibun[:int(lenstr/2)]
  right = kaibun[int(lenstr/2):]
else:
  left = kaibun[:math.floor(lenstr/2)]
  right = kaibun[math.floor(lenstr/2):]

for i in range(len(left)):
  back = -1 * i -1
  if left[i] != right[back]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
kaibun = input()
count = 0
lenstr = len(kaibun)

if lenstr%2 ==0:
  left = kaibun[:int(lenstr/2)]
  right = kaibun[int(lenstr/2):]
else:
  left = kaibun[:math.floor(lenstr/2)]
  right = kaibun[math.floor(lenstr/2):]

for i in range(len(left)):
  back = -1 * i -1
  if left[i] != right[back]:
    count+=1
print(count)
Problem p02835 (python)

Fixed submission:
A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
x, y, z = int(input().split())
if (x + y + z >= 22):
  print('bust)
else:
  print('win')
Problem p02847 (python)

Fixed submission:
def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON":
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED":
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI":
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)

Buggy submission (verdict: Runtime Error):
def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON"
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED"
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI"
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)
Problem p02859 (python)

Fixed submission:
def circle(r):
    return r**2
str = int(input())
print(circle(str))

Buggy submission (verdict: Runtime Error):
def circle(r):
  return r**2

str = input()
print(circle(str))

Buggy submission (verdict: Runtime Error):
def circle(r):
  return r**2

str = input()
circle(str)
Problem p02879 (python)

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

if (a > 0 and a <= 9) and (b > 0 and b <=9):
	print(a*b)
else:
	print("-1")

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

if (a > 0 and a <= 9) or (b > 0 and b <=9):
	print("{}".a*b)
 else:
	print("-1")
Problem p02859 (python)

Fixed submission:
r = int(input())
 
print(r*r)

Buggy submission (verdict: Runtime Error):
r = int(input().split())

print(int(r*r))

Buggy submission (verdict: Runtime Error):
r = int(input().split())

print(r**2)
Problem p02989 (python)

Fixed submission:
N = int(input())
D = list(map(int, input().split()))
 
D = sorted(D)
max_ = max(D)
min_ = min(D)

middle_idx = len(D)//2
 
diff = D[middle_idx] - D[middle_idx-1]
print(diff)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = list(map(int, input().split()))
 
D = sorted(D)
max_ = max(D)
min_ = min(D)
 
middle_idx = len(D)//2
print("mi", middle_idx)
diff = D[middle_idx+1] - D[middle_idx]
print(diff)

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

D = sorted(D)
max_ = max(D)
min_ = min(D)

middle_idx = len(D)//2

diff = D[middle_idx+1] - D[middle_idx]
print(diff)
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < min_:
    min_ = j
print(min_)

Buggy submission (verdict: Runtime Error):
P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < max_:
    min_ = j

print(min_)
Problem p03012 (python)

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
 
def calc_sum(W, T):
  S1 = sum(W[:T])
  S2 = sum(W[T:])
  return S1, S2
 
def calc_abs(S1, S2):
  return abs(S1-S2)
  
min_ = 1000
for i in range(len(W)):
  S1, S2 = calc_sum(W, i)
  j = calc_abs(S1, S2)
  if j < min_:
    min_ = j
    
print(min_)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))
 
def calc_sum(W, T):
  S1 = sum(W[:T])
  S2 = sum(W[T:])
  return S1, S2
 
def calc_abs(S1, S2):
  return abs(S1-S2)
  
min_ = 1000
for i in range(len(W)):
  S1, S1 = calc_sum(W, i)
  j = calc_abs(S1, S2)
  if j < min_:
    min_ = j
    
print(min_)

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

def calc_sum(W, T):
  S1 = sum(W[:T])
  S2 = sum(W[T:])
  return S1, S2

def calc_abs(S1, S2):
  return abs(S1-S2)
  
min_ = 1000
for i in range(len(W)):
  S1, S1 = calc_sum(W, i)
  j = calc_abs(S1, S2)
  if j < min_:
    min_ = j
    
print(min_)
Problem p03835 (python)

Fixed submission:
K, S = map(int, input().split())
 
count = 0

for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if (z>=0) and (z<=K):
      count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())

count = 0
for x in K+1:
  for y in K-x:
    z = K - x - y
    if (x>=0) and (y>=0) and (z>=0):
      count += 1
      
print(count)
Problem p02835 (python)

Fixed submission:
a,b,c=(int(x) for x in input().split())

if (a+b+c)>=22:
    print('bust')
else:
    print('win')

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

if (a+b+c>=22:
    print('bust')
else:
    print('win')

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

if (int(A[0])+int(A[2])+int(A[4]))>=22:
    print('bust')
else:
    print('win')

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

if (int(A[0])+int(A[2])+int(A[4]))>=22:
    print('burst')
else:
    print('win')
Problem p02835 (python)

Fixed submission:
a1, a2, a3 = (int(x) for x in input().split(' '))

if a1 + a2 + a3 > 21:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a1 = int(input())
a2 = int(input())
a3 = int(input())

if a1 + a2 + a3 > 21:
  print('bust')
else:
  print('win')
Problem p02835 (python)

Fixed submission:
A=list(map(int,input().split()))
if A[0]+A[1]+A[2]>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
A=list(map(int,input.split()))
if A[0]+A[1]+A[2]>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
A=list(map(int(input.split())))
if A[0]+A[1]+A[2]>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
A=map(int(input.split()))
if A+A+A>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a,b,c=int(input.split())
if a+b+c>=22:
  print("bust")
else:
  print("win")
Problem p02835 (python)

Fixed submission:
n = sum(list(map(int, input().split())))
print('win' if n <= 21 else 'bust')

Buggy submission (verdict: Runtime Error):
n = int(input())
print('win' if n <= 21 else 'bust')
Problem p02836 (python)

Fixed submission:
s=list(input())
n=len(s)
cnt=0
for i in range(n//2):
  if s[i] != s[n-i-1]: cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
s=list(input())
n=len(s)
cnt=0
for i in range(n//2):
  if s[i] != s[n-i]: cnt+=1
print(cnt)
Problem p02836 (python)

Fixed submission:
a = input()
a = list(a)
b = len(a)
c = int(b / 2)
d = []
for i in range(0,c):
    d.append(a[i])
e = a[::-1]
f = []
for g in range(0,c):
    f.append(e[g])
answer = 0
for h in range(0,c):
    if d[h] != f[h]:
        answer += 1
print(answer)

Buggy submission (verdict: Runtime Error):
a = input()
a = list(a)
b = len(a)
c = b / 2
d = []
for i in range(0,c):
    d.append(a[i])
e = a[::-1]
f = []
for g in range(0,c):
    f.append(e[g])
answer = 0
for h in range(0,c):
    if d[h] != f[h]:
        answer += 1
print(answer)

Buggy submission (verdict: Runtime Error):
a = input()
a = list(a)
b = len(a)
c = b / 2
d = []
for i in range(0,c):
    d.append(a[i])
e = a[::-1]
f = []
for g in range(0,c):
    f.append(e[g])
answer = 0
for h in range(0,c):
    if d[h] != f[h]:
        answer += 1
print(answer)
Problem p02835 (python)

Fixed submission:
# coding: utf-8
# Your code here!

a,b, c = map(int, input().split())
if a+b+c>=22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

A=int(input())
B=int(input())
C=int(input())
if A+B+C>=22:
    print("bust")
else:
    print("win")
Problem p02879 (python)

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

if(1 <= A <= 9 and 1 <= B <= 9):
  print(A * B)
else:
  print(-1)

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

a = []
while N % 2 == 0:
  a.append(2)
  N //= 2
f = 3
while f * f <= N:
  if N % f == 0:
    a.append(f)
    N //= f
  else:
    f += 2
if N != 1:
  a.append(N)

A = 1
B = 1
for i in a:
  if(A > B):
    B *= i
  elif(B > A):
    A *= i
  else:
    A *= i
print(A + B - 2)
Problem p02835 (python)

Fixed submission:
A = [int(x) for x in input().split()]
if sum(A) > 21:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
if sum(A) > 21:
    print('bust')
else:
    print('win')
Problem p02847 (python)

Fixed submission:
S = input()
ans = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(ans[S])

Buggy submission (verdict: Runtime Error):
S = input()
ans = {'SUN': 7, 'MON': 6, 'TUE': 5 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(ans[S])

Buggy submission (verdict: Runtime Error):
S = input()
ans = {'SUN': 7, 'MON': 6, 'TUE': 5 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1}
print(ans[S])
Problem p02948 (python)

Fixed submission:
import heapq
import numpy as np

N, M = [int(a) for a in input().split()]

jobs = [[] for _ in range(M)]

for _ in range(N):
    a, b = map(lambda x: int(x), input().split())
    if a > M:
      continue
    jobs[M-a].append(b)

heap = []
ans = 0
for i in range(M-1, -1, -1):
    for b in jobs[i]:
        # 降順にするためにマイナスをつけて入れる
        heapq.heappush(heap, -b)
    if len(heap) != 0:
        # 取り出した値にマイナスをつけて元に戻す
        ans += -heapq.heappop(heap)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = [int(a) for a in input().split()]

A = []
B = []

for _ in range(N):
    a, b = input().split()
    A.append(int(a))
    B.append(int(b))

used_ind = []
sum = 0

for remained_days in range(M+1):
    max_B = 0
    max_ind = -1

    for i in range(N):
        if i in used_ind:
            continue
        if A[i] > remained_days:
            continue
        if B[i] > max_B:
            max_ind = i
            max_B = B[i]
    remained_days -= A[max_ind]
    sum += max_B
    used_ind.append(max_ind)

print(sum)