結果

問題 No.1219 Mancala Combo
ユーザー ks2mks2m
提出日時 2020-09-04 22:04:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 2,528 ms
コンパイル使用メモリ 74,628 KB
実行使用メモリ 64,560 KB
最終ジャッジ日時 2024-05-04 22:21:46
合計ジャッジ時間 7,145 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
36,628 KB
testcase_01 AC 49 ms
37,060 KB
testcase_02 AC 48 ms
37,056 KB
testcase_03 AC 49 ms
36,912 KB
testcase_04 AC 49 ms
36,536 KB
testcase_05 AC 51 ms
36,868 KB
testcase_06 AC 49 ms
36,940 KB
testcase_07 AC 51 ms
36,988 KB
testcase_08 AC 49 ms
36,816 KB
testcase_09 AC 50 ms
36,836 KB
testcase_10 AC 50 ms
36,836 KB
testcase_11 AC 52 ms
37,092 KB
testcase_12 AC 51 ms
37,116 KB
testcase_13 AC 51 ms
36,968 KB
testcase_14 AC 50 ms
37,056 KB
testcase_15 AC 51 ms
37,008 KB
testcase_16 AC 49 ms
36,988 KB
testcase_17 AC 212 ms
51,868 KB
testcase_18 AC 214 ms
52,460 KB
testcase_19 AC 199 ms
52,308 KB
testcase_20 AC 214 ms
51,732 KB
testcase_21 AC 192 ms
50,192 KB
testcase_22 AC 198 ms
52,288 KB
testcase_23 AC 268 ms
55,712 KB
testcase_24 AC 198 ms
49,076 KB
testcase_25 AC 186 ms
51,292 KB
testcase_26 AC 204 ms
51,688 KB
testcase_27 AC 241 ms
56,364 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		int[] a = new int[n + 1];
		for (int i = 0; i < n; i++) {
			a[i + 1] = Integer.parseInt(sa[i]);
		}
		br.close();

		int cnt = 0;
		for (int i = n; i > 0; i--) {
			int s = a[i] + cnt;
			if (s % i != 0) {
				System.out.println("No");
				return;
			}
			cnt += s / i;
		}
		System.out.println("Yes");
	}
}
0