結果
| 問題 | 
                            No.431 死亡フラグ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-02-21 01:41:09 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 420 bytes | 
| コンパイル時間 | 16,733 ms | 
| コンパイル使用メモリ | 378,548 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-30 11:55:03 | 
| 合計ジャッジ時間 | 18,006 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 16 | 
ソースコード
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"
        }
    );
}