結果

問題 No.1219 Mancala Combo
ユーザー tentententen
提出日時 2020-09-07 08:35:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 713 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 5,359 ms
コンパイル使用メモリ 71,216 KB
実行使用メモリ 65,168 KB
最終ジャッジ日時 2023-08-19 16:24:54
合計ジャッジ時間 13,193 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,628 KB
testcase_01 AC 123 ms
56,288 KB
testcase_02 AC 123 ms
55,832 KB
testcase_03 AC 123 ms
55,828 KB
testcase_04 AC 158 ms
55,584 KB
testcase_05 AC 141 ms
55,692 KB
testcase_06 AC 134 ms
55,728 KB
testcase_07 AC 140 ms
55,776 KB
testcase_08 AC 139 ms
55,704 KB
testcase_09 AC 124 ms
56,072 KB
testcase_10 AC 125 ms
55,628 KB
testcase_11 AC 141 ms
55,632 KB
testcase_12 AC 130 ms
55,688 KB
testcase_13 AC 139 ms
55,912 KB
testcase_14 AC 122 ms
55,624 KB
testcase_15 AC 123 ms
55,688 KB
testcase_16 AC 122 ms
55,604 KB
testcase_17 AC 570 ms
61,804 KB
testcase_18 AC 617 ms
62,108 KB
testcase_19 AC 547 ms
60,528 KB
testcase_20 AC 633 ms
62,432 KB
testcase_21 AC 525 ms
60,368 KB
testcase_22 AC 566 ms
61,124 KB
testcase_23 AC 658 ms
63,228 KB
testcase_24 AC 573 ms
60,952 KB
testcase_25 AC 611 ms
60,268 KB
testcase_26 AC 590 ms
61,948 KB
testcase_27 AC 701 ms
64,576 KB
testcase_28 AC 713 ms
65,168 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