結果

問題 No.24 数当てゲーム
ユーザー takosama312takosama312
提出日時 2016-01-31 20:42:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 1,510 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 106,464 KB
実行使用メモリ 24,052 KB
最終ジャッジ日時 2023-10-21 18:24:00
合計ジャッジ時間 1,740 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,052 KB
testcase_01 AC 25 ms
24,052 KB
testcase_02 AC 25 ms
24,052 KB
testcase_03 AC 25 ms
24,052 KB
testcase_04 AC 25 ms
24,052 KB
testcase_05 AC 25 ms
24,052 KB
testcase_06 AC 25 ms
24,052 KB
testcase_07 AC 26 ms
24,052 KB
testcase_08 AC 26 ms
24,052 KB
testcase_09 AC 26 ms
24,052 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 N
{
    class P
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] a;
            int a0 = 0;
            int a1 = 0;
            int a2 = 0;
            int a3 = 0;

            bool[] Ans = new bool[10] ;


            for(int i=0;i<N;i++)
            {
                a= Console.ReadLine().Split();
                if(a[4]=="NO")
                {
                    Ans[int.Parse(a[0])] = true;
                    Ans[int.Parse(a[1])] = true;
                    Ans[int.Parse(a[2])] = true;
                    Ans[int.Parse(a[3])] = true;
                 }
                else
                {
                    for(int j=0;j<10;j++)
                    {
                        a0 = int.Parse(a[0]);
                        a1 = int.Parse(a[1]);
                        a2 = int.Parse(a[2]);
                        a3 = int.Parse(a[3]);
                        if (!(j==a0||j==a1||j==a2||j==a3))
                        {
                            Ans[j] = true;
                        }
                    }
                }
            }
            for(int i=0;i<10;i++)
            {
                if(!Ans[i])
                {
                    Console.WriteLine(i);
                    break;
                }
            }
            Console.ReadKey();

        }
    }
}
0