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

Fixed submission:
s=input()
count=0
count_list=[]
seq=["A","T","G","C"]
for base in s:
    if base in seq:
        count +=1
    else:
        count_list.append(count)
        count = 0
    count_list.append(count)
print(max(count_list))

Buggy submission (verdict: Runtime Error):
s=input()
count=0
count_list=[]
seq=["A","T","G","C"]
for base in ref:
    if base in seq:
        count +=1
    else:
        count_list.append(count)
        count = 0
    count_list.append(count)
print(max(count_list))

Buggy submission (verdict: Runtime Error):
s = input()
list0 = ['A', 'C', 'G', 'T']
list1 = []
frag = 0
for i in s:
  if i in list0:
    frag += 1
  else:
    if frag != 0:
      list1.append(frag)
    frag = 0
list1.appned(0)
print(max(list1))

Buggy submission (verdict: Runtime Error):
s = input()
list0 = ['A', 'C', 'G', 'T']
list1 = []
frag = 0
for i in s:
  if i in list0:
    frag += 1
  else:
    if frag != 0:
      list1.append(frag)
    frag = 0
print(max(list1))
Problem p03061 (python)

Fixed submission:
import fractions


if __name__ == '__main__':
  N = int(input())
  A = list(map(int, input().split()))

  gcdl = [0]
  gcdr = [0]
  for i in range(N):
      gcdl.append(fractions.gcd(gcdl[i], A[i]))
      gcdr.append(fractions.gcd(gcdr[i], A[-(i+1)]))
  gcdr = gcdr[::-1]

  ans = []
  for i in range(N):
      ans.append(fractions.gcd(gcdl[i], gcdr[i+1]))
  print(max(ans))

Buggy submission (verdict: Runtime Error):
import fractions


if __name__ == '__main__':
  N = int(input())
  A = list(map(int, input().split())

  gcd_l = [0]
  gcd_r = [0]
  for i in range(N):
      gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
      gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
  gcd_r = gcd_r[::-1]

  ans = []
  for i in range(N):
      ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))
  print(max(ans))

Buggy submission (verdict: Runtime Error):
import fractions



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

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
    gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))
print(max(ans))

Buggy submission (verdict: Runtime Error):
import fractions


if __name__ == "__main__":
	N = int(input())
	A = list(map(int, input().split())

    gcd_l = [0]
    gcd_r = [0]
    for i in range(N):
        gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
        gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    gcd_r = gcd_r[::-1]

    ans = []
    for i in range(N):
        ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

	print(max(ans))

Buggy submission (verdict: Runtime Error):
import fractions


if __name__ == "__main__":
	N = int(input())
	A = list(map(int, input().split())

    gcd_l = [0]
    gcd_r = [0]
    for i in range(N):
        gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
        gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    gcd_r = gcd_r[::-1]

    ans = []
    for i in range(N):
        ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))
Problem p03359 (python)

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

takahashi = a - 1
if b >= a :
    takahashi = takahashi + 1

print('{}'.format(takahashi))

Buggy submission (verdict: Runtime Error):
a = list(int(i) for i in input().split())
k = int(input())

maximum_sum = a[0] + a[1] + a[2] + max(a)*((2**k)-1)
print('{}'.format(maximum_sum))
Problem p03071 (python)

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

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B - 1)
  else:
    ans = A + B
  return ans


print(MaxCoinCount(A,B))

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

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B


MaxCoinCount(a, b)

Buggy submission (verdict: Runtime Error):
def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B

MaxCoinCount(A, B)

Buggy submission (verdict: Runtime Error):
def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
    A = A - 1
  else if A < B:
    ans = B + (B + 1)
  else:
    ans = A + B
Problem p03079 (python)

Fixed submission:
A, B, C = map(int, raw_input().split())
if A == B and B == C:
  print 'Yes'
else:
  print 'No'

Buggy submission (verdict: Runtime Error):
def is_left_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i < 0:
      return True
    if i >= N:
      return False
  return False
def is_right_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i >= N:
      return True
    if i < 0:
      return False
  return False

N, Q = map(int, raw_input().split())
s = raw_input()
td = [raw_input().split() for _ in range(Q)]

# left
l = 0
r = N - 1
l_res = -1
while (l <= r):
  target = (r + l) / 2
  if is_left_removed(target, s, td):
    l = target + 1
    l_res = target
  else:
    r = target - 1

# right
l = 0
r = N - 1
r_res = N
while (l <= r):
  target = (r + l) / 2
  if is_right_removed(target, s, td):
    r = target - 1
    r_res = target
  else:
    l = target + 1

print N - min(N, l_res + 1 + N - r_res)
Problem p03081 (python)

Fixed submission:
def is_left_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i < 0:
      return True
    if i >= N:
      return False
  return False
def is_right_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i >= N:
      return True
    if i < 0:
      return False
  return False

N, Q = map(int, raw_input().split())
s = raw_input()
td = [raw_input().split() for _ in range(Q)]

# left
l = 0
r = N - 1
l_res = -1
while (l <= r):
  target = (r + l) / 2
  if is_left_removed(target, s, td):
    l = target + 1
    l_res = target
  else:
    r = target - 1

# right
l = 0
r = N - 1
r_res = N
while (l <= r):
  target = (r + l) / 2
  if is_right_removed(target, s, td):
    r = target - 1
    r_res = target
  else:
    l = target + 1

print N - min(N, l_res + 1 + N - r_res)

Buggy submission (verdict: Runtime Error):
def is_left_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i < 0:
      return True
  return False
def is_right_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i >= N:
      return True
  return False

N, Q = map(int, raw_input().split())
s = raw_input()
td = [raw_input().split() for _ in range(Q)]

# left
l = 0
r = N - 1
l_res = -1
while (l <= r):
  target = (r + l) / 2
  if is_left_removed(target, s, td):
    l = target + 1
    l_res = target
  else:
    r = target - 1

# right
l = 0
r = N - 1
r_res = N
while (l <= r):
  target = (r + l) / 2
  if is_right_removed(target, s, td):
    r = target - 1
    r_res = target
  else:
    l = target + 1

print N - min(N, l_res + 1 + N - r_res)
Problem p03192 (python)

Fixed submission:
N = raw_input()
print len([i for i in N if i == '2'])

Buggy submission (verdict: Runtime Error):
N, P = map(int, raw_input().split())
if N == 1:
    print P
else:
    res = 2
    for i in range(2, int(N ** (1/2.)) + 1):
        if i ** N > P:
            break
        if P % (i ** N) == 0:
            res = i
    print res

Buggy submission (verdict: Runtime Error):
N, P = map(int, raw_input().split())
i = 2
res = 1
if N == 1:
    print P
else:
    while i ** N <= P:
        if P % (i ** N) == 0:
            res = i
        i += 1
    print res

Buggy submission (verdict: Runtime Error):
N, P = map(int, raw_input().split())
i = 2
res = 1
while i ** N <= P and N > 1:
    if P % (i ** N) == 0:
        res = i
    i += 1
print res
Problem p03227 (python)

Fixed submission:
S = raw_input()

if len(S) == 2:
	print S
elif len(S) == 3:
	print "".join([i for i in reversed(S)])

Buggy submission (verdict: Runtime Error):
N = input()
A = [int(input()) for i in range(N)]

res = []
begin = 0
end = len(A) - 1
res =[]
res.append(A[begin])
res.append(A[end])
begin += 1
end -= 1

Buggy submission (verdict: Runtime Error):
from collections import deque
N = input()
A = [int(input()) for i in range(N)]

res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin += 1
end -= 1
Problem p03229 (python)

Fixed submission:
from collections import deque
N = input()
A = [int(input()) for i in range(N)]
coef = [2] * N
coef[0] = 1
coef[-1] = 1
coef1 = [coef[i] if i % 2 == 0 else coef[i] * -1 for i in range(N)]
coef2 = [coef[i] if i % 2 != 0 else coef[i] * -1 for i in range(N)]

A = sorted(A)
coef1 = sorted(coef1)
coef2 = sorted(coef2)
res1 = 0
for i in range(N):
	res1 += A[i] * coef1[i]
res2 = 0
for i in range(N):
	res2 += A[i] * coef2[i]
print max(res1, res2)

Buggy submission (verdict: Runtime Error):
from collections import deque
N = input()
A = []


res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin += 1
end -= 1

Buggy submission (verdict: Runtime Error):
from collections import deque
N = input()
A = []
for i in range(N):
	a = input()
	A.append(a)

A = sorted(A)
res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin+= 1
end -= 1
for i in range(N - 2):
	l = [abs(res[0] - A[begin]), abs(res[0] - A[end]), abs(res[-1] - A[begin]), abs(res[-1] - A[end])]
	cand = l.list(max(l))
	if cand == 0:
		res.appendleft(A[begin])
		begin += 1
	elif cand == 1:
		res.appendleft(A[end])
		end -= 1
	elif cand == 2:
		res.append(A[begin])
		begin += 1
	elif cand == 3:
		res.append(A[end])
		end -= 1
sum_diff = 0
for i in range(N - 1):
	 sum_diff += abs(res[i] - res[i + 1])
print sum_diff

Buggy submission (verdict: Runtime Error):
import numpy as np
N = input()
A = []
for i in range(N):
	a = input()
	A.append(a)

A = sorted(A)
res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin+= 1
end -= 1
for i in range(N - 2):
	cand = np.argmax([abs(res[0] - A[begin]), abs(res[0] - A[end]), abs(res[-1] - A[begin]), abs(res[-1] - A[end])])
	if cand == 0:
		res.appendleft(A[begin])
		begin += 1
	elif cand == 1:
		res.appendleft(A[end])
		end -= 1
	elif cand == 2:
		res.append(A[begin])
		begin += 1
	elif cand == 3:
		res.append(A[end])
		end -= 1
sum_diff = 0
for i in range(N - 1):
	 sum_diff += abs(res[i] - res[i + 1])
print sum_diff

Buggy submission (verdict: Runtime Error):
import numpy as np
from collections import deque
N = input()
A = []
for i in range(N):
	a = input()
	A.append(a)

A = sorted(A)
res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin+= 1
end -= 1
for i in range(N - 2):
	cand = np.argmax([abs(res[0] - A[begin]), abs(res[0] - A[end]), abs(res[-1] - A[begin]), abs(res[-1] - A[end])])
	if cand == 0:
		res.appendleft(A[begin])
		begin += 1
	elif cand == 1:
		res.appendleft(A[end])
		end -= 1
	elif cand == 2:
		res.append(A[begin])
		begin += 1
	elif cand == 3:
		res.append(A[end])
		end -= 1
sum_diff = 0
for i in range(N - 1):
	 sum_diff += abs(res[i] - res[i + 1])
print sum_diff
Problem p03231 (python)

Fixed submission:
def GCD(a, b):
	if b > a:
		tmp = a
		a = b
		b = tmp
	if a % b == 0:
		return b
	return GCD(b, a % b)

def LCM(a, b):
	return a * b / GCD(a, b)

def judge():
	N, M = map(int, raw_input().split())
	S = raw_input()
	T =raw_input()
	L = LCM(N, M)
	S_pos = [0] * N
	T_pos = [0] * M
	for i in range(N):
		S_pos[i] = i * L/N
	for i in range(M):
		T_pos[i] = i * L/M
	i = 0
	j = 0
	while i < N and j < M:
		if S_pos[i] == T_pos[j]:
			if S[i] != T[j]:
				return -1
			i += 1
			j += 1
		elif S_pos[i] < T_pos[j]:
			i += 1
		else:
			j += 1
	return L

print judge()

Buggy submission (verdict: Runtime Error):
def GCD(a, b):
	if b > a:
		tmp = a
		a = b
		b = tmp
	if a % b == 0:
		return b
	return GCD(b, a % b)

def LCM(a, b):
	return a * b / GCD(a, b)

def judge():
	N, M = map(int, raw_input().split())
	S = raw_input()
	T =raw_input()
	L = LCM(N, M)
	good_str = ["*"] * L
	for i in range(N):
		idx = i * L/N
		good_str[idx] = S[i]
	for i in range(M):
		idx = i * L/M
		if good_str[idx] == "*" or good_str[idx] == T[i]:
			pass
		else:
			return -1
	return L

print judge()
Problem p03241 (python)

Fixed submission:
import math
N, M = map(int, raw_input().split())

MAX_RES = int(math.sqrt(M))
res = 1
for i in range(1, MAX_RES + 1):
	if i * i > M:
		break
	if M % i != 0:
		continue
	j = M / i
	if i * N <= M:
		res = max(res, i)
	if j * N <= M:
		res = max(res, j)
print res

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

res = 1
for i in range(1, M + 1):
	if i * i > M:
		break
	if M % i != 0:
		continue
	j = M / i
	if long(i) * N <= M:
		res = max(res, i)
	if long(j) * N <= M:
		res = max(res, j)
print res

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

res = 1
for i in range(1, N + 1):
	if i > M * M:
		break
	iif M % i != 0:
		continue
	j = M / i
	if i * N <= M:
		res = max(res, i)
	if j * N <= M:
		res = max(res, j)
print res

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

res = 0
for i in range(1, N + 1):
	if i > M * M:
		break
	iif M % i != 0:
		continue
	j = M / i
	if i * N <= M:
		res = max(res, i)
	if j * N <= M:
		res = max(res, j)
print res
Problem p03292 (python)

Fixed submission:
A = map(int, raw_input().split())
A.sort()
print(A[2] - A[1] + A[1] - A[0])

Buggy submission (verdict: Runtime Error):
import sys

A = map(int, sys.argv[1::])
A.sort()
print(A[2] - A[1] + A[1] - A[0])
Problem p03351 (python)

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

if abs(a - b) <= d and abs(b - c) <= d or abs(a - c) <= d:
	print 'Yes'
else:
	print 'No'

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

if abs(a - b) < d and abs(b - c) < d or abs(a - c) < d:
Problem p03369 (python)

Fixed submission:
S = raw_input()
res = 700
for i in range(3):
	if S[i] == 'o':
		res += 100
print res

Buggy submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
if a <= b:
	print a
else:
	print a - 1
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, raw_input().split())
if B - A + 1 > 2 * K:
	for i in range(A, A + K):
		print i
	for i in range(B - K + 1, B + 1):
		print i
else:
	for i in range(A, B + 1):
		print i

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, raw_input().split())
AB = range(A, B + 1)
if B - A + 1 > 2 * K:
	for i in AB[:K]:
		print i
	for i in AB[-K:]:
		print i
else:
	for i in AB:
		print i

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, raw_input().split())
AB = range(A, B + 1)
if len(AB) > 2 * K:
	for i in AB[:K]:
		print i
	for i in AB[-K:]:
		print i
else:
	for i in AB:
		print i

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, raw_input().split())
AB = range(A, B + 1)
if len(AB) > 2 * K:
	for i in AB[:K]:
		print i
for i in AB[-K:]:
	print i

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, raw_input().split())
AB = range(A, B + 1)
for i in AB[:K]:
	print i
for i in AB[-K:]:
	print i
Problem p03399 (python)

Fixed submission:
A = input()
B = input()
C = input()
D = input()
print min(A, B) + min(C, D)

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, raw_input().split())
print min(A, C) + min(B, D)
Problem p03423 (python)

Fixed submission:
N = input()
MIN_GNUM = 3
print N / MIN_GNUM

Buggy submission (verdict: Runtime Error):
N = raw_input()
MIN_GNUM = 3
print N / MIN_GNUM
Problem p03433 (python)

Fixed submission:
N = input()
A = input()

rest = N % 500
if rest <= A:
	print "Yes"
else:
	print "No"

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

rest = N % A
if rest <= A:
	print "Yes"
else:
	print "No"
Problem p03455 (python)

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

if a * b % 2 == 0:
	print "Even"
else:
	print "Odd"

Buggy submission (verdict: Runtime Error):
if a * b % 2 == 0:
	print "Even"
else:
	print "Odd"
Problem p03469 (python)

Fixed submission:
S = raw_input()
MISSED_IDX = 3
res = list(S)
res[MISSED_IDX] = '8'

print "".join(res)

Buggy submission (verdict: Runtime Error):
S = raw_input()
MISSED_IDX = 3
S[MISSED_IDX] = 8

print S
Problem p03471 (python)

Fixed submission:
import sys
N, Y = map(int, raw_input().split())
for i in range(N + 1):
    for j in range(N + 1 - i):
        k = N - i - j
        if i * 10000 + j * 5000 + k * 1000 == Y:
            print i, j, k
            sys.exit()
print "-1 -1 -1"

Buggy submission (verdict: Runtime Error):
import sys<
N, Y = map(int, raw_input().split())<
for i in range(N + 1):<
    for j in range(N + 1 - i):<
        k = N - i - j<
        if i * 10000 + j * 5000 + k * 1000 == Y:
            print i, j, k<
            sys.exit()<
print "-1 -1 -1"<
Problem p03574 (python)

Fixed submission:
import sys
H, W = map(int, raw_input().split())
S = [raw_input() for i in range(H)]
C = [[0] * W for i in range(H)]
for i in range(H):
    for j in range(W):
        for di in range(-1, 2):
            if i + di < 0 or H <= i + di:
                continue
            for dj in range(-1, 2):
                if j + dj < 0 or W <= j + dj:
                    continue
                C[i][j] += 1 if S[i + di][j + dj] == "#" else 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            sys.stdout.write("#")
        else:
            sys.stdout.write(str(C[i][j]))
    print ""

Buggy submission (verdict: Runtime Error):
H, W = map(int, raw_input().split())
S = [raw_input() for i in range(H)]
C = [[0] * W for i in range(H)]
for i in range(H):
    for j in range(W):
        for di in range(-1, 1):
            if i + di < 0 or H <= i + di:
                continue
            for dj in range(-1, 1):
                if j + dj < 0 or W <= j + dj:
                    continue
                C[i][j] += 1 if S[i][j] == "#" else -1
for i in range(H):
    print "".join(C[i])
Problem p03624 (python)

Fixed submission:
def not_found_minchar(S):
    for o in range(ord('a'), ord('z') + 1):
        if chr(o) not in S:
            return chr(o)
    return "None"

S = raw_input()
print not_found_minchar(S)

Buggy submission (verdict: Runtime Error):
def not_found_minchar(S):
    sorted_S = sorted(set(S))
    idx = 0
    for o in range(ord('a'), ord('z') + 1):
        if o < ord(sorted_S[idx]):
            return chr(o)
        idx += 1
    return "None"

S = raw_input()
print not_found_minchar(S)

Buggy submission (verdict: Runtime Error):
def not_found_minchar(S):
    sorted_S = sorted(list(set(S)))
    idx = 0
    for o in range(ord('a'), ord('z') + 1):
        if o < ord(sorted_S[idx]):
            return chr(o)
        idx += 1
    return "None"

S = raw_input()
print not_found_minchar(S)
Problem p03679 (python)

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

print "delicious" if A - B >= 0 else "safe" if X >= B - A else "dangerous"

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

print "delicisous" if A - B >= 0  "safe" if X >= B - A else "dangerous"
Problem p03773 (python)

Fixed submission:
A, B = map(int, raw_input().split())
print (A + B) % 24

Buggy submission (verdict: Runtime Error):
A, B = map(int, raw_input().split()
print (A + B) % 24

Buggy submission (verdict: Runtime Error):
A, B = map(int, raw_input().split()
print (A + B) % 23
Problem p03795 (python)

Fixed submission:
N = input()
print 800 * N - 200 * (N // 15)

Buggy submission (verdict: Runtime Error):
N = input()
print 800 * N 200 * (N // 15)
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, raw_input().split())
print "Yes" if (a + b + c) % 2 == 0 and (a + b + c) // 2 in [a, b, c] else "No"

Buggy submission (verdict: Runtime Error):
print "Yes" if (a + b + c) % 2 == 0 else "No"
Problem p03043 (python)

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

def l2c(x):
	c = 1 / n
	while x < k:
		x = x * 2
		c = c / 2
	return c

print(sum([l2c(i) for i in range(1, n+1)]))

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

def l2c(x):
	c = 1 / n
    while x < k:
		x = x * 2
        c = c / 2
    return c
  
print(sum([l2c(i) for i in range(1, n+1)])
Problem p04029 (python)

Fixed submission:
n = int(input())
total = n
for i in range(n):
    total += i

print(total)

Buggy submission (verdict: Runtime Error):
n = int(input())
total = for i in range(n):
    total += i

print(total)
Problem p03109 (python)

Fixed submission:
s = input()
print("Heisei") if s[5:7] == "01" or s[5:7] == "02" or s[5:7] == "03" or s[5:7] == "04"  else print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
print("Heisei") if s[5:7] =< 4 else print("TBD")
Problem p03136 (python)

Fixed submission:
N = int(input())
number_list = []
for i in map(int, input().split()):
    number_list += [i]

for i in range(N-1):
    for j in range(N):
        if i < j:
            if number_list[i] > number_list[j]:
                a = number_list[i]
                number_list[i] = number_list[j]
                number_list[j] = a

sum = 0
for i in range(N-1):
    sum+=number_list[i]

if sum > number_list[N-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
number_list = []
for i in map(int, input().split()):
    number_list += [i]

for i in range(N-1):
    for j in range(N):
        if i < j:
            if number_list[i] > number_list[j]:
                a = number_list[i]
                number_list[i] = number_list[j]
                number_list[j] = a

sum = 0
for i in range(N-1):
    sum+=number_list[i]

if sum > number_list[N]:
    print("Yes")
else:
    print("No")
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,inpu().split())
print(a*b/2)
Problem p03316 (python)

Fixed submission:
n=input()
a=0
for i in n:
  a+=int(i)
print("Yes") if int(n)%a==0 else print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in n:
  a+=int(n[i])
print("Yes") if int(n)%a==0 else print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in n:
  a+=int(n[i])
print("Yes") if int(n)//a else print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in n:
  a+=int(n[i])
print("Yes") if int(n)//a else prit("No")
Problem p03408 (python)

Fixed submission:
n=int(input())
blue=[]
for i in range(n):
    blue.append(input())
m=int(input())
red=[]
for i in range(m):
    red.append(input())
max=0
for i in blue:
    b=blue.count(i)
    r=red.count(i)
    if b-r>max:max=b-r
print(max)

Buggy submission (verdict: Runtime Error):
n=int(input())
blue=[]
for i in range(n):
    blue.append(input())
m=int(input())
red=[]
for i in range(m):
    red.append(input())
max=0
for i in blue:
    b=blue.count(i)
    r=red.count(i)
    max=max(b-r,max)
print(max)
Problem p03502 (python)

Fixed submission:
N=input()
a=0
for i in N:
  a+=int(i)
print("Yes") if int(N)%a==0 else print("No")

Buggy submission (verdict: Runtime Error):
N=input()
a=0
for i in N:
  a+=int(i)
print("Yes") if N%a==0 else print("No")