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

Fixed submission:
N = int(input())

def dfs(s): # 文字列 s で始まる七五三数の個数
	if int(s) > N:
		return 0
	ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1
	for c in '753':
		ret += dfs(s + c)
	return ret

print(dfs('0')) # 本当は dfs('') と書きたいが 4 行目でのエラーを防ぐため仕方なく

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
x = int(input())
l = [3, 5, 7]

h = itertools.combinations_with_replacement(l, 4)

cnt = 0
for v in itertools.combinations_with_replacement(l, 4):
    if (3 in v and 5 in v and 7 in v):
        if v < x:
            cnt += 1

h_list = list(itertools.combinations_with_replacement(l, 4))

print (cnt)
Problem p02705 (python)

Fixed submission:
import math
a = int(input())
val = 2*math.pi*a
print(val)

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
temp = 3.14
val = str(2*temp*a)
st=""
ind=0
for j in range(len(val)):
	if(val[j]=="."):
		ind=j
		st+="."
		break
	else:
		st+=val[j]
st+=val[ind+1]
st+=val[ind+2]

print(st)
Problem p02767 (python)

Fixed submission:
n=int(input())
x=list(input().split())
x=[int(s) for s in x]
if n==1 or len(set(x))==1:
    print(0)
else:
    b_li=[]
    for i in range(min(x),max(x)):
        a_li=[]
        for j in range(n):
            a=(x[j]-i)**2
            a_li.append(a)
        b=sum(a_li)
        b_li.append(b)
    print(min(b_li))

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(input().split())
x=[int(s) for s in x]
if n>1:
    b_li=[]
    for i in range(min(x),max(x)):
        a_li=[]
        for j in range(n):
            a=(x[j]-i)**2
            a_li.append(a)
        b=sum(a_li)
        b_li.append(b)
    print(min(b_li))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(input().split())
x=[int(s) for s in x]
b_li=[]
for i in range(min(x),max(x)):
    a_li=[]
    for j in range(n):
        a=(x[j]-i)**2
        a_li.append(a)
    b=sum(a_li)
    b_li.append(b)
print(min(b_li))
Problem p03076 (python)

Fixed submission:
menew=[int(input()) for i in range(5)]
small=0
jo=10

for i in range(5):
    if menew[i]%10<jo and menew[i]%10!=0:
        jo=menew[i]%10
        small=menew[i]
if small!=0:
    menew.remove(small)
    ans=0
    for i in range(4):
        if menew[i]%10==0:
            p=0
        else:
            p=10-menew[i]%10
        ans+=menew[i]+p
    ans+=small
    print(ans)
else:
    print(sum(menew))

Buggy submission (verdict: Runtime Error):
menew=[int(input()) for i in range(5)]
small=0
jo=10
for i in range(5):
    if menew[i]%10<jo and menew[i]%10!=0:
        jo=menew[i]%10
        small=menew[i]
menew.remove(small)
ans=0
for i in range(4):
    if menew[i]%10==0:
        p=0
    else:
        p=10-menew[i]%10
    ans+=menew[i]+p
    
ans+=small
print(ans)
Problem p03136 (python)

Fixed submission:
N = int(input())
L=[int(x) for x in input().split()]
if sum(L)-max(L) > max(L):
    print("Yes")
else:
    print("No")

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

l=[]
for i in range(n):
  l.append(int(input()))

a=sum(l)-2*max(l)

if a<0 :
  print("Yes")
  
else:
  print("No")
Problem p03206 (python)

Fixed submission:
D=int(input())
if D==25:
  print("Christmas")
elif D==24:
  print("Christmas Eve")
elif D==23:
  print("Christmas Eve Eve")
elif D==22:
  print("Christmas Eve Eve Eve")

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

a=-100
for i in range(N):
  if a<P[i]:
    a=P[i]

P.remove(a)

goukei=a/2
for j in range(N-1):
  goukei+=P[j]

print(int(goukei))

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

a=-100
for i in range(N):
  if a<P[i]:
    a=P[i]

P.remove(a)

goukei=a/2
for j in range(N-1):
  goukei+=P[j]

print(int(goukei))

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

a=-100
for i in range(N):
  if a<P[i]
    a=P[i]

P.remove(P[i])

goukei=a/2
for j in range(N-1):
  goukei+=P[j]

print(int(goukei))
Problem p03210 (python)

Fixed submission:
x = int(input())

if x==7 or x==5 or x==3 :
    print("YES")

else :
    print("NO")

Buggy submission (verdict: Runtime Error):

X=int(input("age"))
if X=3 or X=5 or X=7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
1<=X<=9
X=int(input("age"))
if X=3 or X=5 or X=7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
1<=X<=9
X=input("age")
if X=3 or X=5 or X=7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X=input("年齢を1から9歳までで入力してください")
if X=3 or X=5 or X=7:
	print("Yes")
    
else:
  print("No")
Problem p03260 (python)

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

if a%2==1 and b%2==1 :
    print("Yes")

else :
    print("No")

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

if a//2==0 and b//2==0:
  print(“YES”)

else:
  (“NO”)
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")
Problem p03096 (python)

Fixed submission:
from collections import defaultdict

N = int(input())
stones = []
last = None
n_stone = 0
for i in range(N):
    stone = int(input())
    if stone != last:
        stones.append(stone)
        last = stone

count = defaultdict(int)
seq = 1
for i, c in enumerate(stones):
      prev = count[c]
      count[c] = prev + seq
      seq += prev

print(seq % (10**9 + 7))

Buggy submission (verdict: Runtime Error):
def find_seq(stones, start, index, table):
    if start in table:
        return table[start]
    else:
        sequence = 1
        for i in range(start, len(stones)):
            stone = stones[i]
            if len(index[stone]) > 1:
                for j in index[stone]:
                    if j > i:
                        sequence += find_seq(stones, j+1, index, table)
        table[start] = sequence
        return sequence

N = int(input())
stones = []
index = {}
last = None
n_stone = 0
for i in range(N):
    stone = int(input())
    if stone != last:
        stones.append(stone)
        last = stone
        if stone in index:
            index[stone].append(n_stone)
        else:
            index[stone] = [n_stone]
        n_stone += 1
table = {}
sequence = find_seq(stones, 0, index, table)
#print(index, table)
print(sequence)
Problem p03455 (python)

Fixed submission:
N= input().split()

N[0]=int(N[0])
N[1]=int(N[1])

if  N[0]*N[1] % 2 == 0:
	print("Even")
else:
	print("Odd")

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

A=int(A)
B=int(B)

if  A*B % 2 == 0:
	print("Even")
else:
	print("Odd")
Problem p02947 (python)

Fixed submission:
N = int(input())
words = {}

ans = 0
for _ in range(N):
    w = list(input())
    w.sort()
    w = "".join(w)
    if w not in words:
        words[w] = 1
    else:
        ans += words[w]
        words[w] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import itertools
import math

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)

def C(n, r):
    return P(n, r)//math.factorial(r)

N = int(input())

nums = ["".join(str(list(collections.Counter(list(input())).values()))) for _ in range(N)]
ans = 0
for i in collections.Counter(nums).values():
    ans += C(i, 2)
print(ans)
Problem p03076 (python)

Fixed submission:
l = [int(input()) for i in range(5)]
a = []
b = []
c = []
total = 0
for i in l:
    if i % 10 == 0:
        a.append(i)
    else:
        b.append(i)
minNum = 10
ans = 0
for i in b:
    if i % 10 < minNum:
        minNum = i % 10
        ans = i
if b:
    c.append(ans)
    b.remove(ans)
if a:
    for i in a:
        total += i
if b:
    for i in b:
            total += i + (10 - i % 10)
if c:
    total += c[0]
print(total)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for i in range(5)]
a = []
b = []
c = []
total = 0
for i in l:
    if i % 10 == 0:
        a.append(i)
    else:
        b.append(i)
c.append(b.pop(-1))
for i in b:
    total += i + 10 - i % 10
for i in a:
    total += i
total += c[0]
print(total)

Buggy submission (verdict: Runtime Error):
l = [str(input()) for i in range(5)]
tmp = []
total = 0
a = []
b = []
c = []
for n in l:
    tmp.append([n,n[-1]])
for k, v in sorted(tmp, key=lambda x: x[1], reverse=True):
    if int(v) == 0:
        b.append([int(k), int(v)])
    else:
        a.append([int(k), int(v)])
c.append(a[-1]) 
a = a[:-1]
for i in a:
    total += i[0] + 10 - i[1]
for i in b:
    total += i[0]
total += c[0][0]
print(total)

Buggy submission (verdict: Runtime Error):
l = [str(input()) for i in range(5)]
dct = {}
total = 0
a = []
b = []
c = []
for n in l:
    dct[n] = n[-1]
for k, v in sorted(dct.items(), key=lambda x: x[1], reverse=True):
    if int(v) == 0:
        b.append([int(k), int(v)])
    else:
        a.append([int(k), int(v)])
c.append(a[-1]) 
a = a[:-1]
for i in a:
    total += i[0] + 10 - i[1]
for i in b:
    total += i[0]
total += c[0][0]
print(total)
Problem p03087 (python)

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

nums = [0] * N
count = 0
for i in range(len(S)-1):
    nums[i] = count
    if S[i] == "A" and S[i+1] == "C":
        count += 1
nums[-1] = count

for _ in range(Q):
    l,r = map(int, input().split())
    print(nums[r-1] - nums[l-1])

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

nums = [0] * (N+1) 
count = 0
for i in range(len(S)):
    nums[i] = count
    if S[i] == "A" and S[i+1] == "C":
        count += 1

"""
for _ in range(Q):
    l,r = map(int, input().split())
    print(nums[r-1] - nums[l-1])
"""

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

nums = [0] * (N+1) 
count = 0
for i in range(len(S)):
    nums[i] = count
    if S[i] == "A" and S[i+1] == "C":
        count += 1

for _ in range(Q):
    l,r = map(int, input().split())
    print(nums[r-1] - nums[l-1])
Problem p03105 (python)

Fixed submission:
a, b, c = map(int, input().split())
print(b // a) if (b // a) < c else print(c)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l1 = [i for i in range(1, a) if (a % i == 0)]
l2 = [i for i in range(1, b) if (b % i == 0)]
l = list(set(l1) & set(l2))
l.sort()
print(l[k-1])
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
l1 = [i for i in range(1, a+1) if (a % i == 0)]
l2 = [i for i in range(1, b+1) if (b % i == 0)]
l = list(set(l1) & set(l2))
l.sort(reverse = True)
print(l[k-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l1 = [i for i in range(1, a) if (a % i == 0)]
l2 = [i for i in range(1, b) if (b % i == 0)]
l = list(set(l1) & set(l2))
l.sort()
print(l[k-1])
Problem p03109 (python)

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

import datetime

date = input()
date1 = datetime.datetime.strptime(date, '%Y/%m/%d')

date2 = datetime.datetime(2019, 4, 30)

if date2 >= date1:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    total = 0

    for line in range(0, n):
        total += calc()

    print(total)


def calc():
    x, u = map(str, input().split())

    if u == "JPY":
        return int(x)

    if u == "BTC":
        return float(x) * 380000


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    total = 0

    for line in range(0, n):
        total += calc(total)

    print(total)

def calc(total):
    x, u = map(str, input().split())

    if u == "JPY":
        total += int(x)
        return total

    if u == "BTC":
        total += float(x) * 380000
        return total


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

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

if b % a == 0:
    print(a + b)
else:
    print(b - a)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
favFood = [input().split() for i in range(n)]
for i in favFood:
    del i[:1]

if not(n == 1):
    count = 0
    for i in range(1, m):
        check = True
        for j in range(n):
            if not (str(i) in favFood[j]):
                check = False
        if check:
            count += 1
    print(count)

else:
    print(len(favFood))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
favFood = [input().split() for i in range(n)]
for i in favFood:
    del i[:1]
    
count = 0

for i in range(1, m):
    check = True
    for j in range(n):
        if not (str(i) in favFood[j]):
            check = False
    if check:
        count += 1

print(count)
Problem p03136 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
print("Yes") if sum(l[:n-1]) > l[n-1] else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
l.sort()
print("Yes") if sum(l[:n]) < l[n] else print("No")
Problem p03160 (python)

Fixed submission:
n = int(input())
c = list(map(int, input().split()))
dp = [0] * n

dp[0] = 0
dp[1] = abs(c[0] - c[1])

for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(c[i] - c[i - 1]), dp[i - 2] + abs(c[i] - c[i - 2]))

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
import sys
 
n, k = map(int, input().split())
c = list(map(int, input().split()))
 
maxNum = sys.maxsize
 
dp = [maxNum] * n
dp[0] = 0
 
for i in range(n):
    for j in range(1, k+1):
        if (0 <= i+j) & (i+j <= n-1):
            dp[i+j] = min(dp[i+j], dp[i] + abs(c[i] - c[i+j]))
 
print(dp[n-1])
Problem p03162 (python)

Fixed submission:
N = int(input())
sel = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * 3 for _ in range(N+1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if not j == k:
                dp[i+1][k] = max(dp[i+1][k], dp[i][j]+sel[i][k])

print(max(dp[N]))

Buggy submission (verdict: Runtime Error):
N = int(input())
sel = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * N for _ in range(N+1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if not j == k:
                dp[i+1][k] = max(dp[i+1][k], dp[i][j]+sel[i][k])

print(max(dp[N]))
Problem p03219 (python)

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

print(x + int(y / 2))

Buggy submission (verdict: Runtime Error):
x, y = int(input())

print(x + y / 2)

Buggy submission (verdict: Runtime Error):
x, y = int(input())

print(x + int(y / 2))
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
l.sort()
exist = False

for i in l:
  if int(i[1]) <= t:
    print(i[0])
    exist = True
    break
if not exist:
  print("TLE")

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
l = [input().split() for i in range(n)]
l.sort()
exist = False

for i in l:
  if int(i[1]) < t:
    print(i[0])
    exist = True
    break
if !(exist):
  print("TLE")
Problem p03274 (python)

Fixed submission:
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

ans = sys.maxsize

for i in range(N-K+1):
    minNum = candles[i]
    maxNum = candles[i+K-1]
    l = abs(minNum) + abs(minNum - maxNum)
    r = abs(maxNum) + abs(maxNum - minNum)
    ans = min(ans, min(l, r))

print(ans)

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

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K-1]

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

tmp = sys.maxsize

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K-1]

print(tmp)

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

tmp = sys.maxsize

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K-1]
    if maxNum < 0:
        ans = abs(minNum)
    elif (minNum < 0) and (0 <= maxNum):
        if abs(minNum) <= abs(maxNum):
            ans = 2*abs(minNum) + maxNum
        else:
            ans = 2*maxNum + abs(minNum)
    elif 0 <= minNum:
        ans = maxNum
    tmp = min(tmp,ans)

print(tmp)

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

tmp = sys.maxsize

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K-1]
    if maxNum < 0:
        ans = minNum
    elif (minNum < 0) and (0 <= maxNum):
        if abs(minNum) <= abs(maxNum):
            ans = 2*abs(minNum) + maxNum
        else:
            ans = 2*maxNum + abs(minNum)
    elif 0 <= minNum:
        ans = maxNum
    tmp = min(tmp,ans)

print(tmp)

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

tmp = sys.maxsize

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K]
    if maxNum < 0:
        ans = minNum
    elif (minNum < 0) and (0 <= maxNum):
        if abs(minNum) <= abs(maxNum):
            ans = 2*abs(minNum) + maxNum
        else:
            ans = 2*maxNum + abs(minNum)
    elif 0 <= minNum:
        ans = maxNum
    tmp = min(tmp,ans)

print(tmp)

Buggy submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
candles = list(map(int, input().split()))

tmp = sys.maxsize

for i in range(K):
    minNum = candles[i]
    maxNum = candles[i+K]
    if minNum >= 0 and maxNum >= 0:
        ans = maxNum
    elif maxNum >= 0 and minNum < 0:
        a = 2 * abs(minNum) + maxNum
        b = 2 * maxNum + abs(minNum)
        ans = min(a,b)
    elif maxNum < 0 and minNum < 0:
        ans = abs(minNum)
    tmp = min(ans, tmp)

print(tmp)
Problem p03308 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(abs(int(l[0]) - int(l[-1])))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
l.sort()
print(abs(l[0]) - l[-1])
Problem p03328 (python)

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

tower = 0

for i in range(1, b - a + 1):
    tower += i

print(tower - b)

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

def generate(n):
    if n == 1:
        return 1
    return generate(n-1) + n

generate(diff) - b

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

def generate(n):
    if n == 1:
        return 1
    return generate(n-1) + n

print(generate(diff) - b)

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

def generate(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    return generate(n-1) + n

print(generate(diff) - b)

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

def generate(n):
    if n == 1:
        return 1
    return generate(n-1) + n

print(generate(diff) - b)
Problem p03369 (python)

Fixed submission:
s = list(input())
price = 700

for t in s:
    if t == "o":
        price += 100

print(price)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
total = 0

for i in range(n):
  total += int(l[n-1])
  if x < total:
    print(n)
print(n)
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
l = [int(input()) for i in range(n)]
l.sort()
print((x - sum(l)) // l[0] + n)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
count, total = 0
while total < x:
    total += int(l[i])
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [input() for i in range(n)]
l.sort()
count = 0
while total < x:
    total += int(l[i])
    count += 1
print(count)
Problem p03385 (python)

Fixed submission:
s = list(input())

if (("a" in s) & ("b" in s) & ("c" in s)):
    print("Yes")
else:
    print("No")

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

print((s in "a") & (s in "b") & (s in "c"))

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

return (s in "a") & (s in "b") & (s in "c")
Problem p03408 (python)

Fixed submission:
import collections

n = int(input())
blueCards = [input() for i in range(n)]
blueCards = collections.Counter(blueCards)
m = int(input())
redCards = [input() for i in range(m)]
redCards = collections.Counter(redCards)

diff = blueCards - redCards
print(diff.most_common()[0][1]) if diff else print(0)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
blueCards = [input() for i in range(n)]
blueCards = collections.Counter(blueCards)
m = int(input())
redCards = [input() for i in range(m)]
redCards = collections.Counter(redCards)

diff = blueCards - redCards
print(diff.most_common()[0][1])
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
print("Yes") if n % 500 <= a else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if ((n % 500) <= a) else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if (n % 500) < a else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if n % 500 < a else print("No")
Problem p03447 (python)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Buggy submission (verdict: Runtime Error):
n = int(input)
a = int(input)
print("Yes") if ((n % 500) <= a) else print("No")
Problem p03455 (python)

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

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

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


def calc(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = n // 10
    return sum

for i in range(n+1):
    if a <= calc(i) & calc(i) <= b:
        total += i

print(total)

Buggy submission (verdict: Runtime Error):
k, s = map(int, input().split())
count = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i + j + l == s:
                count += 1

print(count)
Problem p03485 (python)

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

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

Fixed submission:
n = int(input())

l = [0] * 87
l[0] = 2
l[1] = 1
for i in range(2, n + 1):
    l[i] = l[i-1] + l[i-2]
print(l[n])

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

def calcLucas(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    return calc(n-1) + calc(n-2)

print(calcLucas(n))
Problem p03605 (python)

Fixed submission:
l = list(input())
print("Yes") if "9" in l else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = set()
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.add(tmp)
print(len(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
#l = [l.remove(int(input())) if int(input()) in l else int(input()) for i in range(n)]
for i in range(n):
    l.remove(int(input())) if int(input()) in l else l.append(int(input()))
print(len(l))

Buggy submission (verdict: Runtime Error):
l = list(input())
print("Yes") if l in "9" else print("No")

Buggy submission (verdict: Runtime Error):
l = list(input().split())
print("Yes") if l in "9" else print("No")
Problem p03607 (python)

Fixed submission:
n = int(input())
l = set()
for i in range(n):
    tmp = int(input())
    l.remove(tmp) if tmp in l else l.add(tmp)
print(len(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
#l = [l.remove(int(input())) if int(input()) in l else int(input()) for i in range(n)]
for i in range(n):
    l.remove(int(input())) if int(input()) in l else l.append(int(input()))
print(len(l))