Submission #1989843


Source Code Expand

<?php
fscanf(STDIN, "%d %d", $numKatana, $monsterHp);
    for($i = 0; $i < $numKatana; $i++){
        fscanf(STDIN, "%d %d", $shakeDmg, $throwDmg);
        $shakeDmgs[] = $shakeDmg;
        $throwDmgs[] = $throwDmg;
    }

    $maxShakeDmg = max($shakeDmgs);

    $bigThrowDmgs = array_filter($throwDmgs,
        function ($throwDmgs) use ($maxShakeDmg) {
            return $throwDmgs > $maxShakeDmg;
        });

    $totalThrowDmg = array_sum($bigThrowDmgs);
    $monsterHpAfterThrow = $monsterHp - $totalThrowDmg;

    $numAttack = ceil($monsterHpAfterThrow / $maxShakeDmg) + count($bigThrowDmgs);
    echo $numAttack;

Submission Info

Submission Time
Task D - Katana Thrower
User okamu
Language PHP (5.6.30)
Score 0
Code Size 643 Byte
Status WA
Exec Time 140 ms
Memory 42356 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
AC × 21
WA × 3
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 9 ms 3576 KB
b05 AC 9 ms 3576 KB
b06 AC 126 ms 32628 KB
b07 AC 9 ms 3576 KB
b08 AC 125 ms 32628 KB
b09 AC 9 ms 3576 KB
b10 AC 9 ms 3576 KB
b11 AC 9 ms 3576 KB
b12 AC 9 ms 3576 KB
b13 AC 130 ms 42356 KB
b14 WA 128 ms 42356 KB
b15 AC 115 ms 32628 KB
b16 AC 113 ms 32628 KB
b17 AC 122 ms 32628 KB
b18 AC 120 ms 32628 KB
b19 AC 130 ms 42356 KB
b20 WA 129 ms 40180 KB
b21 WA 135 ms 41972 KB
b22 AC 140 ms 42356 KB
b23 AC 9 ms 3576 KB
b24 AC 12 ms 4340 KB