結果

問題 No.432 占い(Easy)
ユーザー fal_rndfal_rnd
提出日時 2016-11-11 22:14:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 3,210 ms
コンパイル使用メモリ 72,828 KB
実行使用メモリ 57,548 KB
最終ジャッジ日時 2023-08-16 18:42:36
合計ジャッジ時間 8,320 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,364 KB
testcase_01 AC 118 ms
55,856 KB
testcase_02 AC 117 ms
55,808 KB
testcase_03 AC 119 ms
56,176 KB
testcase_04 AC 118 ms
56,112 KB
testcase_05 AC 121 ms
55,884 KB
testcase_06 AC 133 ms
55,836 KB
testcase_07 AC 120 ms
55,900 KB
testcase_08 AC 119 ms
55,888 KB
testcase_09 AC 212 ms
56,636 KB
testcase_10 AC 135 ms
56,036 KB
testcase_11 AC 128 ms
55,836 KB
testcase_12 AC 136 ms
56,076 KB
testcase_13 AC 135 ms
54,024 KB
testcase_14 AC 128 ms
55,792 KB
testcase_15 AC 123 ms
55,760 KB
testcase_16 AC 121 ms
55,872 KB
testcase_17 AC 136 ms
55,988 KB
testcase_18 AC 161 ms
56,184 KB
testcase_19 AC 160 ms
56,404 KB
testcase_20 AC 129 ms
55,784 KB
testcase_21 AC 127 ms
55,868 KB
testcase_22 AC 146 ms
55,936 KB
testcase_23 AC 184 ms
56,788 KB
testcase_24 AC 207 ms
57,548 KB
testcase_25 AC 217 ms
57,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class B{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		int[] b = new int[1000];
		int end,buf;
		s.next();
		while(s.hasNext()){
			String in = s.next();
			for(int i=0; i<in.length(); i++) {
				b[i] = Integer.parseInt(String.valueOf(in.charAt(i)));
			}
			end = in.length();
			while(end!=1) {
				for(int i=0; i<end-1; i++) {
					buf = b[i]+b[i+1];
					b[i]=buf%10+buf/10;
				}
				end--;
			}
			System.out.println(b[0]);
		}
	}
}
0