結果

問題 No.1219 Mancala Combo
ユーザー Strorkis
提出日時 2020-09-13 16:03:15
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 16,573 ms
コンパイル使用メモリ 400,660 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-13 00:08:05
合計ジャッジ時間 17,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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<i32> = {
        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 i32 + 1) == 0 {
            sum += (a[i] + sum) / (i as i32 + 1);
        } else {
            return println!("No");
        }
    }
    println!("Yes");
}
0