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

Fixed submission:
from functools import reduce
import bisect

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # mod用
    p=10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    

    N = int(input().rstrip())
    # A = list(map(int, input().split()))
    A = list(int(_) for _ in input().split())
    # A = list(input().split())
    A.sort()
    flag = False
    if A[0] == 0 and N%2 == 1:
        flag = True
        for i in range(N):
            if A[i] != (i + 1) // 2 * 2:
                flag = False
                break
    if A[0] == 1 and N%2 == 0:
        flag = True
        for i in range(N):
            if A[i] != i // 2 * 2 + 1:
                flag = False
                break
    if flag:
        print(2**(N//2) % p)
    else:
        print(0)
        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from functools import reduce
import bisect

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # mod用
    p=10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    

    N = int(input().rstrip())
    A = list(input().split())
    A.sort()
    if(N==1 and A[0]!=str(0)):
        ans = 0
    else:
        ans = (2**(N//2)) % p
    
    if(N%2 == 1):
        c= A.pop(0)
        if c != str(0):
            print(0)
            exit()
        for i in range(0,2,N):
            if i%2 == 0 and A[i] != str(i+2):
                ans = 0
                break
            if i%2 == 1 and A[i] != str(i+1):
                ans = 0
                break      
    else:
        for i in range(0,2,N):
            if i%2 == 0 and A[i] != str(i+1):
                ans = 0
                break
            if i%2 == 1 and A[i] != str(i):
                ans = 0
                break  
    print(ans)
    
if __name__ == '__main__':
    main()
Problem p03962 (python)

Fixed submission:
import collections
from functools import reduce

def main():
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # 1文字のみを読み込み
    # s = input().rstrip()
    
    # スペース区切りで標準入力を配列として読み込み
    # s = input().rstrip().split(' ')

    # 1文字ずつ標準入力を文字列として読み込み
    # s = list(input().rstrip())
    
    # 位置文字ずつ標準入力を数値配列として読み込み
    # X = [int(_) for _ in input().split()]
    X = [int(_) for _ in input().split()]
    if X[0] == X[1] and X[0] == X[2] and X[1] == X[2]:
        ans = 1
    elif X[0] == X[1] or X[0] == X[2] or X[1] == X[2]:
        ans = 2
    else:
        ans = 3
    print(ans)


    # c = collections.Counter(X)
    # print(c.most_common()[0][1])
        
   
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import collections
from functools import reduce

def main():
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # 1文字のみを読み込み
    # s = input().rstrip()
    
    # スペース区切りで標準入力を配列として読み込み
    # s = input().rstrip().split(' ')

    # 1文字ずつ標準入力を文字列として読み込み
    # s = list(input().rstrip())
    
    # 位置文字ずつ標準入力を数値配列として読み込み
    # X = [int(_) for _ in input().split()]
    X = [int(_) for _ in input().split()]
    ans = [0 for _ in range(100)]
    for x in X:
        ans[x] = ans[x] + 1
    print(max(ans))
    # c = collections.Counter(X)
    # print(c.most_common()[0][1])
        
   
if __name__ == '__main__':
    main()
Problem p03457 (python)

Fixed submission:
n = int(input())
st, sx, sy = 0, 0, 0

is_reach = True

for i in range(0, n):
    gt, gx, gy = list(map(int, input().split()))
    t = gt - sy
    dist = abs(gx - sx) + abs(gy - sy)

    if not(t >= dist and (t - dist) % 2 == 0):
        is_reach = False
        break


if is_reach:
    print("Yes")
else:
    print("No")

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

is_reach = True

for i in range(0, n):
    gt, gx, gy = list(map(int, input().split()))
    t = gt - sy
    dist = abs(gx - sx) + abs(gy - sy)

    if not(t >= dist and (t - dist) % 2 == 0):
        is_reach = False
        break


if is_reach:
    print("Yes")
else:
    print("No")
Problem p03101 (python)

Fixed submission:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H-h) * (W-w))

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print(((H-h) * (W-w))
Problem p03308 (python)

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

print(max(nums)-min(nums))

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

print(max(nums) - min(nums))
Problem p03469 (python)

Fixed submission:
S = input()

print(S.replace('2017', '2018'))

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

S[3] = 8
print(S)
Problem p03680 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)
N = int(input())
a = [0]*(N+1)
for i in range(1, N+1):
    a[i] = int(input())

def solve(i, n):
    if n == 2:
        print(i)
    elif i == N:
        print(-1)
    else:
        return solve(i+1, a[n])

solve(0, 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = []
for _ in [0]*N:
    a.append(int(input()))

def solve(i, n):
    if n == 2:
        print(i)
    elif i == N:
        print(-1)
    else:
        return solve(i+1, a[n-1])

solve(0, 1)
Problem p03369 (python)

Fixed submission:
S = input()
print(700 + S.count('o') * 100)

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

train = min(A, B)
bus = min(C, D)
print(train + bus)
Problem p03285 (python)

Fixed submission:
N = int(input())
ans = "No"
if N%4==0:
    ans = "Yes"
for i in range(15) :
    N = N - 7
    if N < 0:
        break
    if N%4==0:
        ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
ans = "No"
for i in range(15):
    N = N-7
    print(N)
    if N <= 0:
        if N%3 == 0:
            ans="Yes"
        break
print(ans)
Problem p03219 (python)

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

s = x + y//2

print(s)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
s = X + Y/2
print(s)
Problem p03060 (python)

Fixed submission:
n = int(input())
values = [ int(x) for x in input().split() ]
cost = [ int(x) for x in input().split() ]
profit_list = [ values[i] - cost[i] for i in range(n) if values[i] > cost[i] ]
print(sum(profit_list))

Buggy submission (verdict: Runtime Error):
n = int(input())
values = [ int(x) for x in range(n) ]
cost = [ int(x) for x in range(n) ]
profit_list = [ value[i] - cost[i] for i in range(n) if value[i] > cost[i] ]
print(sum(profit_list))
Problem p03102 (python)

Fixed submission:
N,M,C = map(int,input().split())
B = [int(x) for x in input().split()]
 
count = 0
for i in range(N):
  temp = [int(x) for x in input().split()]
  total = [B[i]*temp[i] for i in range(M)]
  if((sum(total) + C) > 0 ):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = [int(x) for x in input().split()]

count = 0
for i in range(N):
  temp = [int(x) for x in input().split()]
  total = [B[i]*temp[i] for i in range(M)]
  if(total > 0 ):
    count+=1
Problem p03280 (python)

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

print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in range(1, N + 1):
    if i % 2 == 1:
        count = 0
        for j in range(1, i + 1, 2):
            if i % j == 0:
                count += 1
        if count == 8:
            ans += 1

print(ans)
Problem p03288 (python)

Fixed submission:
R = int(input())

if R<1200:
    print("ABC")
elif R<2800:
    print("ARC")
else :
    print("AGC")

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

if R<1200:
    print("ABC")
if R<2800 and R>1200:
    print("ARC")
if R>2800:
    print("AGC"
Problem p03060 (python)

Fixed submission:
N = int(input())
V_array = [int(V_i_str) for V_i_str in input().split()]
C_array = [int(C_i_str) for C_i_str in input().split()]
ans = sum([max(0, V_array[i] - C_array[i]) for i in range(N)])
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
V_array = [int(input()) for _ in range(N)]
ans = [max(0, V_i - int(input())) for V_i in V_array]
Problem p03220 (python)

Fixed submission:
import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

main()

Buggy submission (verdict: Runtime Error):
import sys
def solve(a,b,lst_ab):
    li = [abs(b-(a-(i*0.006))) for i in lst_ab]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return print(answer)

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2
 
def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03308 (python)

Fixed submission:
import sys

def solve(n, lst_a):
    a=lst_a[0]
    b=lst_a[0]
    [0]
    for i in lst_a:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def solve(n, lst_a):
    a=1
    b=1    
    for i in as1:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03323 (python)

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if a>8 or b>8:
        answer=':('
    else:
        answer='Yay!'
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def solve(a, b):
    if a == 0 or a==1 or a==2:
        if b==100:
            answer=100**a*b+(1**a)
        else:
            answer=100**a*b
    return answer

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if 1<a and a<9:
        if 1<b and b<9:
            answer='yay!'
        else:
            answer=':('
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03324 (python)

Fixed submission:
import sys

def solve(a, b):
    if a == 0 or a==1 or a==2:
        if b==100:
            answer=100**a*b+(100**a)
        else:
            answer=100**a*b
    return answer

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if a==0:
        answer = atr(range(b))
    else:
        answer = (100*a*b)
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p04043 (python)

Fixed submission:
import sys

def solve(a,b,c):
    li = [a,b,c]
    cf = 0
    cs = 0
    for i in li:
        if int(i) == 5:
            cf +=1
        if int(i) == 7:
            cs +=1
    if cf == 2 and cs ==1:
        return 'YES'
    else:
        return 'NO'
            
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def solve(a,b,c):
    li = [a,b,c]
    cf = 0
    cs = 0
    for i in li:
        if i == 5:
            cf +=1
        if i==7:
            cs +=1
    if cf == 2 and cs ==1:
        return YES
    else:
        return NO
            
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03060 (python)

Fixed submission:
num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

Buggy submission (verdict: Runtime Error):
num = input()
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans=0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

Buggy submission (verdict: Runtime Error):
num = input()
value = [int(n) for n in input().split()]
cost = [int(n) for n in input().split()]

ans=0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]

print(ans)
Problem p03067 (python)

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

if (a<=c and c <= b) or (b<=c and c <= a):
    print('Yes')
else:
    print('No')

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

post = ''
ans=0
data=[]

left=[]
right=[]

tmp=0
for i in range(n):
    if s[i]=='#':
        tmp+=1
    elif tmp!= 0:
        left.append(tmp)
        tmp=0


tmp=0
for i in range(n):
    if s[n-i-1]=='.':
        tmp+=1
    if n-i-1-1 >=0 and s[n-i-1-1]=="#" and tmp!=0:
        right.append(tmp)
        tmp=0

right.reverse()
# print(s)
# print(left)
# print(right)

for i in range(len(left)):
    if i == len(left)-1:
        ans+=min(left[i],right[i])
        break
    l = left[i]
    r = right[i]
    if l >= r:
        ans+=r
        left[i+1]=l+r+left[i+1]
    else:
        ans+=l


print(ans)
Problem p03071 (python)

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

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)

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

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)X
Problem p03076 (python)

Fixed submission:
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(m)
    else:
        mod_list.append(10)
min_ = min(mod_list)
# print(mod_list)



print(sum(time_list2)-(10-min_))

Buggy submission (verdict: Runtime Error):
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(10-m)
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)

Buggy submission (verdict: Runtime Error):
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    time_list2.append(x+(10-m))
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(10-m)
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)
Problem p03194 (python)

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

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


# print('(n, p) is ({}, {})'.format(n, p))
list = factorize(p)
# print(list)



ans = 1
for b, e in list:
    # print(b, e)
    tmp = e // n
    # print('b // n is', tmp )
    if tmp !=0:
        for i in range(tmp):
            ans*=b

print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

n, p = map(int, input().split())

list = sympy.factorint(p)

# print(list)

ans = 1
for b, e in list.items():
    tmp = e // n
    if tmp!=0:
        ans*=b

print(ans)
Problem p03061 (python)

Fixed submission:
import numpy as np

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

l = [0]*n
r = [0]*n

for i in range(1,n):
    l[i]=gcd(l[i-1],s[i-1])

tmp = list(range(0,n-1))
tmp.reverse()
for i in tmp:
    r[i]=gcd(r[i+1],s[i+1])
    
m = list([])

for i in range(n):
    m.append(gcd(l[i],r[i]))

print(max(m))

Buggy submission (verdict: Runtime Error):
import copy

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

if n>2:
    memo = list([])

    for k in range(n):
        t = copy.copy(s_all)
        t.pop(k)

        c = gcd(t[0], t[1])

        for i in s:
            c = gcd(c,i)

        memo.append(c)

    print(max(memo))

if n==2:
    print(max(s_all))

Buggy submission (verdict: Runtime Error):
import math
import copy

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

if n>2:
    memo = list([])

    for k in range(n):
        t = copy.copy(s_all)
        t.pop(k)

        c = math.gcd(t[0], t[1])

        for i in s:
            c = math.gcd(c,i)

        memo.append(c)

    print(max(memo))

if n==2:
    print(max(s_all))
Problem p03457 (python)

Fixed submission:
n = int(input())

p = [None]*n

for i in range(n):
    p[i] = list(map(int,input().split()))

plan = [[0,0,0]]
plan.extend(p)

for i in range(n):
    diff = [plan[i+1][k] - plan[i][k] for k in range(len(plan[0]))]
    if (abs(diff[1])+abs(diff[2]))>diff[0] or (diff[0]-(abs(diff[1])+abs(diff[2])))%2==1:
        print('No')
        exit()

print('Yes')

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

p = [None]*n

for i in range(n):
    p[i] = list(map(int,input().split()))

plan = [[0,0,0]]
plan.extend(p)

print('plan')
print(plan)

for i in range(n+1):
    diff = [plan[i+1][k] - plan[i][k] for k in range(len(plan[0]))]
    print(diff)
    if abs(diff[1])+abs(diff[2])>diff[0]:
        print('No')
        break
    elif (diff[0]-(abs(diff[1])+abs(diff[2])))%2==1:
        print('No')
        break
    elif i==n-1:
        print('YES')
Problem p03471 (python)

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

def f(n,y):
    for i in range(n+1):
        for j in range(n-i+1):
            s = 10000*i + 5000*j + 1000*(n-i-j)
            if s == y:
                return '{0} {1} {2}'.format(i,j,n-i-j)

    return '-1 -1 -1'

print(f(n,y))

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

def f(n,y):
    for i in range(n):
        for j in range(n-i):
            s = 10000*i + 5000*j + 1000*(n-i-j)
            if s == y:
                return '{0} {1} {2}'.format(i,j,k)

    return '-1 -1 -1'

print(f(n,y))

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

def f(n,y):
    for i in range(n):
        for j in range(n-i):
            s = 10000*i + 5000*j + 1000*(n-i-j)
            if s == y:
                return [i, j, k]

    return [-1, -1, -1]

print(f(n,y))
Problem p03493 (python)

Fixed submission:
a = list(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()))

c = list()

for n in range(N):
    for i in range(1,31):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))
Problem p03494 (python)

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

c = list()

for n in range(N):
    for i in range(1,31):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))

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

c = list()

for n in range(N):
    for i in range(1,30):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))