結果

問題 No.542 1円玉と5円玉
ユーザー oga00826oga00826
提出日時 2019-06-20 13:19:43
言語 PHP
(8.3.4)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 12,392 KB
最終ジャッジ日時 2023-08-22 12:44:05
合計ジャッジ時間 1,706 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,280 KB
testcase_01 AC 7 ms
12,212 KB
testcase_02 AC 7 ms
12,280 KB
testcase_03 AC 7 ms
12,260 KB
testcase_04 AC 7 ms
12,244 KB
testcase_05 AC 7 ms
12,296 KB
testcase_06 AC 7 ms
12,324 KB
testcase_07 AC 8 ms
12,284 KB
testcase_08 AC 8 ms
12,352 KB
testcase_09 AC 7 ms
12,392 KB
testcase_10 AC 8 ms
12,300 KB
testcase_11 AC 7 ms
12,284 KB
testcase_12 AC 10 ms
12,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

list($one, $five) = explode(" ", trim(fgets(STDIN)));

$all = [];

for ($i=1; $i<=$one; $i++) {
    $all[] = $i;
}

for ($i=1; $i<=$five; $i++) {
    $all[] = $i * 5;
    for ($o=1; $o<=$one; $o++) {
        $all[] = ($i * 5) + $o;
    }
}

sort($all);
$answers = array_unique($all);

foreach ($answers as $answer) {
    echo $answer."\n";
}
0