Submission #3019768


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 PHP (5.6.30)
Score 300
Code Size 512 Byte
Status AC
Exec Time 579 ms
Memory 3576 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 9 ms 3576 KB
a02 AC 9 ms 3576 KB
a03 AC 9 ms 3576 KB
a04 AC 570 ms 3576 KB
b05 AC 9 ms 3576 KB
b06 AC 9 ms 3576 KB
b07 AC 9 ms 3576 KB
b08 AC 9 ms 3576 KB
b09 AC 548 ms 3576 KB
b10 AC 543 ms 3576 KB
b11 AC 549 ms 3576 KB
b12 AC 9 ms 3576 KB
b13 AC 10 ms 3576 KB
b14 AC 10 ms 3576 KB
b15 AC 554 ms 3576 KB
b16 AC 577 ms 3576 KB
b17 AC 521 ms 3576 KB
b18 AC 9 ms 3576 KB
b19 AC 12 ms 3576 KB
b20 AC 9 ms 3576 KB
b21 AC 579 ms 3576 KB
b22 AC 518 ms 3576 KB
b23 AC 533 ms 3576 KB
b24 AC 548 ms 3576 KB