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

Fixed submission:
n = int(input())
a = int(input())

x = n % 500
if x != 0:
    if x <= a:
        print('Yes')
    else:
        print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)

alice = 0
bob = 0

for x in range(n):
    if x % 2 == 0:
        alice += a[x]
    else:
        bob += a[x]

res = alice - bob
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)

alice = 0
bob = 0

for x in range(n):
    if x % 2 == 0:
        alice += a[x]
    else:
        bob += a[x]

res = alice - bob
print(res)
Problem p03544 (python)

Fixed submission:
# coding: utf-8
from functools import lru_cache


@lru_cache(maxsize=1000)
def test2(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return test2(n-1) + test2(n-2)


if __name__ == "__main__":
    n = int(input())
    dict = {0:2, 1:1}
    print(test2(n))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import math


def test(n,dict):
    left = n - 1
    right = n - 2
    leftValue = 0
    rightValue = 0
    if left in dict:
        leftValue = dict[left]
    else:
        leftValue = test(left, dict)

    if right in dict:
        rightValue = dict[right]
    else:
        rightValue = test(right, dict)


    return leftValue + rightValue



if __name__ == "__main__":
    n = int(input())
    dict = {0:2, 1:1}
    print(test(n, dict))
Problem p03457 (python)

Fixed submission:
n = int(input())
nums = [[0,0,0]]
ans = []

for v in range(n):
    t, x, y = map(int,input().split())
    nums.append([t,x,y])

# print(nums)
# print(nums[1][1])

for x in range(n):
    p = nums[x+1][0] - nums[x][0]
    px = nums[x+1][1] - nums[x][1]
    py = nums[x+1][2] - nums[x][2]
    ps = px + py
    # print(p,px,py,ps)

    for w in range(p+1):
        pp = w
        mp = p - pp
        # print(pp,mp)
        if pp-mp==ps:
            ans.append(1)
        else:
            ans.append(0)

    
sum = 0 
for num in ans:
    sum = sum + num


if sum==n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = [[0,0,0]]
ans = False

for v in range(n):
    t, x, y = map(int,input().split())
    nums.append([t,x,y])

# print(nums)
# print(nums[1][1])

for x in range(n+1):
    p = nums[x+1][0] - nums[x][0]
    px = nums[x+1][1] - nums[x][1]
    py = nums[x+1][2] - nums[x][2]
    ps = px + py
    # print(p,px,py,ps)

    for w in range(p+1):
        pp = w
        mp = p - pp
        # print(pp,mp)
        if pp-mp==ps:
            ans = True

if ans:
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
year = input()
year = year.replace('2017','2018')
print(year)

Buggy submission (verdict: Runtime Error):
ny = input().split()
n = int(ny[0])
y = int(ny[1])

def solve(n,y):
    Y = y/1000
    p = int((Y - n) // 9)
    for v in range(p+1):
        if (Y - n - 9*v)%4 == 0:
            b = int((Y - n - 9*v)/4)
            c = int((Y - 10*v - 5*b))
            if c*b < 0:
                continue
            else:
                return str(v), str(b), str(c)


ans = solve(n,y)
if ans != None:
    print(' '.join(ans))
else:
    print(-1, -1, -1)
Problem p03501 (python)

Fixed submission:
n,a,b=map(int,input().split())
if n*a>b:
  print(b)
else:
    print(n*a)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
if n*a>b:
  print(b)
else print(a)
Problem p03657 (python)

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

jud=False

if a%3==0:
    jud=True
elif b%3==0:
    jud=True
elif (a+b)%3==0:
    jud=True
else:
    jud=False

if jud==True:
    print("Possible")
else:
    print("Impossible")

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

nums.sort()
nums.reverse()
ans=list()

for v in range(0,k):
    ans.append(nums[v])

print(sum(ans))
Problem p03693 (python)

Fixed submission:
nums=input()
nums=nums.replace(" ","")
nums=int(nums)
if nums%4==0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
nums=input()
nums=nums.replace(" ","")
nums=nums.replace(nums[0],"")
nums=int(nums)
if nums%4==0:
    print("YES")
else:
    print("NO")
Problem p03729 (python)

Fixed submission:
str1,str2,str3=input().split()
if str1[-1:]==str2[:1] and str2[-1:]==str3[:1]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
str1=input()
str2=input()
str3=input()

if str1[-1:]==str2[:1] and str2[-1:]==str3[:1]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
str1=input()
str2=input()
str3=input()

slice1=str1[-1:]
slice2=str2[:1]
slice3=str2[-1:]
slice4=str3[:1]

if slice1==slice2 and slice3==slice4:
    print("YES")
else:
    print("NO")
Problem p03854 (python)

Fixed submission:
S = list(input())

flag = True
while flag == True:
    if len(S) == 0:
        break
    if len(S) >= 5:
        if S[-5:] == list("dream"): del S[-5:]
        elif S[-5:] == list("erase"): del S[-5:]
        elif len(S)>=6 and S[-6:] == list("eraser"): del S[-6:]
        elif len(S)>=7 and S[-7:] == list("dreamer"): del S[-7:]
        else:
            flag = False
    else:
        flag = False
if flag:
    print("YES")
else:print("NO")

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

def hantei(S):
    flag = True
    if S[0:5] == list('dream'):
        del(S[0:5])
        if S[0:2] == list('er') and S[2] != 'a':
            del(S[0:2])
    elif S[0:5] == list('erase'):
        del(S[0:5])
        if S[0:1] == list("r"):
            del(S[0])
    else:
        flag = False
    return S, flag

S, flag = hantei(S)
while flag == True:
    if len(S) == 0:
        print("YES")
        break
    S, flag = hantei(S)
if flag == False:
    print("NO")

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

def hantei(S):
    flag = True
    if S[0:5] == list('dream'):
        del(S[0:5])
        if S[0:2] == list('er') and S[2] != 'a':
            del(S[0:2])
    elif S[0:5] == list('erase'):
        del(S[0:5])
        if S[0:1] == list("r"):
            del(S[0])
    else:
        flag = False
    return S, flag

flag = True
while flag == True:
    if len(S) == 0:
        print("YES")
        break
    S, flag = hantei(S)
if flag == False:
    print("NO")
Problem p03485 (python)

Fixed submission:
from math import ceil
a,b = map(int, input().split())
print(ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
from math import ceil
a,b = map(int, input().split())
print(ceil((a+b)/2)
Problem p03493 (python)

Fixed submission:
s = list(map(int, input()))
count = 0
for i in range(len(s)):
  if s[i] == 1:
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
s = map(input())
count = 0
if s[0] == '1':
  count += 1
if s[1] == '1':
  count +=1
if s[2] == '1':
  count += 1
print(count)
Problem p03854 (python)

Fixed submission:
#!/user/bin/env pypy3
import itertools
import sys


def fast_input():
    return sys.stdin.readline()[:-1]


def print_format(b: bool) -> str:
    return "YES" if b else "NO"


def solve(s: str) -> bool:
    for p in itertools.permutations(["dreamer", "eraser", "dream", "erase"]):
        work = s
        for token in p:
            work = work.replace(token, '')
        if work == "":
            return True
    return False


def main():
    result = solve(fast_input())
    print(print_format(result))


main()

Buggy submission (verdict: Runtime Error):
#!/user/bin/env pypy3
import itertools
import sys


def fast_input():
    return sys.stdin.readline()[:-1]


def print_format(b: bool) -> str:
    return "YES" if b else "NO"


def solve(s: str) -> bool:
    tokens = ["dream", "erase", "eraser", "dreamer"]

    def dfs(pos: int) -> bool:
        if pos == len(s):
            return True
        for token in tokens:
            if (pos + len(token)) > len(s):
                break
            if s[pos:pos + len(token)] == token:
                if dfs(pos + len(token)):
                    return True

    return dfs(0)


def main():
    result = solve(fast_input())
    print(print_format(result))


main()
Problem p03455 (python)

Fixed submission:
from sys import stdin
a,b = [int(x) for x in stdin.readline().rstrip().split()]

x = a*b

if x % 2 == 1:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
n = int(input())
prev_t = 0
for i in range(n):
    t, x, y=map(int, input().split())
    if (x + y) > (t - prev_t) or (x + y + (t - prev_t)) % 2:
        print("No")
        exit()
    prev_t = t
print("Yes")
Problem p03493 (python)

Fixed submission:
from sys import stdin
a = [int(x) for x in list(stdin.readline().rstrip())]
y = 0

for x in a:
    if x == 1:
        y += 1

print(y)

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = [int(x) for x in list(stdin.readline())]
y = 0

for x in a:
    if x == 1:
        y += 1

print(y)

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = [int(x) for x in list(stdin.readline())]
y = 0

for x in a:
    if x == 1:
        y += 1

print(y)

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = [int(x) for x in list(stdin.readline())]
y = 0

for x in a:
    if x == 1:
        y += 1

print(y)
Problem p03434 (python)

Fixed submission:
N = input()
A = list(input().split())
A = list(map(int,A))
A = sorted(A,reverse = True)
a = 0
b = 0
try :
  while len(A) != 0 :
    a += A.pop(0)
    b += A.pop(0)
  print(a-b)
except IndexError :
  print(a-b)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(input().split())
A = list(map(int,A))
A = sorted(A,reverse = True)
a = 0
b = 0
while len(A) != 0 :
  a += A.pop(0)
  b += A.pop(0)
print(a-b)
Problem p03457 (python)

Fixed submission:
N = int(input())

locx = 0
locy =0
time = 0
for i in range(N):
  t,x,y = map(int,input().split())
  nowtime = t-time
  dis = abs(locx-x)+abs(locy-y)
  if (nowtime-dis)<0 :
    print("No")
    exit()
  if (nowtime-dis)%2 == 1:
    print("No")
    exit()
    
  
  time = t
  locx = x
  locy = y
    
  
else :
  print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
xy=[]
try :
  while True:
    t = input().split()
    t = list(map(int,t))
    xy.append(t)
except EOFError:
  pass
loc = [0,0]
time = 0
for i in range(N+1):
  a = xy[i]
  time = a[0]-time
  dis = abs(loc[0]-a[1])+abs(loc[1]-a[2])
  if (time-dis)<0 :
    print("No")
    break
  elif (time-dis)%2 == 0:
    loc = [a[1],a[2]]
    
  else :
    print("No")
    break
else :
  print("Yes")
Problem p03493 (python)

Fixed submission:
mass = input()
s1 = int(mass[0])
s2 = int(mass[1])
s3 = int(mass[2])
c = 0
if s1 == 1:
  c += 1
if s2 == 1:
  c += 1
if s3 == 1:
  c += 1
print(c)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
c = 0
d = -1
while c>d:
  d+=1
  for i in A:
    if i%2 == 0:
      continue
    else :
      print(c)
      break
  else :
    A=list(map(lambda x :x/2,A))
    c += 1
Problem p03455 (python)

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

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

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

if (a*b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03854 (python)

Fixed submission:
s = list(input())

a = list("dream")
b = list("dreamer")
c = list("erase")
d = list("eraser")
flag = 0

while(flag == 0):
    if s[-7:] == b:
        del s[-7:]
    elif s[-6:] == d:
        del s[-6:]
    elif s[-5:] == a or s[-5:] == c:
        del s[-5:]
    elif s == []:
        print("YES")
        flag = 1
    else:
        print("NO")
        flag = 1

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

a = list("dream")
b = list("dreamer")
c = list("erase")
d = list("eraser")
flag = 0

while(flag == 0):
    print(s)
    if s[-7:] == b:
        del s[-7:]
    elif s[-6:] == d:
        del s[-6:]
    elif s[-5:] == a or s[-5:] == c:
        del s[-5:]
    elif s == []:
        print("YES")
        flag = 1
    else:
        print("NO")
        flag = 1
Problem p03455 (python)

Fixed submission:
# coding: utf-8
a, b = map(int, input().split())
c = (a & b) & 1
if c == 1:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
# coding: utf-8

a, b = map(int, input().sprit())
c = (a & b) & 1
if c == 1:
  print("odd")
else:
  print("even")
Problem p03434 (python)

Fixed submission:
n=int(input())
A=[int(x) for x in input().split()]
B=sorted(A)
Alice=[]
Bob=[]
while len(B)!=0 and len(B)!=1:
  Alice.append(B[-1])
  B.pop()
  Bob.append(B[-1])
  B.pop()
if len(B)==1:
  Alice.append(B[0])
  B.pop()
print(sum(Alice)-sum(Bob))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=[int(x) for x in input().split()]
B=sorted(A)
Alice=[]
Bob=[]
while len(B)!=0 or len(B)!=1:
  Alice.append(B[-1])
  B.pop()
  Bob.append(B[-1])
  B.pop()
if len(B)==1:
  Alice.append(B[0])
  B.pop()
print(sum(Alice)-sum(Bob))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=[int(x) for x in input().split()]
B=sorted(A)
Alice=[]
Bob=[]
while len(B)!=0 or len(B)!=1:
  Alice.append(B[-1])
  B.pop()
  Bob.append(B[1-])
  B.pop()
if len(B)==1:
  Alice.append(B[0])
  B.pop()
print(sum(Alice)-sum(Bob))
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
s=int(input())
n=0
for x in range(a+1):
    for y in range(b+1):
        for z in range(c+1):
            if 500*x+100*y+50*z==s:
                n=n+1
print(n)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
s=int(input())
n=0
for x in range(a):
  for y in range(b):
    for z in range(c):
      if 500x+100y+50z==s:
        n=n+1
print(n)
Problem p03455 (python)

Fixed submission:
n, m = (int(x) for x in input().split())
if int((n*m)/2)==(n*m)/2:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
n, m = (int(x) for x in input().split())
if int((n+m)/2)==n+m:
  print(Even)
else:
  print(Odd)
Problem p03470 (python)

Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
B=[]
while len(A)!=0:
  if A[0] not in B:
    B.append(A[0])
  A.pop(0)
print(len(B))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[input() for i in range(N)]
B=[]
while len(A)!=0:
  if A[0] not in B:
    B.append(A[0])
  A.popleft()
print(len(B))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[input() i in range(N)]
B=[]
while len(A)!=0:
  if A[0] not in B:
    B.append(A[0])
  A.popleft()
print(len(B))
Problem p03478 (python)

Fixed submission:
n,a,b=(int(x) for x in input().split())
c=0
d=[]
def sual(N,A,B):
  l=list('{}'.format(N))
  for y in range(len(l)):
      d.append(int(l[y]))
  e=sum(d)
  d.clear()
  if A<=e<=B:
    return True
  else:
    return False

for x in range(n):
  if sual(x+1,a,b):
    c=c+x+1
print(c)

Buggy submission (verdict: Runtime Error):
n,a,b=(int(x) for x in input().split())
c=0
def sual(N,A,B):
  l=list('{}'.format(N))
  s=sum(l)
  if A<=s<=B:
    return True
  else:
    return False
for x in range(n):
  if sual(x+1,a,b):
    c=c+x+1
print(c)

Buggy submission (verdict: Runtime Error):
n,a,b=int(x) for x in input().split()
c=0
def sual(N,A,B):
  l=list('{}'.format(N))
  s=sum(l)
  if A<=s<=B:
    return True
  else:
    return False
for x in range(n):
  if sual(x+1,a,b):
    c=c+x+1
print(c)
Problem p03493 (python)

Fixed submission:
x=input()
X=list('{}'.format(x))
a=[]
for i in range(len(X)):
    a.append(int(X[i]))
A=sum(a)
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
    
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
    print(b)
  t=t+1
  print(t)
    
print(t)

Buggy submission (verdict: Runtime Error):
x=input()
X=list('{}'.format(x))
A=sum(X)
print(A)
Problem p03455 (python)

Fixed submission:
a,b = map(int, input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a*b/2 == 0:
    print(Even)
else:
    print(Odd)
Problem p03434 (python)

Fixed submission:

def main():
    N = int(input())
    a = sorted(map(int, input().split()),reverse=True)      #降順のリスト

    alice = 0
    bob = 0

    for i in range(N):
        if i % 2 == 0:
            alice += a[i]

        else:
            bob += a[i]

    print(alice - bob)


if __name__ == "__main__":
    main()

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

alice = 0
bob = 0

A_rev = sorted(A, reverse=True)

while True:
    alice += A_rev.pop(0)
    bob += A_rev.pop(0)

    if len(A_rev) == 0:
        break

print(alice - bob)

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    a = sorted(map(int, input().split()))[::-1]
    diff = sum([::2]) - sum([1::2])
    print(diff)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    a = sorted(map(int, input().split()))[::-1]
    diff = sum([::2]) - sum([1:2])
    print(diff)


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

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

for a in range(N+1):
    for b in range(N-a+1):
        c = N - a -b
        if 10000*a + 5000*b + 1000*c == Y:
            print(a, b, c)
            exit()
else:
    print(-1, -1, -1)

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

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x -y
        if 10000*a + 5000*b + 1000*c == Y:
            print(a, b, c)
        else:
            print(-1, -1, -1)
Problem p03478 (python)

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

for i in range(N + 1):
    if A <= sum(map(int, list(str(i)))) <= B:
        count  += i

print(count)

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

for i in range(N + 1):
    if A <= i <= B:
        count += sum(list(str(i)))

print(count)
Problem p04001 (python)

Fixed submission:
# -*- coding: utf-8 -*-

s = str(input())
n = len(s) - 1
answer = 0
for i in range(2 ** n):
    operation = [""] * n
    for j in range(n):
        if (i >> j) & 1:
            operation[n - 1 -j] = "+"
    
    formula = ""
    for p_n, p_o in zip(s, operation + [""]):
        formula += (p_n + p_o)
    
    answer += eval(formula)

print(answer)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

s = int(input())
n = len(s) - 1
answer = 0
for i in range(2 ** n):
    operation = [""] * n
    for j in range(n):
        if (i >> j) & 1:
            operation[n - 1 -j] = "+"
    
    formula = ""
    for p_n, p_o in zip(s, operation + [""]):
        formula += (p_n + p_o)
    
    answer += eval(formula)

print(answer)
Problem p03434 (python)

Fixed submission:
N = int(input())
cards = list(map(int,input().split()))
 
cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]
print(sum_A - sum_B)

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

cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]

a = sum_A - sum_B
print(a)

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

cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]

print(sum_A - sum_B)

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

cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]

print(sum_A - sum_B)

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

num = cards.sort(reverse=True)

sum_A = 0
sum_B = 0

for i in range(N):
  if i % 2 == 0:
    sum_A += num[i]
  else:
    sum_B += num[i]

print(sum_A - sum_B)
Problem p03471 (python)

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

for x in range(N+1):
    for y in range(N-x+1):
        if 10000*x + 5000*y + 1000*(N-x-y) == Y:
            print(x, y, N-x-y)
            exit() # 処理を終わらせる
print(-1, -1, -1)

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

for x in range(N+1):
    for y in range(N-x+1):
        if 10000*x + 5000*y + 1000*(N-x-y) == Y:
            print(x, y, z)
            exit() # 処理を終わらせる
print(-1, -1, -1)
Problem p03493 (python)

Fixed submission:
s = input()
a = [int(c) for c in s]
b = 0
for i in a:
  if i == 1:
    b += 1
 
print(b)

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

Buggy submission (verdict: Runtime Error):
N = int(input()) #1行目を取得する
a = list(map(int,input().split()))
 
num = 0
exist_odd = True
while exist_odd:
  num += 1
  for i in range(N):      
    if a[i] % 2 == 0:
      a[i] /= 2
    else:
      exist_odd = False
else:
  print(num - 1)

Buggy submission (verdict: Runtime Error):
N = int(input()) #1行目を取得する
a = list(map(int,input().split()))
 
num = 0
exist_odd = True
while exist_odd:
  num += 1
  for i in range(N):
    if a[i] % 2 == 0:
      a[i] = a[i] / 2
    else:
      exist_odd = False
else:
  print(num - 1)

Buggy submission (verdict: Runtime Error):
N = int(input()) #1行目を取得する
a = list(map(int,input().split()))
 
num = 0
exist_odd = True
while exist_odd:
  num += 1
  for i in range(N):
    if a[i] % 2 == 0:
      a[i] = a[i] / 2
    else:
      exist_odd = False

print(num - 1)
Problem p03448 (python)

Fixed submission:
def coins(a,b,c,x):
    num=0
    for i in range(a+1):
        for w in range(b+1):
            for q in range(c+1):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a=int(input())
  b=int(input())
  c=int(input())
  x=int(input())
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def coins(a,b,c,x):
    num=0
    for i in range(a):
        for w in range(b):
            for q in range(c):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a=input()
  b=input()
  c=input()
  x=input()
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def coins(a,b,c,x):
    num=0
    for i in range(a):
        for w in range(b):
            for q in range(c):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a,b,c,x=input()
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()