結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー dyechidyechi
提出日時 2019-03-29 10:53:59
言語 PHP
(8.3.4)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 396 bytes
コンパイル時間 3,013 ms
コンパイル使用メモリ 30,612 KB
実行使用メモリ 30,944 KB
最終ジャッジ日時 2024-04-24 15:30:41
合計ジャッジ時間 2,670 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
30,644 KB
testcase_01 AC 41 ms
30,492 KB
testcase_02 AC 41 ms
30,752 KB
testcase_03 AC 41 ms
30,944 KB
testcase_04 AC 40 ms
30,684 KB
testcase_05 AC 42 ms
30,764 KB
testcase_06 AC 40 ms
30,652 KB
testcase_07 AC 41 ms
30,740 KB
testcase_08 AC 40 ms
30,580 KB
testcase_09 AC 40 ms
30,448 KB
testcase_10 AC 41 ms
30,524 KB
testcase_11 AC 40 ms
30,764 KB
testcase_12 AC 41 ms
30,732 KB
testcase_13 AC 40 ms
30,664 KB
testcase_14 AC 41 ms
30,808 KB
testcase_15 AC 40 ms
30,856 KB
testcase_16 AC 42 ms
30,628 KB
testcase_17 AC 40 ms
30,880 KB
testcase_18 AC 40 ms
30,556 KB
testcase_19 AC 41 ms
30,880 KB
testcase_20 AC 41 ms
30,836 KB
testcase_21 AC 40 ms
30,708 KB
testcase_22 AC 41 ms
30,740 KB
testcase_23 AC 40 ms
30,700 KB
testcase_24 AC 40 ms
30,404 KB
testcase_25 AC 41 ms
30,572 KB
testcase_26 AC 40 ms
30,664 KB
testcase_27 AC 40 ms
30,796 KB
testcase_28 AC 41 ms
30,728 KB
testcase_29 AC 40 ms
30,760 KB
testcase_30 AC 41 ms
30,452 KB
testcase_31 AC 41 ms
30,644 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$s = trim(fgets(STDIN));
$s = explode(" ", $s);

$counter = 0;
for ($i=0; $i<5; $i++) {
    if ($s[$i] % 3 == 0 && $s[$i] % 5 == 0) {
        $counter += 8;
    } elseif ($s[$i] % 3 == 0 && $s[$i] % 5 != 0) {
        $counter += 4;
    } elseif ($s[$i] % 3 != 0 && $s[$i] % 5 == 0) {
        $counter += 4;
    } else {
        $counter += strlen($s[$i]);
    }
}
echo $counter.PHP_EOL;
?>
0