結果

問題 No.432 占い(Easy)
ユーザー hermione17hermione17
提出日時 2016-10-14 22:40:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 3,660 ms
コンパイル使用メモリ 72,072 KB
実行使用メモリ 56,968 KB
最終ジャッジ日時 2023-08-14 11:16:10
合計ジャッジ時間 8,857 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,144 KB
testcase_01 AC 128 ms
55,208 KB
testcase_02 AC 124 ms
55,716 KB
testcase_03 AC 125 ms
55,904 KB
testcase_04 AC 121 ms
55,476 KB
testcase_05 AC 124 ms
55,488 KB
testcase_06 AC 139 ms
55,532 KB
testcase_07 AC 124 ms
55,280 KB
testcase_08 AC 126 ms
55,604 KB
testcase_09 AC 217 ms
56,968 KB
testcase_10 AC 140 ms
55,556 KB
testcase_11 AC 129 ms
55,404 KB
testcase_12 AC 155 ms
56,244 KB
testcase_13 AC 152 ms
56,408 KB
testcase_14 AC 130 ms
55,712 KB
testcase_15 AC 124 ms
54,128 KB
testcase_16 AC 125 ms
55,868 KB
testcase_17 AC 152 ms
56,136 KB
testcase_18 AC 151 ms
56,352 KB
testcase_19 AC 152 ms
55,892 KB
testcase_20 AC 134 ms
55,640 KB
testcase_21 AC 131 ms
55,524 KB
testcase_22 AC 148 ms
55,752 KB
testcase_23 AC 164 ms
55,636 KB
testcase_24 AC 213 ms
56,564 KB
testcase_25 AC 214 ms
56,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintStream;
import java.util.Scanner;


public class Y432 {
	Y432() throws Exception {
		Scanner in = new Scanner(System.in);
		PrintStream out = new PrintStream(System.out);
		
		int t = in.nextInt();
		
		for (int tt = 0; tt < t; tt++) {
			char[] s = in.next().toCharArray();
			int n = s.length;
			for (int i=n; i>1; i--) {
				for (int j=0; j < i - 1; j++) {
					int g = (int)s[j] - (int)'0' + (int)s[j+1] - (int)'0';
					g = g / 10 + g % 10;
					s[j] = (char)(g + '0');
				}
			}
			out.println(s[0]);
		}

	}

	public static void main(String argv[]) throws Exception {
		new Y432();
	}
}
0