Submission #3019771


Source Code Expand

<?php

list($num, $total) = explode(" ", trim(fgets(STDIN)));

CONST MAN   = 10000;
CONST GOSEN = 5000;
CONST SEN   = 1000;


$find = false;
for($i = 0; $i <= $num; $i++)
{
    for ($j = 0; $j <= $num - $i; $j++)
    {
        if(($i * MAN) + ($j * GOSEN) + (($num - $i - $j) * SEN) == $total)
        {
            $k = ($num - $i - $j);
            echo "{$i} {$j} {$k}";
            $find = true;
            break 2;
        }
    }
}
if(!$find)
{
    echo "-1 -1 -1";
}
echo "\n";

Submission Info

Submission Time
Task ABC085C - Otoshidama
User fukuyamacode
Language PHP7 (7.0.15)
Score 300
Code Size 512 Byte
Status AC
Exec Time 367 ms
Memory 4856 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 11 ms 4856 KB
a02 AC 9 ms 4604 KB
a03 AC 9 ms 4604 KB
a04 AC 364 ms 4604 KB
b05 AC 9 ms 4604 KB
b06 AC 9 ms 4604 KB
b07 AC 9 ms 4604 KB
b08 AC 9 ms 4604 KB
b09 AC 363 ms 4604 KB
b10 AC 359 ms 4604 KB
b11 AC 363 ms 4732 KB
b12 AC 9 ms 4604 KB
b13 AC 10 ms 4604 KB
b14 AC 10 ms 4604 KB
b15 AC 357 ms 4604 KB
b16 AC 335 ms 4604 KB
b17 AC 346 ms 4604 KB
b18 AC 9 ms 4604 KB
b19 AC 11 ms 4604 KB
b20 AC 9 ms 4604 KB
b21 AC 356 ms 4604 KB
b22 AC 367 ms 4604 KB
b23 AC 351 ms 4604 KB
b24 AC 334 ms 4604 KB