結果
問題 |
No.1219 Mancala Combo
|
ユーザー |
![]() |
提出日時 | 2020-09-07 08:35:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 807 ms / 2,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 2,326 ms |
コンパイル使用メモリ | 74,744 KB |
実行使用メモリ | 53,084 KB |
最終ジャッジ日時 | 2024-11-29 10:14:53 |
合計ジャッジ時間 | 13,675 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
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"); } }