結果

問題 No.24 数当てゲーム
ユーザー swdamdrswdamdr
提出日時 2017-01-24 16:48:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,077 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 103,248 KB
実行使用メモリ 22,760 KB
最終ジャッジ日時 2023-08-24 21:51:33
合計ジャッジ時間 3,601 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
22,708 KB
testcase_01 AC 57 ms
20,624 KB
testcase_02 AC 58 ms
22,760 KB
testcase_03 AC 57 ms
20,636 KB
testcase_04 WA -
testcase_05 AC 57 ms
20,712 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        int[] b = new int[10];
        for (int i = 0; i < 10; i++)
        {
            b[i] = 0;
        }
        string ans = "";

        for (int i = 0; i < n; i++)
        {
            string[] s = Console.ReadLine().Split(' ');

            if (s[4] == "YES")
            {
                for (int j = 0; j < 4; j++)
                {
                    if (b[int.Parse(s[j])] == 1)
                    {
                        ans = s[j];
                    }
                    else
                    {
                        b[int.Parse(s[j])] = 1;
                    }
                }
            }
            else
            {
                for (int j = 0; j < 4; j++)
                {
                    b[int.Parse(s[j])] = -1;
                }
            }
        }

        if (ans == "")
        {
            ans = Array.IndexOf(b, 0).ToString();
        }

        Console.WriteLine(ans);
    }
}
0