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

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

combi = [A, B, C]
set_abc = set(combi)

len_set_abc = len(set_abc)
max_set = max(set_abc)
min_set = min(set_abc)
if len_set_abc == 1:
    print(0)
elif len_set_abc == 2:
    max_freq = combi.count(max_set)
    diff = max_set - min_set
    if max_freq == 2 and diff % 2:
        print((diff + 1) // 2 + 1)
    elif max_freq == 2:
        print(diff // 2)
    else:
        print(diff)
else:
    other = [c for c in combi if c != max_set]
    max_other = max(other)
    min_other = min(other)
    
    n_operation = max_set - max_other
    max_other += n_operation
    min_other += n_operation

    diff = max_set - min_other
    if diff % 2 and diff == 1:
        n_add = (max_set - min_other) // 2 + 2
    elif diff % 2:
        n_add = (max_set - min_other) // 2 + 2
    else:
        n_add = (max_set - min_other) // 2
    n_operation += n_add

    print(n_operation)

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

combi = [A, B, C]
max_ABC = max([A, B, C])
other = [c for c in combi if c != max_ABC]
max_other = max(other)
min_other = min(other)

# Operation (1st method)
n_operation = max_ABC - max_other
max_other += n_operation
min_other += n_operation

if max_other == min_other:
    print(n_operation)
    exit()

# Operation (2nd method)
if (max_ABC - min_other) % 2:
    n_add = (max_ABC - min_other) // 2 + 1
else:
    n_add = (max_ABC - min_other) // 2
n_operation += n_add

print(n_operation)

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

combi = [A, B, C]
max_ABC = max([A, B, C])
other = [c for c in combi if c != max_ABC]
max_other = max(other)
min_other = min(other)

# Operation (1st method)
n_operation = max_ABC - max_other
max_other += n_operation
min_other += n_operation

# print(max_ABC, max_other, min_other, 'n_op:', n_operation)

# Operation (2nd method)
diff = max_ABC - min_other
if diff % 2 and diff == 1:
    n_add = (max_ABC - min_other) // 2 + 2
elif diff % 2:
    n_add = (max_ABC - min_other) // 2 + 1
else:
    n_add = (max_ABC - min_other) // 2
n_operation += n_add

print(n_operation)
Problem p03417 (python)

Fixed submission:
# WIP
N, M = map(int, input().split())

if N == 1 and M == 1:
    print(1)
elif N == 1:
    print(M - 2 if M > 2 else 0)
elif M == 1:
    print(N - 2 if N > 2 else 0)
elif N > 2 and M > 2:
    print((N - 2) * (M - 2))
else:
    print(0)

"""
# An experiment
n_count_map = [[0 for _ in range(M)] for _ in range(N)]


def update(x, y):
    # Count
    n_count_map[y][x] += 1
    if y + 1 < N:
        n_count_map[y + 1][x] += 1
    if y - 1 >= 0:
        n_count_map[y - 1][x] += 1
    if x + 1 < M:
        n_count_map[y][x + 1] += 1
    if x - 1 >= 0:
        n_count_map[y][x - 1] += 1
    if y + 1 < N and x + 1 < M:
        n_count_map[y + 1][x + 1] += 1
    if y - 1 >= 0 and x - 1 >= 0:
        n_count_map[y - 1][x - 1] += 1
    if y + 1 < N and x - 1 >= 0:
        n_count_map[y + 1][x - 1] += 1
    if y - 1 >= 0 and x + 1 < M:
        n_count_map[y - 1][x + 1] += 1


for n in range(N):
    for m in range(M):
        update(m, n)

print(n_count_map)
"""

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

if N == 1:
    print(max(M - 2, 0)))
elif M == 1:
    print(max(M - 2, 0)))
elif N == 1 and M == 1:
    print(1)
else:
    # Number of cards appearing "back"
    # = (N-2)*(M-2)
    print(max((N - 2) * (M - 2), 0))

"""
# An experiment
n_count_map = [[0 for _ in range(M)] for _ in range(N)]


def update(x, y):
    # Count
    n_count_map[y][x] += 1
    if y + 1 < N:
        n_count_map[y + 1][x] += 1
    if y - 1 >= 0:
        n_count_map[y - 1][x] += 1
    if x + 1 < M:
        n_count_map[y][x + 1] += 1
    if x - 1 >= 0:
        n_count_map[y][x - 1] += 1
    if y + 1 < N and x + 1 < M:
        n_count_map[y + 1][x + 1] += 1
    if y - 1 >= 0 and x - 1 >= 0:
        n_count_map[y - 1][x - 1] += 1
    if y + 1 < N and x - 1 >= 0:
        n_count_map[y + 1][x - 1] += 1
    if y - 1 >= 0 and x + 1 < M:
        n_count_map[y - 1][x + 1] += 1


for n in range(N):
    for m in range(M):
        update(m, n)

print(n_count_map)
"""
Problem p03448 (python)

Fixed submission:
# 初見分からず
# 考え方：個数の組み合わせを総当たりで全パターン試せばよい！
a, b, c, x = map(int, [input() for val in range(4)])

n_pattern = 0
for i in range(a+1):#0~a+1
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                n_pattern += 1

print(n_pattern)

Buggy submission (verdict: Runtime Error):
# 初見分からず
# 考え方：個数の組み合わせを総当たりで全パターン試せばよい！
a, b, c, x = map(int, [val for val in input()])

n_pattern = 0
for i in range(a+1):#0~a+1
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == 1:
                n_pattern += 1

print(n_pattern)
Problem p03471 (python)

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

for i in range(n + 1):
    for j in range(n + 1 - i):
            if  10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, n - i - j)
                exit()
                    
print(-1, -1, -1)

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

for i in range(n + 1):
    for j in range(n + 1 - i):
            if  10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, n - i - j)
                exit()
                    
print(-1, -1, -1)
Problem p03486 (python)

Fixed submission:
s = sorted(input())
t = sorted(input(), reverse=True)
len_s = len(s)
len_t = len(t)
n_passed = 0

min_len = min(len_s, len_t)
for i in range(min_len):
    if s[i] < t[i]:
        print("Yes")
        exit()

if len_s < len_t:
    t = sorted(t)
    for i in range(len_s):
        if s[i] == t[i]:
            n_passed += 1
    if n_passed == len_s:
        print("Yes")
        exit()
        
print("No")

Buggy submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input(), reverse=True)
len_s = len(s)
len_t = len(t)
n_passed = 0

for i in range(len_s):
    if s[i] < t[i]:
        print("Yes")
        exit()

t = sorted(t)
if len_s < len_t:
    for i in range(len_s):
        if s[i] == t[i]:
            n_passed += 1
    if n_passed == len_s:
        print("Yes")
        exit()
print("No")
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
n_operation = 0
for i in range(n):
    even_len = len([a for a in a_list if a % 2 == 0])
    if len(a_list) != even_len:
        print(n_operation)
        exit()
    else:
        a_list = [a / 2 for a in a_list]
        n_operation += 1

print(n_operation)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

n_division = 0
while odd_detector(a_list) == 0:
    a_list = [a / 2 for a in a_list]
    n_division += 1

print(n_division)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [int(a/2) for a in a_list]
    n_division += 1

print(n_division)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [int(a/2) for a in a_list]
    n_division += 1

print(n_division)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [a/2 for a in a_list]
    n_division += 1

print(n_division)

Buggy submission (verdict: Runtime Error):
# 初見不正解：RE (Runtime Error)
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0
is_odd = 0

def odd_detector(a_list):
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [a/2 for a in a_list]
    n_division += 1

print(n_division)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0
is_odd = 0

def odd_detector(a_list):
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    alist = [a/2 for a in a_list]
    n_division += 1
    
print(n_division)
Problem p03544 (python)

Fixed submission:
def get_new_lucas(l_i_1, l_i_2):
    """
    get a new Lucas number L_i

    l_i_1: L_(i-1),
    l_i_2: L_(i-2)
    """
    return l_i_1 + l_i_2


def main():
    n = int(input())
    tmp_l_i_1 = 1
    tmp_l_i_2 = 2
    for i in range(n):
        if i == 0:
            new_lucas_num = 1
        if i >= 1:
            new_lucas_num = get_new_lucas(tmp_l_i_1, tmp_l_i_2)
            tmp_l_i_2 = tmp_l_i_1
            tmp_l_i_1 = new_lucas_num
        
    print(new_lucas_num)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def get_new_lucas(l_i_1, l_i_2):
    """
    get a new Lucas number L_i

    l_i_1: L_(i-1),
    l_i_2: L_(i-2)
    """
    return l_i_1 + l_i_2


def main():
    n = int(input())
    tmp_l_i_1 = 1
    tmp_l_i_2 = 2
    for i in range(1, n):
        if i == 1:
            new_lucas_num = get_new_lucas(tmp_l_i_1, tmp_l_i_2)
        else:
            new_lucas_num = get_new_lucas(tmp_l_i_1, tmp_l_i_2)
        tmp_l_i_2 = tmp_l_i_1
        tmp_l_i_1 = new_lucas_num
        
    print(new_lucas_num)


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

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

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
for i in range(N + 1):
    for j in range(N - i + 1):
        if i * 10000 + j * 5000 + (N - i - j) * 1000 == y:
            print(i, j, N - i - j)
            exit()
print("-1 -1 -1")
Problem p02801 (python)

Fixed submission:
s=input()

li = [chr(i) for i in range(97, 97+26)]
ans = 0

for index, i in enumerate(li):
  if i == s:
    ans = index

print(li[ans + 1])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
li = []
for m in range(M):
  li.append(input().split())

ac = 0
wa = 0

for n in range(N + 1):
  if n == 0:
    continue

  for index, i in enumerate(li):
    if int(i[0]) == n and i[1] == 'AC':
      ac += 1
      for indexs, x in enumerate(li):
        if indexs >= index:
          break
        if int(x[0]) == n and x[1] == 'WA':
          wa += 1
      break

print('{0} {1}'.format(ac, wa))
Problem p03001 (python)

Fixed submission:
import sys
W,H,x,y = map(int, input().split())

ans = W * H / 2

if W / 2 == x and H / 2 == y:
  print("{} {}".format(ans, 1))
else:
  print("{} {}".format(ans, 0))

Buggy submission (verdict: Runtime Error):
ans = 0
way = 0

if x == 0 and y == 0:
  ans = 0
  way = 0
elif x == 0:
  if H == y:
    ans = 0
    way = 0
  elif H - y > y:
    ans = W * y
    way = 0
  elif H - y < y:
    ans = W * (H-y)
    way = 0
  elif H - y == y:
    ans = W * (H-y)
    way = 0
elif y == 0:
  if W == x:
    ans = 0
    way = 0
  elif W - x > x:
    ans = x * H
    way = 0
  elif W - x < x:
    ans = (W-x) * H
    way = 0
  elif W - x == x:
    ans = (W-x) * H
    way = 0
elif x != 0 and y != 0:
  mi = 0

  s = (W-x) * H
  t = x * H

  if s > t:
    mi = t
  else:
    mi = s

  si = 0
  s = W * (H-y)
  t = W * y

  if s > t:
    si = t
  else:
    si = s

  if mi > si:
    ans = mi
    way = 0
  elif mi < si:
    ans = si
    way = 0
  elif mi == si:
    ans = mi
    way = 1

print("{} {}".format(ans, way))
Problem p03163 (python)

Fixed submission:
def chmin(a, b):
  if (a > b):
    return b

  return a

def chmax(a, b):
  if (a < b):
    return b

  return a

N,W = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]

dp = [[0] * (10**5+10) for i in [0] * (N+1)]

for n in range(N):
  for w in range(1, W+1):
    if (w - li[n][0] >= 0):
      dp[n+1][w] = chmax(dp[n+1][w], dp[n][w - li[n][0]] + li[n][1])

    dp[n+1][w] = chmax(dp[n+1][w], dp[n][w])


print(max(max(dp)))

Buggy submission (verdict: Runtime Error):
def chmin(a, b):
  if (a > b):
    return b

  return a

def chmax(a, b):
  if (a < b):
    return b

  return a

N,W = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]

dp = [[0] * 10**5 for i in [0] * (N+1)]

for n in range(N):
  for w in range(1, W+1):
    if (w - li[n][0] >= 0):
      dp[n+1][w] = chmax(dp[n+1][w], dp[n][w - li[n][0]] + li[n][1])

    dp[n+1][w] = chmax(dp[n+1][w], dp[n][w])


print(max(max(dp)))
Problem p03240 (python)

Fixed submission:
N = int(input())
li = [list(map(int, input().split())) for i in range(N)]

s = 0

for index, i in enumerate(li):
  if i[2] > 0:
    s = index
    break
  
for x in range(101):
  for y in range(101):
    h = li[s][2] + abs(x - li[s][0]) + abs(y - li[s][1])
    ok = True

    for i in li:
      if i[2] > 0 and h != i[2] + abs(x - i[0]) + abs(y - i[1]):
        ok = False
      if i[2] == 0 and h > i[2] + abs(x - i[0]) + abs(y - i[1]):
        ok = False

    if ok:
      ans = [x, y, h]

print("{} {} {}".format(ans[0], ans[1], ans[2]))

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

for x in range(101):
  for y in range(101):
    h = li[0][2] + abs(x - li[0][0]) + abs(y - li[0][1])
    ok = True

    for i in li:
      if h != i[2] + abs(x - i[0]) + abs(y - i[1]):
        ok = False

    if ok:
      ans = [x, y, h]

print("{} {} {}".format(ans[0], ans[1], ans[2]))

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

for x in range(101):
  for y in range(101):
    h = li[0][2] + abs(x - li[0][0]) + abs(y - li[0][1])
    ok = True

    for i in li:
      if h != i[2] + abs(x - i[0]) + abs(y - i[1]):
        ok = False

    if ok:
      ans = [x, y, h]

print("{} {} {}".format(ans[0], ans[1], ans[2]))
Problem p03353 (python)

Fixed submission:
s = input()
K = int(input())

ans = []

for index, i in enumerate(s):
  ans.append(i)

  count = 1
  now = i
  for indexs, k in enumerate(s):
    if indexs <= index:
      continue
      
    if count >= 5:
      break

    now += k
    ans.append(now)
    count += 1

ans = list(set(ans))
ans.sort()
print(ans[K-1])

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

ans = []
now = ""

for index, i in enumerate(s):
  now = i
  ans.append(i)

  for indexs, k in enumerate(s):
    if indexs <= index:
      continue

    if s[indexs] == now[-1]:
      break

    now += k
    ans.append(now)
    
ans = list(set(ans))
ans.sort()

print(ans[K-1])

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

ans = []
now = ""

for index, i in enumerate(s):
  now = i
  ans.append(i)

  for indexs, k in enumerate(s):
    if indexs <= index:
      continue

    if s[indexs] == now[-1]:
      break

    now += k
    ans.append(now)
    
ans = list(set(ans))
ans.sort()

print(ans[K-1])
Problem p03373 (python)

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

ans = 100000000000000000000000000

AB = C * 2

for ab in range(100000 + 1):
  x = 0
  if X - ab > 0:
    x = X - ab
  
  y = 0
  if Y - ab > 0:
    y = Y - ab
  
  d = (x * A) + (y * B) + (AB * ab)

  if ans > d:
    ans = d

print(ans)

Buggy submission (verdict: Runtime Error):
import math

A, B, C, X, Y = map(int,input().split())

ans = 100000000000000000000000000

for x in range(X):
  ab = (X - x) * 2
  
  if Y > (ab / 2):
    continue

  y = Y - (ab / 2)

  a = (A * x) + (B * y) + (C * ab)

  if ans > a:
    ans = a

print(math.floor(a))
Problem p03379 (python)

Fixed submission:
n = int(input())
s = list(map(int, input().split()))
sx = sorted(s)
a = sx[(n//2)-1]
b = sx[n//2]
for i in s:
  if i <= a:
    print(b)
  else:
    print(a)

Buggy submission (verdict: Runtime Error):
import math

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

m = sum(li) / N

new = sorted(li)

for i in range(N):
  if i <= (N / 2) - 1
    print(new[math.floor(N/2)])
  else:
    print(new[math.floor(N/2) - 1])

Buggy submission (verdict: Runtime Error):
import math

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

m = sum(li) / N

new = sorted(li)

for i in range(N):
  if i <= (N / 2) - 1
    print(new[math.floor(N/2)])
  else:
    print(new[math.floor(N/2) - 1])

Buggy submission (verdict: Runtime Error):
import math
import statistics

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

for i in range(N):
  a = []
  for index, k in enumerate(li):
    if i == index:
      continue
      
    a.append(k)
    
  print(statistics.median(a))
Problem p03470 (python)

Fixed submission:
a=int(input())
lis = []

for i in range(a):
  lis.append(int(input()))

new = list(set(lis))
print(len(new))

Buggy submission (verdict: Runtime Error):
a=int(input())
list = []

for i in a:
  list.append(int(input()))

print(list(set(list)))
Problem p03478 (python)

Fixed submission:
import math

li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in range(a + 1):
  ans = 0
  tmp = i

  while(i >= 1):
    ans += i % 10
    i = math.floor(i / 10)

  if b <= ans <= c:
    list.append(tmp)

data = 0
for e in list:
  data += e

print(data)

Buggy submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in range(a + 1):
  ans = 0
  tmp = i

  while(i >= 1):
    ans += i % 10
    i = math.floor(i / 10)

  if b <= ans <= c:
    list.append(tmp)

data = 0
for e in list:
  data += e

print(data)

Buggy submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in a + 1:
  ans = 0

  while(i != 0):
    ans += i % 10
    i / 10

  if b <= ans <= c:
    list.append(ans)

data = 0
for e in list:
  data += e

print(data)

Buggy submission (verdict: Runtime Error):
list = []

for i in range(a + 1):
  if i < 10:
    if b <= i <= c:
      list.append(i)
  else:
    d = [int(i) for c in str(i)]
    e = 0
    for j in d:
      e += j
    if b <= e <= c:
      list.append(i)

k = 0
for t in list:
  k += t
print(k)

Buggy submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in range(a + 1)
  if i < 10:
    if b <= i <= c:
      list.append(i)
  else:
    d = [int(i) for c in str(i)]
    e = 0
    for j in d:
      e += j
    if b <= e <= c:
      list.append(i)

k = 0
for t in list:
  k += t
print(k)
Problem p03486 (python)

Fixed submission:
s=input()
t=input()

ss = sorted(s)
tt = sorted(t)

sss = "".join(ss)

tt.reverse()
ttt = "".join(tt)

if sss < ttt:
  print("Yes")
else:
  print("No")

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

ss = sorted(s)
tt = sorted(t)

ans = "No"

for i in range(len(ss)):
  if ss[i] < tt[i]:
    ans = "Yes"
    break

print(ans)
Problem p03565 (python)

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

ans = []

for index, s in enumerate(S):
  if s == '?' or s == T[0]:
    if index+len(T)-1 > len(S)-1:
        break

    for indexs, t in enumerate(T):
      if S[index+indexs] != t and S[index+indexs] != '?':
        break
    else:
      ans.append(S[0:index]+T+S[index+len(T):])


if len(ans) == 0:
  print("UNRESTORABLE")
else:
  ans.sort()
  print(ans[0].replace('?', 'a'))

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

t = len(T)
ans = "UNRESTORABLE"

answers = []

for index, s in enumerate(S):
  if index + t > len(S):
    break

  if s != '?' and s != T[0]:
    continue

  for a in range(1, t):
    if S[index+a] != '?' and S[index+a] != T[a]:
      break

  else:
    ans = S[0:index] + T + S[index+t:-1]
    answers.append(ans.replace('?', 'a'))

answers.sort()  
print(answers[0])
Problem p03607 (python)

Fixed submission:
N=int(input())
sets = set()

for n in range(N):
  a = int(input())
  
  if a in sets:
    sets.remove(a)
  else:
    sets.add(a)

print(len(sets))

Buggy submission (verdict: Runtime Error):
N=int(input())
li = [0] * 1000000000000

for n in range(N):
  li[int(input())] += 1

ans = 0

for i in li:
  if i % 2 == 1:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
li = [0] * 100002

for n in range(N):
  li[int(input())] += 1

ans = 0

for i in li:
  if i % 2 == 1:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
li = [0] * 100002

for n in range(N):
  li[int(input())] += 1

ans = 0

for i in li:
  if i % 2 == 1:
    ans += 1

print(ans)
Problem p03611 (python)

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v-1] += 1
    cnt[v+1] += 1
    
print(max(cnt))

Buggy submission (verdict: Runtime Error):
import numpy as np
li = np.array([])

N=int(input())
li = list(map(int, input().split()))
arr = np.array(li)

max = 0

for i in range(100000 + 1):

  a = np.count_nonzero(arr == i or arr == (i + 1) or arr == (i - 1))

  if max < a:
    max = a

print(a)
Problem p03854 (python)

Fixed submission:
import re

regex = r'(dream|dreamer|erase|eraser)+$'

s = input()

if re.match(regex, s):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import re

regex = r'(dream|dreamer|erase|eraser)+$'

s = raw_input()

if re.match(regex, s):
  print("YES")
else:
  print("NO")
Problem p03545 (python)

Fixed submission:
a, *bcd = map(int, input())

for bits in range(1 << 3):
    value = a
    formula = [a]
    for op, num in enumerate(bcd):
        if bits & 1 << op:
            value += num
            formula.append('+')
        else:
            value -= num
            formula.append('-')
        formula.append(num)
    if value == 7:
        formula.append('=7')
        print(*map(str, formula), sep='')
        break

Buggy submission (verdict: Runtime Error):
A, *BCD = map(int, input())
st_a = str(A)
for bit in range(1 << 3):
    formula = st_a
    tmp = A
    for i in range(3):
        n = BCD[i]
        if bit >> i & 1:
            tmp += n
            formula += '+'
        else:
            tmp -= n
            formula += '-'
        formula += str(n)
    if tmp == 7:
        print(f'{formula}=7')
        break
Problem p03730 (python)

Fixed submission:
A, B, C = map(int, input().split())
for i in range(1, B + 1):
    if A * i % B == C:
        print('YES')
        break
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
from otsutil import parg
A, B, C = map(int, input().split())
for i in range(1, B + 1):
    if A * i % B == C:
        print('YES')
        break
else:
    print('NO')