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

Fixed submission:
#import sys

def main():
    #args = sys.argv
    a, b = map(int, input().split())
    residual = ( a * b )%2
    if residual == 1:
        print("Odd")
    else :
        print("Even")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    args = sys.argv
    residual = ( int(args[1]) * int(args[2]) )%2
    if residual == 1:
        print("Odd")
    else :
        print("Even")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    args = sys.argv
    residual = ( int(args[1]) * int(args[2]) )%2
    if residual == 1:
        print("Even")
    else :
        print("Odd")

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

Fixed submission:
def main():
    N, A, B = map(int,input().split())
    #print('N:%d A:%d B: %d' % (N,A,B)) 

    answer = []
    for i in range(N+1):
        s = sum( map(int,list(str(i)) )) # list of int -> sum
        if s >= A and s <= B: answer.append(i)
        #print('i:%d s:%d' % (i,s))
    print(sum(answer))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    input = sys.stdin.readline
    N, A, B = map(int,input.split())
    #print('N:%d A:%d B: %d' % (N,A,B)) 

    answer = []
    for i in range(N+1):
        s = sum( map(int,list(str(i)) )) # list of int -> sum
        if s >= A and s <= B: answer.append(i)
        #print('i:%d s:%d' % (i,s))
    print(sum(answer))

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

Fixed submission:
n = int(input())
mochis = []
for i in range(n):
  mochis.append(int(input()))
print(len(set(mochis)))

Buggy submission (verdict: Runtime Error):
n, total = map(int, input().split())
min = n * 1000
max = n * 10000
if (total > max) or (total < min):
    print('-1 -1 -1')
else:
    min_man = (total - (5000 * n)) // 10000
    n -= min_man
    total -= min_man*10000
    min_sen = (total % 5000) // 1000
    total -= min_sen*1000
    n -= min_sen
    success = False
    for i in range(int(total // 10000)+1):
        if success:
            break
        ii = total - i*10000
        for j in range(int(ii // 5000)+1):
            jj = ii - j*5000
            k = jj//1000
            if i + j + k + min_sen + min_man == n:
                print(str(i+min_man) + ' ' + str(j) + ' ' + str(k+min_sen))
                success = True
                break

    if not success:
        print('-1 -1 -1')
Problem p03471 (python)

Fixed submission:
n, total = map(int, input().split())
# n, total = 2000, 20000000
min = n * 1000
max = n * 10000
if (total > max) or (total < min):
    print('-1 -1 -1')
else:
    min_man = (total - (5000 * n)) // 10000 if total - (5000 * n) > 0 else 0
    n -= min_man
    total -= min_man*10000
    min_sen = (total % 5000) // 1000
    total -= min_sen*1000
    n -= min_sen
    success = False
    if total == 0:
        print(str(min_man) + ' 0 ' + str(min_sen))
    else:
        for i in range(int(total // 10000)+1):
            if success:
                break
            ii = total - i*10000
            for j in range(int(ii // 5000)+1):
                jj = ii - j*5000
                k = jj//1000
                if i + j + k == n:
                    print(str(i+min_man) + ' ' + str(j) + ' ' + str(k+min_sen))
                    success = True
                    break

        if not success:
            print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n, total = map(int, input().split())
min = n * 1000
max = n * 10000
if (total > max) or (total < min):
  print('-1 -1 -1')
else
  min_man = total - (5000 * n) // 10000
  n -= min_man
  total -= min_man*10000
  min_sen = (total % 5000) / 1000
  total -= min_sen*1000
  n -= min_sen
  success = False
  for i in range(total // 10000):
    if success:
      break
    ii = total - i*10000
    for j in range(ii // 5000):
      jj = ii - j*5000
      k = jj/1000
      if i + j + k == n:
        print(str(i+min_man) + ' ' + str(j) + ' ' + str(k+min_sen))
        success = True
        break
     
  if not success:
    print('-1 -1 -1')
Problem p03493 (python)

Fixed submission:
a = input()
print(int(a[0])+int(a[1])+int(a[2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
a=list(map(int, input().split()))
count = 0
success = True
while True:
    for i, ele in enumerate(a):
        if ele % 2 == 0:
            a[i] = ele / 2
        else:
            success = False
    if not success:
        break
    count += 1
print(count)
Problem p03494 (python)

Fixed submission:
n = int(input())
a=list(map(int, input().split()))
count = 0
success = True
while True:
    for i, ele in enumerate(a):
        if ele % 2 == 0:
            a[i] = ele / 2
        else:
            success = False
    if not success:
        break
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
  a.append(int(input()))
count = 0
success = True
while True:
  for i, ele in enumerate(a):
    if ele % 2 == 0:
      a[i] = ele / 2
    else:
      success = False
  if not success:
    break
  count += 1
print(count)
Problem p03470 (python)

Fixed submission:
n=int(input())
rice=[]
for i in range(n):
    rice.append(input())

cake=[]
for i in range(n):
    if not(rice[i] in cake):
        cake.append(rice[i])

print(len(cake))

Buggy submission (verdict: Runtime Error):
n=input()
rice=[]
for i in range(n):
    rice.append(input())

cake=[]
for i in range(n):
    if not(rice[i] in cake):
        cake.append(rice[i])

print(len(cake))

Buggy submission (verdict: Runtime Error):
n=input()
rice=[]
for i in range(n):
    rice.append(input())

cake=[]
for i in range(n):
    if not(rice[i] in cake):
        cake.append(rice[i])

print(len(cake))
Problem p03471 (python)

Fixed submission:
N,X=map(int,input().split())
for x in range(N+1):
    for y in range(N+1-x):
        z=N-x-y
        if ((10000*x+5000*y+1000*z==X)and(0<=z)):
            print(x,y,z)
            exit()
print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
for x in range(N+1):
    for y in range(N+1-y):
        z=N-x-y
        if 10000*x+5000*y+1000*z==X:
            print(x,y,z)
            exit()
print(-1,-1,-1)
Problem p03455 (python)

Fixed submission:

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

if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):


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

if (a*b)%2 = 1:
  print('Odd')
else:
  print('Even')
Problem p03457 (python)

Fixed submission:
n = int(input())

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = [0] * (n+1)
x = [0] * (n+1)
y = [0] * (n+1)

t[0] = 0
x[0] = 0
y[0] = 0

for i in range(n):
    t[i+1],x[i+1],y[i+1] = map(int,input().split())

aFlg = True #ダメとなるまでは見なしOK

for i,tm in enumerate(t):
  xm = 0
  ym = 0
  if i > 0:
    if x[i] > x[i-1]:
      xm = x[i] - x[i-1]
    else:
      xm = x[i-1] - x[i]

    if y[i] > y[i-1]:
      ym = y[i] - y[i-1]
    else:
      ym = y[i-1] - y[i]

    if xm + ym > (t[i] - t[i-1]):  #動きすぎ
      aFlg = False
      break
    elif ((t[i] - t[i-1]) - (xm+ym))%2 == 1:  #そこには止まれない
      aFlg = False
      break

if aFlg:
  print('Yes')
else:
  print('No')

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

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = [0] * (n+1)
x = [0] * (n+1)
y = [0] * (n+1)

t[0] = 0
x[0] = 0
y[0] = 0

for i in range(n):
    t[i+1],x[i+1],y[i+1] = map(int,input().split())

aFlg = True #ダメとなるまでは見なしOK

for i in t:
  xm = 0
  ym = 0
  if i > 0:
    if x[i] > x[i-1]:
      xm = x[i] - x[i-1]
    else:
      xm = x[i-1] - x[i]

    if y[i] > y[i-1]:
      ym = y[i] - y[i-1]
    else:
      ym = y[i-1] - y[i]

    if xm + ym > t:  #動きすぎ
      aFlg = False
      break
    elif (t - (xm+ym))%2 == 1:  #そこには止まれない
      aFlg = False
      break

if aFlg:
  print('Yes')
else:
  print('No')

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

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = [0] * n
x = [0] * n
y = [0] * n

t[0] = 0
x[0] = 0
y[0] = 0

for i in range(n):
    t[i+1],x[i+1],y[i+1] = map(int,input().split())

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

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = (0) * n
x = (0) * n
y = (0) * n

t(0) = 0
x(0) = 0
y(0) = 0

for i in range(n):
  t(i+1),x(i+1),y(i+1) = map(int,input().split())
Problem p03470 (python)

Fixed submission:
n = int(input())

dList = [int(input()) for i in range(n)]

print(len(set(dList)))

Buggy submission (verdict: Runtime Error):
import sys

dList = []

for i,d in sys.stdin:
  if i <> 0: #1行目の行数情報はいらないので読み飛ばす
    dList.append(d)

print(len(set(dList)))

Buggy submission (verdict: Runtime Error):
import sys

dList = list()

for i,d in sys.stdin:
  if i != 0: #1行目の行数情報はいらないので読み飛ばす
    dList.append(d)

print(len(set(dList)))

Buggy submission (verdict: Runtime Error):
import sys

dList = list()

for i,d in sys.stdin:
  if i <> 0: #1行目の行数情報はいらないので読み飛ばす
    dList.append(d)

print(len(set(dList)))
Problem p03493 (python)

Fixed submission:
s = str(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i = i + 1

print(i)

Buggy submission (verdict: Runtime Error):

s = string(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i = i + 1

print(i)

Buggy submission (verdict: Runtime Error):

s = string(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i == i + 1

print(i)

Buggy submission (verdict: Runtime Error):

s = string(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple
  if sb == '1':
    i == i + 1

print(i)
Problem p03494 (python)

Fixed submission:
N = input()  #一応読むけど、ループ回せば不要では
aList=input().split()

opCnt = 0
isAllE = True  #奇数見つかるまでは見なしTrue

while isAllE:
  for a in aList:
    if int(a)%2 == 1:
      isAllE = False
      break
  else:
    opCnt = opCnt + 1
    for i,a in enumerate(aList):
      aList[i] = int(int(a)/2)

print(opCnt)

Buggy submission (verdict: Runtime Error):
N = input()  #一応読むけど、ループ回せば不要では
aList=input().split()


opCnt = 0
isAllE = True  #奇数見つかるまでは見なしTrue

while isAllE:
  for a in aList:
    if a%2 == 1:
      isAllE = False
  else:
    opCnt = opCnt + 1

print(opCnt)

Buggy submission (verdict: Runtime Error):
N = input()  #一応読むけど、ループ回せば不要では
aList=input().split()


opCnt = 0
isAllE = True  #奇数見つかるまでは見なしTrue

while isAllE
  for a in aList:
    if a%2 == 1:
      isAllE = False
  else:
    opCnt = opCnt + 1

print(opCnt)
Problem p03478 (python)

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

for i in range(1,n+1):
  nums = sum(list(map(int,str(i)[:])))
  if nums >= a and nums <= b:
    ttl += i

print(ttl)

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

ttl = 0

for i in range(1,n+1):
  nums = sum(list(map(int,str(i)[:])))
  if nums >= a and nums <= b:
    ttl += i

print(ttl)
Problem p03493 (python)

Fixed submission:
st = input()
tl = 0
for s in st[:]:
  tl += int(s)
print(tl)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
def groupby():
    global a
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
b=groupby()
b.sort(key=lambda x:x[1],reverse=True)
l=len(b)
ans=0
for i in range(k,l):
    ans+=b[i][1]
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
def groupby(src_list):
  dest_list=[[src_list[0],1]]
  for i in range(1,len(src_list)):
    if dest_list[-1][0]==src_list[i]:
      dest_list[-1][1]+=1
    else:
      dest_list.append([src_list[i],1])
  return dest_list
b=groupby(a)
b.sort(key=lambda x:x[1],reverse=True)
l=len(b)
ans=0
for i in range(k,l):
  ans+=b[i][1]
print(ans)
Problem p03494 (python)

Fixed submission:
input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

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

count = 0
while (prod % (2**n)) == 0:
	prod = int(prod / (2**n))
	count += 1
print(count)
Problem p03494 (python)

Fixed submission:

input()
A = list(map(int,input().split()))
count = 0

while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
  
print(count)

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

a = input()
b = list(input())
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0

for h in range(0,c+1):
  for i in range(0,b+1):
    for j in range(0,a+1):
      if (x == ((500 * j) + (100 * i) + (50 * h))):
      	cnt = cnt +1

print(cnt)

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

cnt = 0

for h in range(0,c):
  for i in range(0,b):
    for j in range(0,a):
      if (x == (500 * j + 100 * i + 50 * h))
      	cnt = cnt +1

  print(cnt)

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

cnt = 0

for h in range(0,c):
  for i in range(0,b):
    for j in range(0,a):
      if (x == (500 * a + 100 * b + 50 * c))
      	cnt = cnt +1

  print(cnt)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if ((a*b) % 2) == 1)
	print("Odd")
else
	print("Even")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if ((a*b) % 2) == 1
	print("Odd")
else
	print("Even")
Problem p03494 (python)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,a):
    if ((b[i] %2 ) == 0):
      b[i] = b[i] / 2
    else:
      endflag = True
      break
  if (endflag):
    break
  cnt = cnt + 1

print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if (3 == 0):
      b[i] = b[i] /2
    else:
      endflag = True
  cnt = cnt +1  
  if (endflag == True):
    break
      
print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = True
  cnt = cnt +1  
  if (endflag == True):
    break
      
print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if (3 == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1  
  if (endflag == True):
    break
      
print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1  
  if (endflag == True):
    break
      
print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1  
  if (endflag):
    break
      
print(cnt)

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

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1
  
  if (endflag):
    break;
      
print(cnt)

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

cnt = 0
endflag = false

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1
  
  if (endflag):
    break;
      
print(cnt)
Problem p03478 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""

"""
N=int(input())
A=int(input())
B=int(input())
"""

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

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        #print(i)

print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""


N=int(input())
A=int(input())
B=int(input())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        #print(i)

print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""


N=int(input())
A=int(input())
B=int(input())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        print(i)

print(count)
Problem p03434 (python)

Fixed submission:
N = int(input())
nums = sorted(list(map(int, input().split())), reverse = True)
print(sum(nums[::2]) - sum(nums[1::2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = sorted(list(map(int, input().split())) reverse = True)
print(sum(A[::2]) - sum(B[1::2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = sorted(list(map(int, input().split())) Reverse = True)
print(sum(A[::2]) - sum(B[1::2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = sorted(list(map(int, input().split()))[::-1])
A = 0
B = 0
for n in range(N):
  A = A + nums[2n]
  B = B + nums[2n+1]
print(A - B)
Problem p03448 (python)

Fixed submission:
a, b, c, x = [int(input()) for i in range(4)]
n = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
a, b, c , x = [int(input()) i for range(4)]
n = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
a, b, c , x = (int(input()) i for range(4))
n = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        n += 1
print(n)
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):
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if (x+y)>t or (x+y+t)%2 == 0:
        print("No")
        exit()
print("Yes")
Problem p03457 (python)

Fixed submission:
N = int(input())
T, X, Y = 0, 0, 0
count = 0
for i in range(N):
  t, x, y = map(int, input().split())
  dt = t - T
  dist = abs(x - X) + abs(y - Y)
  if dist <= dt and t%2 == (x+y)%2:
    count += 1
  T, X, Y = t, x, y
print('Yes' if count == N else 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
T, X, Y = 0, 0, 0
count = 0
for i in range(N):
  t, x, y = map(int, input().split())
  dt = t - T
  dist = abs(x - X) + abs(y - Y)
  if dist <= dt and t%2 == (x+y)%:
    count += 1
  T, X, Y = t, x, y
print('Yes' if count == N else 'No')
Problem p03470 (python)

Fixed submission:
N = int(input())
nums = [input() for i in range(N)]
print(len(set(nums)))

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = [input(), for i in range(N)]
print(len(set(nums)))
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)
      break
  else:
    continue
  break
else:
  print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1):
    k = N-i-j
    if (Y == 10000*i + 5000*j + 1000*k and K > 0 ):
      print(i, j, f)
    else: 
      print(-1, -1, -1)
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  sum = 0
  k = i
  while k > 0:
    sum = sum + k % 10
    k = k // 10
  if A <= sum <= B:
    ans = ans + i
print(ans)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  sum = 0
  k = i
  while k > 0:
    sum = sum + k % 10
    k = k // 10
  if A =< sum =< B:
    ans = ans + i
print(ans)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = 0
for i in (1, N+1):
  sum = 0
  k = i
  while k > 0:
    sum = sum + k % 10
    k = k // 10
  if A =< sum =< B:
    ans = ans + i
print(ans)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = 0
for i in (1, N+1):
  sum = 0
  k = n
  while k > 0:
    sum = sum + k % 10
    k = k // 10
  if A =< sum =< B:
    ans = ans + n
print(ans)
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b + c > 0:
  print(a + b + c)
else:
  print(0)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
dic = {}
dic['a'] = int(input())
dic['b'], dic['c'] = map(int, input().split())
dic['s'] = input()

print(dic)
Problem p03471 (python)

Fixed submission:
bill_count, total_money = map(int, input().split())
patterns = [
  (x, y, bill_count - x - y) 
    for x in range(bill_count + 1) 
      for y in range(bill_count - x + 1) 
    if 10000*x + 5000*y + 1000*(bill_count - x - y) == total_money
]
print(" ".join(map(str, patterns[0])) if len(patterns) > 0 else '-1 -1 -1')

Buggy submission (verdict: Runtime Error):
bill_count, total_money = map(int, input().split())

def calc(total_money, bill_count):
  x_high_bound = int(total_money / 10000) if int(total_money / 10000) < bill_count else bill_count
  for x in range(x_high_bound + 1):
    hoge = bill_count - x
    if 10000 * x + 5000 * hoge < total_money: continue
    if 10000 * x + 1000 * hoge > total_money: continue
    for y in range(hoge + 1):
      for z in [bill_count - x - y]:
        if 10000 * x + 5000 * y + 1000 * z == total_money:
          return f'{x} {y} {z}'
  return '-1 -1 -1'

print(calc(total_money, bill_count))

Buggy submission (verdict: Runtime Error):
bill_count, total_money = map(int, input().split())

def calc(total_money, bill_count):
  x_high_bound = int(total_money / 10000) if int(total_money / 10000) < bill_count else bill_count
  for x in range(x_high_bound + 1):
    hoge = bill_count - x
    if 10000 * x + 5000 * hoge < total_money: continue
    if 10000 * x + 1000 * hoge > total_money: continue
    for y in range(hoge + 1):
      for z in [bill_count - x - y]:
        if 10000 * x + 5000 * y + 1000 * z == total_money:
          return f'{x} {y} {z}'
  return '-1 -1 -1'

print(calc(total_money, bill_count))
Problem p03478 (python)

Fixed submission:
n, min_num, max_num = [int(x) for x in input().split()]
xs = range(1, n + 1)

def digit_sum(x):
  return sum([int(d) for d in str(x)])
answers = [x for x in xs if min_num <= digit_sum(x) <= max_num]

print(sum(answers))

Buggy submission (verdict: Runtime Error):
n, min_num, max_num = [int(x) for x in input().split()]
xs = range(1, n + 1)

def digit_sum(x):
  return sum([int(d) for d in str(x)])
answers = [x for x in xs if min_num <= digit_sum(x) <= max_num]

print(sum(answers)) for x in answers