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

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

city_road_count = [0] * n
for i in range(m):
      a,b = map(int,input().split(" "))
      city_road_count[a-1] += 1
      city_road_count[b-1] += 1
      
for c in city_road_count:
      print(c)

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

city_road_count = [0] * m
for i in range(m):
  a,b = map(int,input.split(" "))
  city_road_count[a-1] += 1
  city_road_count[b-1] += 1
  
for c in city_road_count:
  print(c)

Buggy submission (verdict: Runtime Error):


n,m = map(int,input().split(" "))

roads = []
for i in range(m):
    roads.append(input())

def count_road(n,m,str_roads):
    city_roads_count = [0] * m
    for road in str_roads:
        a,b = map(int,input().split(" "))
        city_roads_count[a-1] += 1
        city_road_count[b-1] += 1
    return city_roads_count

roads_count = count_road(n,m,roads)

for road_count in roads_count:
    print(road)

Buggy submission (verdict: Runtime Error):

n,m = map(int,input().split(" "))

roads = []
for i in range(m):
    roads.append(input())

def count_road(n,m,str_roads):
    city_roads_count = [0] * m
    for road in str_roads:
        a,b = map(int,input().split(" "))
        city_roads_count[a-1] += 1
        city_road_count[b-1] += 1
    return city_roads_count


for road_cout in roads_count:
    print(road)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split(" "))
city_road_counts = [0] * m
for i in range(m):
  a,b = map(int,input().split(" "))
  a = a-1
  b = b-1
  city_road_counts[a] += 1
  city_road_counts[b] += 1

for road_count in city_road_counts:
  print(road_count)
Problem p03795 (python)

Fixed submission:
n = int(input())

give = n * 800
take = n // 15 * 200

print(give - take)

Buggy submission (verdict: Runtime Error):
食べた回数=int(input())
値段=800
ボーナス=200
支払うお金=食べた回数 * 値段
もらうお金=食べた回数//15 * ボーナス
     
    print(支払うお金-もらうお金)

Buggy submission (verdict: Runtime Error):
食べた回数= int(input())
値段=800
ボーナス=200
支払うお金= 食べた回数 * 値段
もらうお金=　食べた回数//15 * ボーナス

print(支払うお金 - もらうお金)
Problem p03796 (python)

Fixed submission:
n = int(input())
temp = 1
     
for i in range(1,n+1):
  temp = temp * i
  temp = temp % ((10**9)+7)
     
print(temp % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
    n = int(input())
    temp = 1
     
    for i in range(1,n+1):
      temp = temp + i
      temp = temp % (10**10)
     
    print(int(temp % (10 ** 9 + 7)))

Buggy submission (verdict: Runtime Error):
n = int(input())
temp = 1
for i in range(1,n+1):
  temp = temp * i
  
 print(temp)
Problem p03797 (python)

Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    #print("s:",s)
    #print("c:",c)
    #print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    #print("s:",s)
    #print("c:",c)
    #print("counter:",counter)
      
print(temp)

Buggy submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
      
print(temp)

Buggy submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
      
print(temp)

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

counter = 0
if s >= 1 and c >= 2:
  temp = min(s,c//2)
  s -= temp
  c -= temp
  counter += temp

if s<=0 and c >= 4:
  temp = c // 4
  counter += temp
  c -= temp
  
print(temp)
Problem p03844 (python)

Fixed submission:

a,op,b= input().split()
a,b=int(a),int(b)


func = (lambda x,y:x+y) if op =="+" else (lambda x,y:x-y)
print(func(a,b))

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

func = lambda x,y:x + y if op =="+" else lambda x,y:x-y

print(func(a,b))
Problem p02548 (python)

Fixed submission:
n = int(input())

# c = N - a*b
cnt = 0
for a in range(1, n, 1):
    for b in range(1, n, 1):
        if n <= a*b:
            break
        else:
            if a != b:
                cnt += 2
            else:
                cnt += 1
                break

print(cnt)

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

# c = N - a*b
cnt = 0
for a in range(1, n, 1):
    for b in range(1, n, 1):
        if n <= a*b:
            break
        else:
            if a != b:
                cnt += 2
            else:
                cnt += 1
                break

print(cnt)
Problem p02601 (python)

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

if b > a:
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'
else:
  while b <= a:
    b *= 2
    k -= 1
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'

print(ans)

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

while k > 0:
  if b <= a:
    b *= 2
    k -= 1
  else:
    break
if k > 0:
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'

print(ans)
Problem p02628 (python)

Fixed submission:
import numpy as np

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

prices_arr = np.array(prices)
answer = prices_arr[0:k].sum()

print(answer)

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

prices = prices.sorted()

answer = 0
for i in range(0, k, 1):
  answer = answer + prices[i]
print(answer)
Problem p02641 (python)

Fixed submission:
import numpy as np

x, n = map(int, input().split())
num_lists = list(map(int, input().split()))

all_num = list(range(0, 102, 1))
lists = [i for i in all_num if i not in num_lists]

lists_arr = np.array(lists)
diff_arr = lists_arr - x
abs_arr = np.abs(diff_arr)
index = np.where(abs_arr == abs_arr.min())
answer_list = lists_arr[index]
print(answer_list[0])

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

x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    lists = list(map(int, input().split()))
    lists_arr = np.array(lists)

    max = lists_arr.max()
    min = lists_arr.min()
    number_lists = list(range(min, max+1, 1))
    existing = number_lists.copy()
    for i in lists:
        existing.remove(i)
    existing_arr = np.array(existing)
    if x > max or x < min:
        print(x)
    else:
        if x <= existing_arr.min():
            print(existing_arr.min())
        elif x >= existing_arr.max():
            print(existing_arr.max())

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

x, n = map(int, input().split())
lists = list(map(int, input().split()))

lists_arr = np.array(lists)

max = lists_arr.max()
min = lists_arr.min()
number_lists = list(range(min, max+1, 1))
existing = number_lists.copy()
for i in lists:
    existing.remove(i)
existing_arr = np.array(existing)
if x > max or x < min:
    print(x)
else:
    if x <= existing_arr.min():
        print(existing_arr.min())
    elif x >= existing_arr.max():
        print(existing_arr.max())
Problem p02658 (python)

Fixed submission:
N = int(input())
v = list(map(int, input().split()))
limit = 10 ** 18

answer = 1
if 0 in v:
  answer = 0
else:
  for i in v:
    answer = answer * i
    if answer <= limit:
      continue
    else:
      answer = -1
      break
print(answer)

Buggy submission (verdict: Runtime Error):
import functools
import operator

N = int(input())
v = ((map(int, input().split())))
answer = functools.reduce(operator.mul.v)
answer = answer if answer <= 10 ** 18 else -1
print(answer)

Buggy submission (verdict: Runtime Error):
import functools
import operator

N = int(input())
v = ((map(int, input().split())))
answer = functools.reduce(mul.v)
answer = answer if answer <= 10 ** 18 else -1
print(answer)

Buggy submission (verdict: Runtime Error):
import functools
import operator

N = int(input())
v = ((map(int, input().split())))
answer = functools.reduce(mul.v)
answer = answer if answer <= 1000000000000000000 else -1
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
v = list(map(int, input().split()))
answer = reduce(lambda x,y: x*y, v)
answer = answer if answer <= 1000000000000000000 else -1
print(answer)

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

N = int(input())
v = np.arrray(list(map(int, input().split())))

answer = v.prod()

answer = answer if answer <= 10 ** 18 else -1
print(answer)

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

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

answer = v.prod()

answer = answer if answer <= 10 ** 18 else -1
print(answer)
Problem p02677 (python)

Fixed submission:
import math
A, B, H, M = map(int, input().split())
 
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = abs(H_degree - M_degree)
if diff > 180:
  diff = 360 - diff
else:
  diff = diff
 
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
 
print(length)

Buggy submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input().spli3t())
 
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = abs(H_degree - M_degree)
if diff > 180:
  diff = 360 - diff
else:
  diff = diff
 
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
 
print(length)

Buggy submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input(), split())
 
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = math.abs(H_degree - M_degree)
if diff > 180:
  diff = 360 - diff
else:
  diff = diff
 
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
 
print(length)

Buggy submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input(), split())

H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = H_degree - M_degree
if diff > 180:
  diff = 360 - diff
else:
  diff = diff

length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))

print(length)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
 
if t.startswith(s):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s, t = input().split()
 
if t.startswith(s):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s, t = map(input().split())

if t.startswith(s):
  print('Yes')
else:
  print('No')
Problem p02706 (python)

Fixed submission:
import numpy as np

n, m = map(int, input().split())
lists = list(map(int, input().split()))

arr = np.array(lists)
days = arr.sum()

if n - days >= 0:
    print(int(n - days))
else:
    print('-1')

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

n, m = map(int, input().split())
lists = list(map(int, input().split()))

arr = np.array(lists)
days = arr.sum()

if days >= 0:
  print(int(n - days))
else:
  print('-1')
Problem p02718 (python)

Fixed submission:
import numpy as np

n, m = map(int, input().split())
vote_lists = list(map(int, input().split()))

vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
is_popular = total_vote / (4 * m)

answer_lists = []

for i in vote_lists:
  if i >= is_popular:
    answer_lists.append(i)

if len(answer_lists) >= m:
  print('Yes')
else:
  print('No')

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

n, m = map(int, input().split())
vote_lists = list(map(int, input().split()))

vote_arr = np.array(vote_lists)
total_vote = vote_arr.sum()
is_popular = total_vote / (4 * m)

answer_lists = []

for i in vote_lists:
  if i >= is_popular:
    answer_lists.append(i)

if len(answer_lists) >= m:
  print('Yes')
else:
  Print('No')
Problem p02748 (python)

Fixed submission:
a, b, m = map(int, input().split())
a_price = list(map(int, input().split()))
b_price = list(map(int, input().split()))
coupon = []
for _ in range(m):
    coupon.append(list(map(int, input().split())))

a_copy = a_price.copy()
a_copy.sort()
b_copy = b_price.copy()
b_copy.sort()
a_min = a_copy[0]
b_min = b_copy[0]
min = a_min + b_min
totals = [min]
for list in coupon:
    tmp = a_price[list[0] - 1] + b_price[list[1] - 1] - list[2]
    totals.append(tmp)

totals.sort()
ans = totals[0]

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a_price = list(map(int, input().split()))
b_price = list(map(int, input().split()))
coupon = []
for _ in range(m):
  coupon.append(list(map(int, input().split())))
  
a_copy = a_price.copy()
a_copy.sort()
b_copy = b_price.copy()
b_copy.sort()
a_min = a_copy[0]
b_min = b_copy[0]
min = a_min + b_min
totals = [min]
for list in coupon:
  tmp = a_list[list[0]-1] + b_list[list[1]-1] - list[2]
  totals.append(tmp)

totals.sort()
ans = totals[0]

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a_price = list(map(int, input().split()))
b_price = list(map(int, input().split()))
coupon = []
for _ in range(m):
  coupon.append(list(map(int, input().split())))
  
a_copy = a_price.copy()
b_copy = b_price.copy()
a_min = a_copy.sort()[0]
b_min = b_copy.sort()[0]
min = a_min + b_min
totals = [min]
for list in coupon:
  tmp = a_list[list[0]-1] + b_list[list[1]-1] - list[2]
  totals.append(tmp)

totals.sort()
ans = totals[0]

print(ans)

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a_price = list(map(int, input().split()))
b_price = list(map(int, input().split()))
coupon = []
for _ in range(m):
  coupon.append(list(map(int, input().split())))
  
a_min = a_price.sort()[0]
b_min = b_price.sort()[0]
min = a_min + b_min
totals = [min]
for list in coupon:
  tmp = a_list[list[0]-1] + b_list[list[1]-1] - list[2]
  totals.append(tmp)

totals.sort()
ans = totals[0]

print(ans)
Problem p02772 (python)

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

even_numbers = []
for i in numbers:
  if i % 2 == 0:
    even_numbers.append(i)

answers = []
for i in even_numbers:
  if i % 3 == 0 or i % 5 == 0:
    answers.append(i)

if even_numbers == answers:
  print('APPROVED')
else:
  print('DENIED')

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

even_numbers = []
for i in numbers:
  if i % 2 == 0:
    even_numbers.append(i)

answers = []
for i in even_numbers:
  if i % 3 == 0 or i % 5 == 0:
    answers.append(i)

if even_numbers == answers:
  print('APPROVED')
else:
  print('DENIED')
Problem p02830 (python)

Fixed submission:
n = int(input())
s, t = input().split()
 
answer_list = []
for i in range(n):
  answer_list.append(s[i])
  answer_list.append(t[i])

joint = ''.join(answer_list)
print(joint)

Buggy submission (verdict: Runtime Error):
n = int(input())
s, t = map(int, input().split())
 
answer_list = []
for i in range(n):
  answer_list.append(s[i])
  answer_list.append(t[i])

s = ''.join(answer_list)
print(s)

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

answer_list = []
for i in range(n):
  answer_list.append(s[i])
  answer_list.append(t[i])
  
print(answer_list.join())
Problem p02923 (python)

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

ans_list = [0]*n
for i in range(n):
  if i == 0:
    continue
  else:
    if heights[i] <= heights[i-1]:
      ans_list[i] = ans_list[i-1]+1
    else:
      ans_list[i] = 0
      
ans_list.sort()
ans = ans_list[-1]
print(ans)

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

cnt_list = []
for i in range(len(heights)):
  cnt = 0
  while True:
    j = i+1
    if heights[j] <= heights[i]:
      cnt += 1
    else:
      break
  cnt_list.append(cnt)

cnt_list.sort(reverse=True)
ans = cnt_list[0]

print(ans)
Problem p02994 (python)

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

taste_lists = list()
for i in range(n):
    taste = l+i
    taste_lists.append(taste)

eat = 0
if taste_lists[0] > 0 and taste_lists[-1] > 0:
    eat = taste_lists[0]
elif taste_lists[0] < 0 and taste_lists[-1] < 0:
    eat = taste_lists[-1]
else:
    eat = 0

taste_lists.remove(eat)
ans = 0
for i in taste_lists:
    ans += i

print(ans)

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

taste_lists = []
for i in range(n):
  taste = l+i-1
  taste_lists.append(taste)

for i in taste_lists:
  if i<0:
    taste_lists[i] = abs(i)

taste_lists.sort()
taste_lists.pop(0)

ans = 0
for i in taste_lists:
  ans += i
  
print(ans)
Problem p03076 (python)

Fixed submission:
import itertools

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

num_list = [a, b, c, d, e]
factorial = list(itertools.permutations(num_list, 5))
ans_list = []
for list in factorial:
    tmp = 0
    for i in list:
        if tmp%10 == 0:
            tmp += i
        else:
            tmp += 10 - tmp%10
            tmp += i
    ans_list.append(tmp)

ans_list.sort()
ans = ans_list[0]

print(ans)

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

num_list = [a, b, c, d, e]
last_digit = []
for i in num_list:
    d = str(i)
    digit = d[-1]
    digit = int(digit)
    last_digit.append(digit)

min = 10000
for j in last_digit:
    if j < min and j != 0:
        min = j
last_digit[last_digit.index(min)] = 0

for k in range(len(num_list)):
    if last_digit[k] != 0:
        num_list[k] += 10-last_digit[k]

ans = 0
for l in num_list:
    ans += l

print(ans)
Problem p03106 (python)

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

min = a
if b < min:
  min = b

ans_lists = []
for i in range(1, min+1, 1):
  if a%i == 0 and b%i == 0:
    ans_lists.append(i)

ans_lists.reverse()
ans = ans_lists[k-1]

print(ans)

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

min = a
if b < min:
  min = b

ans_lists = []
for i in range(1, min+1, 1):
  if a%i == 0 and b%i == 0:
    ans_lists.append(i)

ans_lists.reverse()
ans = lists[k-1]

print(ans)
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    costs.sort()
    ans = costs[0]
print(ans)

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs[1:]:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

indexes = []
index = 0
for i in t_lists:
    if i <= t:
        indexes.append(index)
    index += 1
costs = []
for i in indexes:
    costs.append(c_lists[i])

if costs == []:
    ans = 'TLE'
else:
    minimum = costs[0]
    for i in costs:
        if i < minimum:
            minimum = i
            ans = minimum

print(ans)
Problem p03308 (python)

Fixed submission:
import numpy as np

n = int(input())
lists = list(map(int, input().split()))

arr = np.array(lists)
maximum = arr.max()
minimum = arr.min()
print(maximum - minimum)

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

lists.sorted()
print(lists[-1] - lists[0])
Problem p03424 (python)

Fixed submission:
n = int(input())
lists = input().split()

sets = set(lists)
if len(sets) == 3:
    ans = 'Three'
else:
    ans = 'Four'

print(ans)

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

sets = set(lists)
ans = len(sets)

print(ans)
Problem p03471 (python)

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

total = 0
ans = list()
for a in range(0, n+1, 1):
  for b in range(0, n+1, 1):
    if a + b <= n:
      c = n - (a+b)
      total = a*10000 + b*5000 + c*1000
      if total == y:
        lists = [a,b,c]
        ans.append(lists)
    else:
      break

if ans == []:
  answer = ['-1', '-1', '-1']
  answer = ' '.join(answer)
else:
  answer = [str(i) for i in ans[0]]
  answer = ' '.join(answer)

print(answer)

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

total = 0
ans = list()
for a in range(0, n+1, 1):
  for b in range(0, n+1, 1):
    if a + b <= n:
      c = n - (a+b)
      total = a*10000 + b*5000 + c*1000
      if total == y:
        lists = [a,b,c]
        ans.append(lists)
    else:
      break

if ans == False:
  answer = ['-1', '-1', '-1']
  answer = ' '.join(answer)
else:
  answer = [str(i) for i in ans[0]]
  answer = ' '.join(answer)

print(answer)
Problem p03485 (python)

Fixed submission:
import math

a, b = map(int, input().split())
c = (a + b) / 2
print(math.ceil(c))

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

print(mean(a, b).roundup())
Problem p03495 (python)

Fixed submission:
from collections import Counter

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

num_counts = dict()
length = len(set(num_lists))
ans = 0

if length > k:
  d = Counter()
  d.update(num_lists)
  count_sorted = list(d.values())
  count_sorted.sort()
  for i in range(length - k):
    ans += count_sorted[i]

print(ans)

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

num_counts = dict()
if len(set(num_lists)) <= k:
  ans = 0
else:
  for i in set(num_lists):
    num_counts[i] = num_lists.count(i)
    numbers = [num_counts.values()]
    numbers.sort()
    ans = 0
  for i in range(len(set(num_lists)) - k):
    ans += numbers[i]

print(ans)

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

if len(set(num_lists)) <= k:
  ans = 0
else:
  num_counts = {}
  for i in set(num_lists):
    num_counts[i] = num_lists.count(i)
  
  numbers = list(num_counts.values())
  numbers.sort()
  ans = 0
  for i in range(k - len(set(num_lists)):
    ans += numbers[i]
print(ans)

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

if len(set(num_lists)) <= k:
  ans = 0
else:
  num_counts = {}
  for i in set(num_lists):
    num_counts[i] = num_lists.count(i)
  
  numbers = list(num_counts.values)
  numbers.sort()
  ans = 0
  for i in range(k - len(set(num_lists)):
    ans += numbers[i]
print(ans)