結果

問題 No.24 数当てゲーム
ユーザー mbanmban
提出日時 2016-11-04 16:56:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 1,082 bytes
コンパイル時間 2,130 ms
コンパイル使用メモリ 104,332 KB
実行使用メモリ 23,808 KB
最終ジャッジ日時 2023-08-16 13:46:18
合計ジャッジ時間 3,484 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,536 KB
testcase_01 AC 59 ms
21,700 KB
testcase_02 AC 58 ms
21,704 KB
testcase_03 AC 58 ms
21,560 KB
testcase_04 AC 58 ms
21,652 KB
testcase_05 AC 59 ms
21,612 KB
testcase_06 AC 58 ms
23,660 KB
testcase_07 AC 59 ms
23,808 KB
testcase_08 AC 59 ms
21,496 KB
testcase_09 AC 58 ms
23,696 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;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        bool[] A = new bool[10];
        for(int i = 0; i < N; i++)
        {
            string[] s = Console.ReadLine().Split(' ');
            if (s[4] == "NO")
            {
                for(int j = 0; j < 4; j++)
                {
                    A[int.Parse(s[j])] = true;
                }
            }
            else
            {

                bool[] q = (new bool[10]).Select(ss => true).ToArray();
                for(int j = 0; j < 4; j++)
                {
                    q[int.Parse(s[j])] = false;
                }
                for(int j = 0; j < 10; j++)
                {
                    A[j] |= q[j];
                }
            }
        }
        int e = 0;
        for(int i = 0; i < 10; i++)
        {
            if (!A[i])
            {
                e = i;
            }
        }
        Console.WriteLine(e);
    }
}
0