結果

問題 No.1168 Digit Sum Sequence
ユーザー KisaragiEffectiveKisaragiEffective
提出日時 2020-11-06 19:27:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 611 bytes
コンパイル時間 5,082 ms
コンパイル使用メモリ 75,692 KB
実行使用メモリ 56,416 KB
最終ジャッジ日時 2023-09-29 17:51:37
合計ジャッジ時間 9,857 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,168 KB
testcase_01 AC 123 ms
56,172 KB
testcase_02 AC 123 ms
55,976 KB
testcase_03 AC 125 ms
55,656 KB
testcase_04 AC 127 ms
55,760 KB
testcase_05 AC 123 ms
56,052 KB
testcase_06 AC 124 ms
56,068 KB
testcase_07 AC 124 ms
55,848 KB
testcase_08 AC 124 ms
56,340 KB
testcase_09 AC 131 ms
55,588 KB
testcase_10 AC 129 ms
55,868 KB
testcase_11 AC 127 ms
56,264 KB
testcase_12 AC 124 ms
55,628 KB
testcase_13 AC 125 ms
56,352 KB
testcase_14 AC 123 ms
56,284 KB
testcase_15 AC 123 ms
56,412 KB
testcase_16 AC 124 ms
56,000 KB
testcase_17 AC 133 ms
56,040 KB
testcase_18 AC 133 ms
56,088 KB
testcase_19 AC 132 ms
55,608 KB
testcase_20 AC 123 ms
56,416 KB
testcase_21 AC 128 ms
55,944 KB
testcase_22 AC 124 ms
55,836 KB
testcase_23 AC 127 ms
56,220 KB
testcase_24 AC 127 ms
56,192 KB
testcase_25 AC 126 ms
55,936 KB
testcase_26 AC 129 ms
56,104 KB
testcase_27 AC 127 ms
55,448 KB
testcase_28 AC 127 ms
55,624 KB
testcase_29 AC 126 ms
56,240 KB
testcase_30 AC 125 ms
56,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 多分もう少し簡単な方法が存在する
import java.util.Scanner;
import java.util.stream.IntStream;

public class x {
    public static void main(String[] args) {
        System.out.println(
                IntStream.iterate(
                        new Scanner(System.in).nextInt(), p ->
                                (p + "")
                                        .chars()
                                        .map(x -> x - '0')
                                        .sum()
                )
                        .limit(101L)
                        .toArray()[100]
        );
    }
}
0