Submission #1990073


Source Code Expand

from bisect import bisect_left, bisect_right, insort_left, insort_right

import numpy as np

import itertools

import math 
from collections import defaultdict as dd
def main():
    N, Y = map(int, input().split())
    a = int(Y/10000)

    if a*10000 == Y:
        print (a,0,0)
        return

    ans = -1
    for k in range(a+1):
        b = N-k
        if b >= 0:
            for j in range(b+1):
                ans = 10000*k+5000*j+1000*(b-j)
                if ans == Y:
                    print (k,j,(b-j))
                    break
        if ans == Y:
            break

    if ans != Y:
        print ('-1 -1 -1')



if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission Info

Submission Time
Task C - Otoshidama
User toshh
Language Python (3.4.3)
Score 0
Code Size 755 Byte
Status WA
Exec Time 606 ms
Memory 12944 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 4
AC × 21
WA × 3
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 173 ms 12944 KB
a02 AC 148 ms 11988 KB
a03 AC 148 ms 11988 KB
a04 AC 152 ms 11988 KB
b05 AC 150 ms 11988 KB
b06 AC 148 ms 11988 KB
b07 AC 149 ms 11988 KB
b08 WA 148 ms 11988 KB
b09 AC 148 ms 11988 KB
b10 AC 240 ms 11988 KB
b11 WA 149 ms 11988 KB
b12 AC 148 ms 11988 KB
b13 AC 149 ms 11988 KB
b14 AC 150 ms 11988 KB
b15 AC 606 ms 11988 KB
b16 AC 577 ms 11988 KB
b17 AC 584 ms 11988 KB
b18 AC 149 ms 11988 KB
b19 AC 151 ms 11988 KB
b20 AC 149 ms 11988 KB
b21 WA 148 ms 11988 KB
b22 AC 235 ms 11988 KB
b23 AC 594 ms 11988 KB
b24 AC 575 ms 11988 KB