結果

問題 No.1168 Digit Sum Sequence
ユーザー キョウチクキョウチク
提出日時 2022-05-19 16:46:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 4,307 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 57,680 KB
最終ジャッジ日時 2023-10-19 00:05:03
合計ジャッジ時間 10,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,060 KB
testcase_01 AC 129 ms
57,520 KB
testcase_02 AC 119 ms
56,220 KB
testcase_03 AC 139 ms
57,516 KB
testcase_04 AC 131 ms
57,496 KB
testcase_05 AC 128 ms
57,460 KB
testcase_06 AC 128 ms
57,456 KB
testcase_07 AC 129 ms
57,208 KB
testcase_08 AC 132 ms
57,476 KB
testcase_09 AC 129 ms
55,504 KB
testcase_10 AC 128 ms
57,508 KB
testcase_11 AC 129 ms
57,448 KB
testcase_12 AC 129 ms
57,392 KB
testcase_13 AC 128 ms
57,680 KB
testcase_14 AC 129 ms
57,304 KB
testcase_15 AC 129 ms
57,504 KB
testcase_16 AC 129 ms
57,276 KB
testcase_17 AC 132 ms
57,480 KB
testcase_18 AC 129 ms
57,560 KB
testcase_19 AC 130 ms
57,548 KB
testcase_20 AC 130 ms
57,408 KB
testcase_21 AC 131 ms
57,492 KB
testcase_22 AC 132 ms
57,536 KB
testcase_23 AC 130 ms
57,520 KB
testcase_24 AC 136 ms
57,448 KB
testcase_25 AC 136 ms
57,524 KB
testcase_26 AC 133 ms
57,456 KB
testcase_27 AC 131 ms
57,488 KB
testcase_28 AC 135 ms
57,424 KB
testcase_29 AC 135 ms
57,508 KB
testcase_30 AC 133 ms
57,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test11 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int n=Integer.parseInt(line[0]);
    for(int i=1;i<100;i++){
      int tmp=n;
      n=0;
      while(tmp>0){
        n+=tmp%10;
        tmp=tmp/10;
      }
    }
    String result=""+n;
    System.out.println(result);
  }
}
0