結果

問題 No.432 占い(Easy)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 02:32:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 559 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 1,983 ms
コンパイル使用メモリ 75,240 KB
実行使用メモリ 64,184 KB
最終ジャッジ日時 2023-08-17 07:14:24
合計ジャッジ時間 9,947 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
56,684 KB
testcase_01 AC 114 ms
55,984 KB
testcase_02 AC 144 ms
57,212 KB
testcase_03 AC 151 ms
57,304 KB
testcase_04 AC 207 ms
59,564 KB
testcase_05 AC 157 ms
57,060 KB
testcase_06 AC 126 ms
55,856 KB
testcase_07 AC 192 ms
57,844 KB
testcase_08 AC 156 ms
57,244 KB
testcase_09 AC 201 ms
56,904 KB
testcase_10 AC 250 ms
61,000 KB
testcase_11 AC 297 ms
60,508 KB
testcase_12 AC 549 ms
63,952 KB
testcase_13 AC 559 ms
63,812 KB
testcase_14 AC 295 ms
60,092 KB
testcase_15 AC 159 ms
57,108 KB
testcase_16 AC 158 ms
56,816 KB
testcase_17 AC 530 ms
64,184 KB
testcase_18 AC 447 ms
62,372 KB
testcase_19 AC 392 ms
60,924 KB
testcase_20 AC 316 ms
60,800 KB
testcase_21 AC 321 ms
60,576 KB
testcase_22 AC 252 ms
59,996 KB
testcase_23 AC 252 ms
60,272 KB
testcase_24 AC 228 ms
57,124 KB
testcase_25 AC 202 ms
56,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        for(int i=0; i<N; i++){
            String S = sc.next();
            while( S.length()!=1 ){
                String [] arr = S.split("");
                S="";
                for(int j=1; j<arr.length; j++){
                    int r = Integer.parseInt(arr[j-1]) + Integer.parseInt(arr[j]);
                    if(r>=10){
                        r=r/10+r%10;
                    }
                    S=S+r;
                }
            }
            System.out.println(S);
        }
    }
}
0