結果

問題 No.1219 Mancala Combo
ユーザー tentententen
提出日時 2020-09-07 08:35:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 816 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 52,844 KB
最終ジャッジ日時 2024-05-06 23:23:44
合計ジャッジ時間 13,816 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,192 KB
testcase_01 AC 130 ms
41,508 KB
testcase_02 AC 132 ms
41,032 KB
testcase_03 AC 128 ms
41,396 KB
testcase_04 AC 162 ms
41,588 KB
testcase_05 AC 145 ms
41,692 KB
testcase_06 AC 137 ms
41,360 KB
testcase_07 AC 147 ms
41,680 KB
testcase_08 AC 145 ms
41,616 KB
testcase_09 AC 116 ms
39,700 KB
testcase_10 AC 116 ms
39,828 KB
testcase_11 AC 146 ms
41,388 KB
testcase_12 AC 138 ms
41,368 KB
testcase_13 AC 147 ms
41,524 KB
testcase_14 AC 133 ms
41,240 KB
testcase_15 AC 133 ms
41,128 KB
testcase_16 AC 129 ms
41,244 KB
testcase_17 AC 637 ms
49,340 KB
testcase_18 AC 677 ms
50,772 KB
testcase_19 AC 665 ms
48,568 KB
testcase_20 AC 666 ms
50,508 KB
testcase_21 AC 593 ms
48,240 KB
testcase_22 AC 667 ms
48,848 KB
testcase_23 AC 708 ms
52,436 KB
testcase_24 AC 634 ms
48,544 KB
testcase_25 AC 634 ms
48,716 KB
testcase_26 AC 654 ms
50,544 KB
testcase_27 AC 783 ms
52,840 KB
testcase_28 AC 816 ms
52,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	int[] arr = new int[n + 2];
    	for (int i = 1; i <= n; i++) {
    	    arr[i] = sc.nextInt();
    	}
    	long[] sums = new long[n + 2];
    	for (int i = n; i >= 1; i--) {
    	    sums[i] = sums[i + 1] + arr[i];
    	    if (sums[i] % i != 0) {
    	        System.out.println("No");
    	        return;
    	    }
    	}
    	System.out.println("Yes");
   }
}
0