Submission #7027497


Source Code Expand

num = input().split()
 
n = int(num[0])
y = int(num[1])

m = 0
g = 0
s = 0

flag = False


for i in range(n+1):
    if flag:
        break
    m = i
    
    for e in range(n+1):
        if flag:
            break
        g = e
        
        me = m * 10000
        ge = g * 5000
        
        tmpS =  y - (me+ge)
        
        if (tmpS / 1000) + (m+g) == n and me+ge+tmpS == y and (tmpS / 1000) >= 0:
            flag = True
            ma = m
            ga = g
            if tmpS / 1000 > 0:
                sa = tmpS / 1000
                sa = int(sa)
            else: 
                sa = 0
if flag:
    print(ma,ga,sa)
else:
    print(-1,-1,-1)

Submission Info

Submission Time
Task A - Already 2018
User jyodai
Language Python (3.4.3)
Score 0
Code Size 705 Byte
Status RE
Exec Time 17 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
RE × 2
RE × 8
Set Name Test Cases
Sample a01, a02
All a01, a02, b03, b04, b05, b06, b07, b08
Case Name Status Exec Time Memory
a01 RE 17 ms 3064 KB
a02 RE 17 ms 3064 KB
b03 RE 17 ms 3064 KB
b04 RE 17 ms 3064 KB
b05 RE 17 ms 3064 KB
b06 RE 17 ms 3064 KB
b07 RE 17 ms 3064 KB
b08 RE 17 ms 3064 KB