Submission #1990120


Source Code Expand

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

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

    if s != 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 628 Byte
Status WA
Exec Time 605 ms
Memory 13176 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 169 ms 13176 KB
a02 AC 150 ms 12472 KB
a03 AC 152 ms 12468 KB
a04 AC 151 ms 12468 KB
b05 AC 150 ms 12472 KB
b06 AC 152 ms 12472 KB
b07 AC 148 ms 12468 KB
b08 WA 150 ms 12372 KB
b09 AC 149 ms 12472 KB
b10 AC 240 ms 12472 KB
b11 WA 150 ms 12468 KB
b12 AC 148 ms 12500 KB
b13 AC 150 ms 12472 KB
b14 AC 149 ms 12472 KB
b15 AC 605 ms 12472 KB
b16 AC 575 ms 12468 KB
b17 AC 584 ms 12472 KB
b18 AC 149 ms 12472 KB
b19 AC 150 ms 12468 KB
b20 AC 148 ms 12468 KB
b21 WA 148 ms 12472 KB
b22 AC 234 ms 12472 KB
b23 AC 594 ms 12468 KB
b24 AC 574 ms 12472 KB