Problem p03469 (python)

Fixed submission:
S = input().split('/')

S[0] = '2018'

print('/'.join(S))

Buggy submission (verdict: Runtime Error):
in_list = input().split(' ')

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

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

eureka_flg = 0

for k in range(z+1):
    if k > N:
        break;
    elif k <= N and eureka_flg == 0:
        for j in range(y+1):
            if j > N-k:
                break;
            elif j <= N-k:
                i = ( Y -  5000*j - 1000*k ) / 10000
                if i < 0:
                    break;
                elif i == 0:
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;                 
                elif i.is_integer():
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;
    elif eureka_flg == 1:
        break;

if eureka_flg == 0:
    print('-1 -1 -1')

del in_list

Buggy submission (verdict: Runtime Error):
in_list = input().split(' ')

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

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        # print('res_y_first：', res_y_i)
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            # print('res_y_second：', res_y_j)
            # print('j：', j)
            # print('i：', i)
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

if get_answer_flg==0:
    print('-1 -1 -1')

del in_list

Buggy submission (verdict: Runtime Error):
in_list = input().split(' ')

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

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

if get_answer_flg==0:
    print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
in_list = input().split(' ')

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

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

# x + y + z = N
# Y = 10000*i + 5000*j + 1000*k
# k = ( Y - 10000*i - 5000*j ) / 1000

eureka_flg = 0

for k in range(min(z+1, N)):
    if eureka_flg == 0:
        for j in range(min(y+1, N)):
            if j > N-k:
                break;
            elif j <= N-k:
                i = ( Y -  5000*j - 1000*k ) / 10000
                # print(f'k：{k}')
                # print(f'j：{j}')
                # print(f'i：{i}')
                if i < 0:
                    break;
                elif i.is_integer() and i <= min(x+1, N-i-j):
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;
    elif eureka_flg == 1:
        break;

if eureka_flg == 0:
    print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
in_list = input().split(' ')

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

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

# x + y + z = N

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        # print('res_y_first：', res_y_i)
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            # print('res_y_second：', res_y_j)
            # print('j：', j)
            # print('i：', i)
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

if get_answer_flg==0:
    print('-1 -1 -1')