結果

問題 No.431 死亡フラグ
コンテスト
ユーザー Michae'Gon
提出日時 2017-02-21 01:41:09
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,274 ms
コンパイル使用メモリ 185,548 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-04 01:47:34
合計ジャッジ時間 4,854 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fn get_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}

fn main() {
    let xs: Vec<i8> = get_line().split(' ').map(|x| x.parse().unwrap()).collect();

    let d = xs.iter().fold(-xs[3], |acc, &x| acc + x);

    println!("{}",
        if xs[3] == 1 || d < 2 {
            "SURVIVED"
        }
        else {
            "DEAD"
        }
    );
}
0