結果

問題 No.431 死亡フラグ
ユーザー NoNo
提出日時 2016-10-14 22:26:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 898 bytes
コンパイル時間 5,088 ms
コンパイル使用メモリ 104,008 KB
実行使用メモリ 22,780 KB
最終ジャッジ日時 2023-08-14 10:56:31
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,880 KB
testcase_01 AC 47 ms
22,780 KB
testcase_02 AC 47 ms
20,740 KB
testcase_03 AC 48 ms
20,712 KB
testcase_04 AC 47 ms
20,836 KB
testcase_05 AC 48 ms
20,708 KB
testcase_06 AC 47 ms
20,836 KB
testcase_07 AC 46 ms
20,828 KB
testcase_08 AC 46 ms
18,836 KB
testcase_09 AC 47 ms
20,868 KB
testcase_10 AC 46 ms
18,904 KB
testcase_11 AC 46 ms
20,744 KB
testcase_12 AC 48 ms
20,728 KB
testcase_13 AC 51 ms
20,876 KB
testcase_14 AC 48 ms
20,736 KB
testcase_15 AC 47 ms
20,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukikoda
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = ConvertStringArrayToIntArray(Console.ReadLine().Split());

            if (a[3] == 1)
            {
                Console.WriteLine("SURVIVED");
                return;
            }

            int cnt = 0;

            if (a[0] == 1) cnt++;
            if (a[1] == 1) cnt++;
            if (a[2] == 1) cnt++;

            if (cnt >= 2)
            {
                Console.WriteLine("DEAD");
            }else
            {
                Console.WriteLine("SURVIVED");
            }


        }

        static int[] ConvertStringArrayToIntArray(string[] array)
        {
            return Array.ConvertAll(array, str => int.Parse(str));
        }
    }
}
0