結果

問題 No.432 占い(Easy)
ユーザー tsunabittsunabit
提出日時 2019-06-08 02:24:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 607 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 3,320 ms
コンパイル使用メモリ 79,376 KB
実行使用メモリ 51,164 KB
最終ジャッジ日時 2024-04-15 19:28:31
合計ジャッジ時間 11,310 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
42,184 KB
testcase_01 AC 124 ms
41,200 KB
testcase_02 AC 148 ms
42,460 KB
testcase_03 AC 161 ms
42,652 KB
testcase_04 AC 217 ms
43,644 KB
testcase_05 AC 178 ms
42,948 KB
testcase_06 AC 140 ms
41,636 KB
testcase_07 AC 211 ms
43,268 KB
testcase_08 AC 161 ms
42,404 KB
testcase_09 AC 193 ms
42,796 KB
testcase_10 AC 245 ms
44,600 KB
testcase_11 AC 294 ms
46,904 KB
testcase_12 AC 560 ms
50,844 KB
testcase_13 AC 607 ms
51,164 KB
testcase_14 AC 313 ms
47,148 KB
testcase_15 AC 173 ms
42,588 KB
testcase_16 AC 161 ms
42,672 KB
testcase_17 AC 564 ms
50,696 KB
testcase_18 AC 462 ms
49,548 KB
testcase_19 AC 395 ms
48,028 KB
testcase_20 AC 331 ms
47,136 KB
testcase_21 AC 344 ms
46,892 KB
testcase_22 AC 255 ms
44,436 KB
testcase_23 AC 234 ms
43,748 KB
testcase_24 AC 224 ms
43,468 KB
testcase_25 AC 205 ms
42,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class No432 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner s = new Scanner(System.in);
        int t = s.nextInt();
        for(int i = 0; i < t; i++) {
        	String str = s.next();
        	while(str.length() > 1) {
        		String[] v = new String[str.length()];
        		v = str.split("");
        		str = "";
        		for(int j = 0; j < v.length-1; j++) {
        			int temp = (Integer.parseInt(v[j]) + Integer.parseInt(v[j+1]));
        			if(temp >= 10) {
        				temp = (temp / 10) + (temp % 10);
        			}
        			str = str + temp;
        		}
        	}
        	System.out.println(str);
        }
    }
}
0