結果

問題 No.509 塗りつぶしツール
ユーザー TakatenTakaten
提出日時 2017-04-29 00:10:53
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 1,326 ms
コンパイル使用メモリ 18,448 KB
実行使用メモリ 19,088 KB
最終ジャッジ日時 2023-10-11 20:41:26
合計ジャッジ時間 3,047 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,900 KB
testcase_01 AC 16 ms
18,800 KB
testcase_02 AC 15 ms
18,652 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 16 ms
18,948 KB
testcase_07 WA -
testcase_08 AC 16 ms
18,964 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
18,852 KB
testcase_15 WA -
testcase_16 AC 15 ms
18,652 KB
testcase_17 WA -
testcase_18 AC 15 ms
18,896 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 16 ms
18,876 KB
testcase_23 AC 16 ms
18,780 KB
testcase_24 AC 16 ms
18,816 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 16 ms
18,796 KB
testcase_28 AC 16 ms
18,816 KB
testcase_29 AC 15 ms
18,860 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

fscanf(STDIN, "%d", $num);
$len = strlen($num);
$retval = $len * 2 + 1;
for ($i = 0; $i < $len; $i++) {
    switch (substr($num, $i, 1)) {
        case '0':
        case '4':
        case '6':
        case '9':
            $retval += 1;
            break;
        case '8':
            $retval += 2;
            break;
        default:
            break;
    }
}

echo $retval."\n";
0