結果
問題 | No.1219 Mancala Combo |
ユーザー |
![]() |
提出日時 | 2020-09-04 22:04:48 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 3,071 ms |
コンパイル使用メモリ | 73,584 KB |
実行使用メモリ | 55,836 KB |
最終ジャッジ日時 | 2024-11-26 12:53:33 |
合計ジャッジ時間 | 7,326 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 1 |
ソースコード
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"); } }