結果

問題 No.431 死亡フラグ
ユーザー CroweaCrowea
提出日時 2019-01-24 13:19:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 793 ms
コンパイル使用メモリ 63,788 KB
実行使用メモリ 23,636 KB
最終ジャッジ日時 2023-10-14 09:38:01
合計ジャッジ時間 2,600 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
21,492 KB
testcase_01 AC 54 ms
23,548 KB
testcase_02 AC 54 ms
19,540 KB
testcase_03 AC 55 ms
21,572 KB
testcase_04 AC 54 ms
21,540 KB
testcase_05 AC 56 ms
23,492 KB
testcase_06 AC 55 ms
23,636 KB
testcase_07 AC 54 ms
21,436 KB
testcase_08 AC 55 ms
19,396 KB
testcase_09 AC 54 ms
21,464 KB
testcase_10 AC 54 ms
23,516 KB
testcase_11 AC 53 ms
21,444 KB
testcase_12 AC 54 ms
23,488 KB
testcase_13 AC 54 ms
23,620 KB
testcase_14 AC 54 ms
21,532 KB
testcase_15 AC 53 ms
21,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    const string MSG_SURVIVED = "SURVIVED";
    const string MSG_DEAD = "DEAD";
    static void Main(string[] args)
    {
        var flags = Console.ReadLine().Split(' ');
        var survivalFlag = flags.Last();
        flags = flags.Take(3).ToArray();
        if (survivalFlag == "1") Console.WriteLine(MSG_SURVIVED);
        else if (flags.Count(x => x == "1") < 2) Console.WriteLine(MSG_SURVIVED);
        else Console.WriteLine(MSG_DEAD);
    }
}
0