結果

問題 No.1168 Digit Sum Sequence
ユーザー hiramarihiramari
提出日時 2020-11-30 23:44:01
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 18,600 KB
実行使用メモリ 19,092 KB
最終ジャッジ日時 2023-10-11 03:12:31
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
    list($N) = explode(" ", trim(fgets(STDIN)));
    $sum = str_split($N);
    while(count($sum)!=1){
        $sum_0 = 0;
        for($i=0;$i>count($sum);$i++){
            $sum_0 += $sum[$i];
        }
        $sum = str_split($sum_0);
    }
    printf($sum[0]);
0