結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2020-09-13 16:11:01 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 628 bytes |
| コンパイル時間 | 27,918 ms |
| コンパイル使用メモリ | 379,124 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-13 00:27:49 |
| 合計ジャッジ時間 | 14,302 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
fn main() {
let n: usize = {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
buf.trim_end().parse().unwrap()
};
let a: Vec<i64> = {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
let iter = buf.split_whitespace();
iter.map(|x| x.parse().unwrap()).collect()
};
let mut sum = 0;
for i in (0..n).rev() {
if (a[i] + sum) % (i as i64 + 1) == 0 {
sum += (a[i] + sum) / (i as i64 + 1);
} else {
return println!("No");
}
}
println!("Yes");
}
Strorkis