結果

問題 No.431 死亡フラグ
コンテスト
ユーザー Michae'Gon
提出日時 2017-02-21 01:41:09
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
+ 783µs
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,778 ms
コンパイル使用メモリ 188,796 KB
実行使用メモリ 9,828 KB
最終ジャッジ日時 2026-10-09 15:30:13
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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