結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2020-09-04 22:06:20 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 302 ms / 2,000 ms |
| コード長 | 619 bytes |
| コンパイル時間 | 2,064 ms |
| コンパイル使用メモリ | 72,432 KB |
| 実行使用メモリ | 55,976 KB |
| 最終ジャッジ日時 | 2024-11-26 12:55:09 |
| 合計ジャッジ時間 | 6,832 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
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();
long cnt = 0;
for (int i = n; i > 0; i--) {
long s = a[i] + cnt;
if (s % i != 0) {
System.out.println("No");
return;
}
cnt += s / i;
}
System.out.println("Yes");
}
}
ks2m