Submission #1990153


Source Code Expand

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

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

    s = -1
    for k in range(a+1):
        b = N-k
        if b < 0:
            print ('-1 -1 -1')
            return 
        for j in range(b+1):
            s = 10000*k+5000*j+1000*(b-j)
            if s == Y:
                print (k,j,(b-j))
                return

    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 300
Code Size 624 Byte
Status AC
Exec Time 487 ms
Memory 3316 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
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 21 ms 3316 KB
a02 AC 21 ms 3316 KB
a03 AC 21 ms 3316 KB
a04 AC 20 ms 3316 KB
b05 AC 21 ms 3316 KB
b06 AC 21 ms 3316 KB
b07 AC 21 ms 3316 KB
b08 AC 21 ms 3316 KB
b09 AC 21 ms 3316 KB
b10 AC 109 ms 3316 KB
b11 AC 487 ms 3316 KB
b12 AC 21 ms 3316 KB
b13 AC 22 ms 3316 KB
b14 AC 22 ms 3316 KB
b15 AC 477 ms 3316 KB
b16 AC 447 ms 3316 KB
b17 AC 466 ms 3316 KB
b18 AC 21 ms 3316 KB
b19 AC 23 ms 3316 KB
b20 AC 21 ms 3316 KB
b21 AC 112 ms 3316 KB
b22 AC 105 ms 3316 KB
b23 AC 469 ms 3316 KB
b24 AC 471 ms 3316 KB