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

Fixed submission:
from math import floor

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

x = None
if N < B:
    x = N
else:
    x = B
    x = B - 1
    # max_diff = 0
    # for _x in range(B, N + 1):
    #     diff = (x / B) - floor(x / B)
    #     if max_diff <= diff:
    #         max_diff = diff
    #         x = _x

answer = floor(A * x / B) - A * floor(x / B)

print(answer)

Buggy submission (verdict: Runtime Error):
from math import floor

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

x = None
if N < B:
    x = N

answer = floor(A * x / B) - A * floor(x / B)

print(answer)
Problem p02719 (python)

Fixed submission:
import math

inputted = list(map(int, input().split()))
N = inputted[0]
K = inputted[1]

candidate1 = N % K
candidate2 = K - candidate1
answer = min(candidate1, candidate2)

print(answer)

Buggy submission (verdict: Runtime Error):
import math

inputted = list(map(int, input().split()))
N = inputted[0]
K = inputted[1]

candidate1 = N - K * math.floor(N / K)
candidate2 = K - remainder
answer = min(candidate1, candidate2)

print(answer)
Problem p02755 (python)

Fixed submission:
import math

inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = math.ceil(tax_price_a / 0.08)
price_10 = math.ceil(tax_price_b / 0.10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.08):
    print(price_10)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = int(tax_price_a / 0.08)
price_10 = int(tax_price_b / 0.10)

if price_8 == price_10:
    print(price_8)
elif tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.u):
    print(price_10)
else:
    print(-1)
Problem p02761 (python)

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

answer = [None] * N
for si, ci in sc:
    digit = si - 1
    if answer[digit] is not None and answer[digit] != ci:
    # if answer[digit] != ci:
        print('-1')
        exit()
    
    answer[digit] = ci

if answer[0] == 0 and N != 1:
    print('-1')
    exit()

if answer[0] is None and N == 1:
    answer[0] = 0
elif answer[0] is None:
    answer[0] = 1

for i, value in enumerate(answer):
    if answer[i] is None:
        answer[i] = 0

answer = int(''.join(map(str, answer)))
print(answer)

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

answer = [None] * N
for si, ci in sc:
    digit = si - 1
    if answer[digit] is not None and answer[digit] != ci:
        print('-1')
        exit()
    
    answer[digit] = ci

for i, value in enumerate(answer):
    if answer[i] is None:
        answer[i] = 0

if (answer[0] == 0 and N == 3) or (answer[1] == 0 and N == 2):
    print('-1')
    exit()

answer = int(''.join(map(str, answer)))
print(answer)

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

answer = [None] * N
for si, ci in sc:
    if answer[si - 1] > ci:
        answer[si - 1] = ci

if answer[0] is None or answer[0] == 0:
    print('-1')
    exit()

for i, value in enumerate(answer):
    if answer[i] is None:
        answer[i] = 0

answer = ''.join(map(str, answer))
print(answer)
Problem p02767 (python)

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

distance = lambda Xi, P: (Xi - P) ** 2

X_max = max(X)

answer = 99999999999
for P in range(1, X_max + 1):
    total = 0
    for Xi in X:
        total += distance(Xi, P)
    answer = min(total, answer)

print(answer)

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

distance = lambda Xi, P: (Xi - P) ** 2

X_max = max(X)

answer = None
for P in range(1, X_max + 1):
    total = 0
    for Xi in X:
        total += distance(Xi, P)
    answer = min(total, answer) if answer is not None else total

print(answer)
Problem p02811 (python)

Fixed submission:
inputted = list(map(int, input().split()))
K = inputted[0]
X = inputted[1]

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);

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

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);

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

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);
Problem p02818 (python)

Fixed submission:
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
K = inputted[2]

A2 = max([0, A - K])
B2 = max([0, B - max([0, K - A])])

answer = '{} {}'.format(A2, B2)

print(answer)

Buggy submission (verdict: Runtime Error):
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
K = inputted[2]

A2 = max([0, A - K])
B2 = max([0, B - max([0, K - A]))

answer = '{} {}'.format(A2, B2)

print(answer)
Problem p02830 (python)

Fixed submission:
N = int(input())
inputted = input().split()
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
inputted = list(map(int, input().split()))
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
inputted = list(map(int, input()))
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)
Problem p02885 (python)

Fixed submission:
data = input().split()
A = int(data[0])
B = int(data[1])

remain = max(0, A - B * 2)

print(remain)

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

remain = max(0, A - B * 2)

print(remain)
Problem p02899 (python)

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

answer = [0] * N
for i, Ai, in enumerate(A):
    answer[Ai - 1] = str(i + 1)
answer = ' '.join(answer)

print(answer)

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

answer = [0] * len(A)
for i, Ai, in enumerate(A):
    answer[Ai - 1] = str(i + 1)
answer = ' '.join(answer)

print(answer)
Problem p02945 (python)

Fixed submission:
data = input()
data = data.split(' ')

A = int(data[0])
B = int(data[1])

answer = max(
    A + B,
    A - B,
    A * B,
)

print(answer)

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

answer = max(
    A + B,
    A - B,
    A * B,
)

print(answer)
Problem p02971 (python)

Fixed submission:
import collections


N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]
is_there_tow_maximum = A.count(maxiuam) >= 2

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = []
for Ai in A:
    if is_there_tow_maximum:
        answer.append(maxiuam)
    elif Ai == maxiuam:
        answer.append(second)
    else:
        answer.append(maxiuam)
answer = "\n".join(map(str, answer))

print(answer)

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


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = [second if Ai == maxiuam else maxiuam for Ai in A)]
answer = "\n".join(map(str, answer))

print(answer)

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


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = answer.append(second if Ai == maxiuam else maxiuam for Ai in A)
answer = "\n".join(map(str, answer))

print(answer)
Problem p03076 (python)

Fixed submission:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ceil = lambda number: math.ceil(number / 10) * 10
ceiled_A = ceil(A)
ceiled_B = ceil(B)
ceiled_C = ceil(C)
ceiled_D = ceil(D)
ceiled_E = ceil(E)

maximum_diff = 0
for minitues in [A, B, C, D, E]:
    ceiled = ceil(minitues)
    diff = ceiled - minitues
    if diff == 0: continue

    if maximum_diff is None or diff > maximum_diff:
        maximum_diff = diff

answer = ceiled_A + ceiled_B + ceiled_C + ceiled_D + ceiled_E - maximum_diff
    
print(answer)

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ceil = lambda number: math.ceil(number / 10) * 10
ceiled_A = ceil(A)
ceiled_B = ceil(B)
ceiled_C = ceil(C)
ceiled_D = ceil(D)
ceiled_E = ceil(E)

maximum_diff = None
for minitues in [A, B, C, D, E]:
    ceiled = ceil(minitues)
    diff = ceiled - minitues
    if diff == 0: continue

    if maximum_diff is None or diff > maximum_diff:
        maximum_diff = diff

answer = ceiled_A + ceiled_B + ceiled_C + ceiled_D + ceiled_E - maximum_diff
    
print(answer)
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    add = A + B
    print(add)

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

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = None
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break
        
        found = True
        for x, y, h in xyh:
            if h == 0: continue
            if h + abs(x - cx) + abs(y - cy) != candidate:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)
Problem p03240 (python)

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

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = 0
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break

        found = True
        for x, y, h in xyh:
            _h = candidate - abs(x - cx) - abs(y - cy)
            if h == 0 and _h <= 0: continue
            if not h == _h:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)

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

candidate = lambda xyh, cx, cy: abs(xyh[0] - cx) + abs(xyh[1] - cy) + xyh[2]

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        found = True
        candidates = [candidate(xyhi, cx, cy) for xyhi in xyh]

        found = True
        height = None
        for candidate in candidates:
            if candidate < 0: continue
            if height is None:
                height = candidate
                continue
            if candidate != height:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)

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

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        height = abs(xyh[0][0] - cx) + abs(xyh[0][1] - cy) + xyh[0][2]
        foo = [(abs(x - cx) + abs(y - cy) + h == height or (abs(x - cx) + abs(y - cy) + h == 0) for x, y, h in xyh]
        found = all(foo)
        if found: break
    if found: break
print(cx, cy, height)
Problem p03244 (python)

Fixed submission:
from collections import Counter


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

v_odd = []
v_even = []
for index in range(len(v)):
    i = index + 1
    if i % 2 == 0:
        v_even.append(v[index])
    else:
        v_odd.append(v[index])
# print(v_odd)
# print(v_even)
# print(Counter(v_odd).most_common())
# print(Counter(v_even).most_common())

if Counter(v_odd).most_common()[0][0] != Counter(v_even).most_common()[0][0]:
    number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
    number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]
else:
    odd_1st = Counter(v_odd).most_common()[0][1]
    even_1st = Counter(v_even).most_common()[0][1]
    odd_2nd = Counter(v_odd).most_common()[1][1] if len(Counter(v_odd).most_common()) >= 2 else 0
    even_2nd = Counter(v_even).most_common()[1][1] if len(Counter(v_even).most_common()) >= 2 else 0

    number_of_rewrites = min(
        len(v_odd) - odd_1st + len(v_even) - even_2nd,
        len(v_odd) - odd_2nd + len(v_even) - even_1st,
    )

print(number_of_rewrites)

Buggy submission (verdict: Runtime Error):
from collections import Counter


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

v_odd = []
v_even = []
for index in range(len(v)):
    i = index + 1
    if i % 2 == 0:
        v_even.append(v[index])
    else:
        v_odd.append(v[index])
# print(v_odd)
# print(v_even)
# print(Counter(v_odd).most_common())
# print(Counter(v_even).most_common())

if Counter(v_odd).most_common()[0][1] != Counter(v_even).most_common()[0][1]:
    number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
    number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]
else:
    if Counter(v_odd).most_common()[0][1] >= Counter(v_even).most_common()[0][1]:
        number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
        number_of_rewrites += len(v_even) - Counter(v_even).most_common()[1][1]
    else:
        number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[1][1]
        number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]


print(number_of_rewrites)
Problem p03262 (python)

Fixed submission:
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = fractions.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = abs(fractions.gcd(gcd_value, x[i]))
    # print(gcd)
print(gcd_value)

Buggy submission (verdict: Runtime Error):
import math


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = math.gcd(gcd_value, x[i])
    # print(gcd)
print(gcd_value)

Buggy submission (verdict: Runtime Error):
import math


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd = math.gcd(gcd, x[i])
    # print(gcd)
print(gcd)

Buggy submission (verdict: Runtime Error):
import math


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

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd = math.gcd(gcd, x[i])
    # print(gcd)
print(gcd)
Problem p03282 (python)

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

are_all_one = True
for i in range(len(S)):
    if S[i] != '1':
        are_all_one = False
        break

nth = i + 1
if are_all_one or K < nth:
    print(1)
    exit()

answer = S[i]
print(answer)

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

answer = S[1]
print(answer)
Problem p03309 (python)

Fixed submission:
import math

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

_A = []
for i in range(len(A)):
    _A.append(A[i] - (i + 1))
_A.sort()
median = _A[math.floor(len(A) / 2)]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)

Buggy submission (verdict: Runtime Error):
import math

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

_A = [A[i] - (i + 1) for i in range(len(A))]
_A.sort()
median = _A[math.ceil(len(A) / 2)]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)

Buggy submission (verdict: Runtime Error):
import math

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

_A = [] * len(A)
for i in range(len(A)):
    _A[i] -= (i + 1)
_A.sort()
median = _A[len(A) / 2]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)
Problem p02791 (python)

Fixed submission:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = [int(i) for i in input().split()]
min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == min:
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1
    
print(count)
Problem p02717 (python)

Fixed submission:
a,b,c = list(map(int,input().split()))
 
def myFun(x,y):
    val = x
    x = y
    y = val
    return (x,y)
 
a,b = myFun(a,b)
a,c = myFun(a,c)
print(a,b,c)

Buggy submission (verdict: Runtime Error):
x,y,z = list(map(int, input().split()))
def myFun(a,b):
  c = a
  a = b
  b = c
  return(a,b)
x,y = myFunc(x,y)
x,z = myFunc(x,z)
print(x,y,z)
Problem p03324 (python)

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

i = 0
count = 0
beki = 0


if d == 0:
    beki = 1
elif d == 1:
    beki = 100
else:
    beki = 10000


while not count == n:
    i += 1
    if i % 100 == 0:
        continue
    count += 1

print(i * beki)

Buggy submission (verdict: Runtime Error):
start_num = 0
ans_num = 0
count = 0


if d == 0:
    start_num = 1
elif d == 1:
    start_num = 100
else:
    start_num = 10000


while not count == n:
    ans_num += start_num
    count += 1


print(ans_num)
Problem p03817 (python)

Fixed submission:
x = int(input())
ans = x//11*2
p = x % 11
if p > 0:
    p -= 6
    ans += 1
if p > 0:
    p -= 5
    ans += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
if x / 11 < 1:
    ans = 1
    if x / 5 >= 1:
        ans = 2
else:
    ans = x // 11 * 2 + 1

print(ans)
Problem p02657 (python)

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

print(A*B)

Buggy submission (verdict: Runtime Error):
import numpy as np
 
N = int(input())
A = list(map(np.int64, input().split()))
 
A = np.array(A)
 
ans = np.prod(A)
 
 
if ans >10**18:
  print(-1)
else:
  print(ans)
Problem p02677 (python)

Fixed submission:
import numpy as np
A, B, H, M = map(np.float32, input().split())

R = H/12 + M*0.5/360

r = M/60

Rad_c = np.cos((R-r)*2*np.pi)

C = np.sqrt(A*A + B*B -2*A*B*Rad_c)
print(C)

Buggy submission (verdict: Runtime Error):
import numpy
def main():
	A, B, H, M = map(float, input().split())
	R = H/12 + M*0.5/360
	r = M/60
	cos = np.cos((R-r)*2*np.pi)
	C = np.sqrt(A*A + B*B - 2*A*B*cos)
	print(C)
 
if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
import numpy as np
def main():
	A, B, H, M = map(float, input().split())
	R = H/12 + M*0.5/360
	r = M/60
	cos = math.cos((R-r)*2*np.pi)
	C = np.sqrt(A*A + B*B - 2*A*B*cos)
	print(C)
 
if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
import math
def main():
	A, B, H, M = map(float, input().split())
	R = H/12 + M*0.5/360
	r = M/60
	cos = math.cos((R-r*2*math.pi)
	C = math.sqrt(A^2 + B^2 - 2*A*B*cos)
	print(C)

if name == '__main__':
	main()
Problem p03434 (python)

Fixed submission:
import numpy as np

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

Alice = []
Bob = []
for i in range(N):
  if i%2==0:
    Alice.append(max(A))
    A.remove(max(A))
  else:
    Bob.append(max(A))
    A.remove(max(A))

Alice = np.array(Alice)
Bob = np.array(Bob)

ans = np.abs(np.sum(Alice) -np.sum(Bob))

print(ans)

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

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

Alice = []
Bob = []
for i in range(N):
  if i%2==0:
    Alice.append(max(A))
    A.remove(max(A))
  else:
    Bob.append(max(A))
    A.remove(max(A))

Alice = np.array(Alice)
Bob = np.array(Bob)

ans = np.sum(Alice) -np.sum(Bob)

print(ans)
Problem p03471 (python)

Fixed submission:

N, M = map(int, input().split())

m10000 = -1
m5000 = -1
m1000 = -1
  
for a in range(N+1):
  for b in range(N+1-a):
    c = abs(N - a - b)
    X = 10000*a + 5000*b + 1000*c
    
    if X == M:
      m10000 = a
      m5000 = b
      m1000 = c

print(m10000, " ", m5000, " ", m1000)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
 
m10000 = -1
m5000 = -1
m1000 = -1
  
for a in range(N+1):
  for b in range(N+1-a):
    c = np.abs(N - a - b)
    X = 10000*a + 5000*b + 1000*c
    
    if X == M:
      m10000 = a
      m5000 = b
      m1000 = c
 
print(m10000, " ", m5000, " ", m1000)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
 
for a in range(N):
  for b in range(N):
    c = np.abs(N - a - b)
    X = 10000*a + 5000*b + 1000*c
    
    if X == M:
      m10000 = a
      m5000 = b
      m1000 = c
      break
      
      
Nt = m10000 + m5000 + m1000
  
if N >= Nt:
  print(m10000, " ", m5000, " ", m1000)
else:
  print(-1, " ", -1, " ", -1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
 
for a in range(N):
  for b in range(N):
    c = N - a - b
    X = 10000*a + 5000*b + 1000*c
    
    if X == M:
      m10000 = a
      m5000 = b
      m1000 = c
      
Nt = m10000 + m5000 + m1000
  
if N >= Nt:
  print(m10000, " ", m5000, " ", m1000)
else:
  print(-1, " ", -1, " ", -1)

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

for a in range(N):
  for b in range(N):
    c = N - a - b
    X = 10000*a + 5000*b + 1000*c
    
    if X == M:
      m10000 = a
      m5000 = b
      m1000 = c
      
 Nt = m10000 + m5000 + m1000
  
 if N >= Nt:
    print(m10000, " ", m5000, " ", m1000)
 else:
  print(print(-1, " ", -1, " ", -1)
Problem p03493 (python)

Fixed submission:
a = str(input())
print(a.count('1'))

Buggy submission (verdict: Runtime Error):
def how_many(n):
  count = 0
  while n%2==0:
    n /= 2
    count += 1
    return count

N = int(input())
A = map(int, input().split())
print(min(map(how_many, A)))

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

if a+b+c==0:
  print(0)
elif a+b+c==1:
  print(1)
elif a+b+c==2:
  print(2)
elif a+b+c==3:
  print(3)

Buggy submission (verdict: Runtime Error):
a = str(input())
print(a.count(1))