Submission #3237812


Source Code Expand

x=-1
y=-1
z=-1
flag=0
N,Y=map(int,input().split())
for i in range(Y//10000+1):
  if i > N:
    continue
  else:
    a=Y-10000*i
    for j in range(a//5000+1):
      if i+j>N:
        continue
      else:
        b=a-5000*j
        if b/1000+i+j==N:
          x=i
          y=j
          z=b//1000
          flag=1
          break
        else:
          continue
    
    if flag:
      break
print(x,y,z)

Submission Info

Submission Time
Task C - Otoshidama
User ottotto
Language Python (3.4.3)
Score 300
Code Size 431 Byte
Status AC
Exec Time 1378 ms
Memory 3064 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 3064 KB
a02 AC 17 ms 3064 KB
a03 AC 17 ms 3060 KB
a04 AC 1378 ms 3064 KB
b05 AC 17 ms 3064 KB
b06 AC 17 ms 3060 KB
b07 AC 17 ms 3060 KB
b08 AC 17 ms 3064 KB
b09 AC 1275 ms 3064 KB
b10 AC 36 ms 3060 KB
b11 AC 1142 ms 3064 KB
b12 AC 17 ms 3060 KB
b13 AC 17 ms 3060 KB
b14 AC 18 ms 3060 KB
b15 AC 1341 ms 3064 KB
b16 AC 1160 ms 3064 KB
b17 AC 1232 ms 3064 KB
b18 AC 17 ms 3060 KB
b19 AC 23 ms 3064 KB
b20 AC 18 ms 3064 KB
b21 AC 38 ms 3064 KB
b22 AC 35 ms 3060 KB
b23 AC 1270 ms 3064 KB
b24 AC 1129 ms 3060 KB