Submission #5028981


Source Code Expand

N, Y = map(int, input().split())
x, y, z = -1, -1, -1

for a in range(N+1):
    for b in range(N+1-a):
        c = N-a-b
        if 10000*a + 5000*b + 1000*c == Y:
            x, y, z = a, b, c
            break

print(x, y, z)

Submission Info

Submission Time
Task C - Otoshidama
User tooncots
Language Python (3.4.3)
Score 300
Code Size 237 Byte
Status AC
Exec Time 780 ms
Memory 3188 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 17 ms 3060 KB
a02 AC 17 ms 2940 KB
a03 AC 203 ms 3188 KB
a04 AC 759 ms 2940 KB
b05 AC 17 ms 3060 KB
b06 AC 17 ms 2940 KB
b07 AC 17 ms 2940 KB
b08 AC 712 ms 2940 KB
b09 AC 711 ms 2940 KB
b10 AC 766 ms 2940 KB
b11 AC 780 ms 2940 KB
b12 AC 766 ms 2940 KB
b13 AC 701 ms 3060 KB
b14 AC 678 ms 2940 KB
b15 AC 764 ms 3060 KB
b16 AC 710 ms 2940 KB
b17 AC 677 ms 3060 KB
b18 AC 17 ms 2940 KB
b19 AC 21 ms 2940 KB
b20 AC 656 ms 3060 KB
b21 AC 711 ms 2940 KB
b22 AC 680 ms 2940 KB
b23 AC 739 ms 3060 KB
b24 AC 659 ms 2940 KB