結果

問題 No.24 数当てゲーム
ユーザー CroweaCrowea
提出日時 2019-01-31 17:21:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 67 ms / 5,000 ms
コード長 710 bytes
コンパイル時間 1,017 ms
コンパイル使用メモリ 68,200 KB
実行使用メモリ 23,792 KB
最終ジャッジ日時 2023-08-10 08:46:17
合計ジャッジ時間 2,444 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
21,768 KB
testcase_01 AC 63 ms
21,652 KB
testcase_02 AC 65 ms
21,720 KB
testcase_03 AC 66 ms
23,792 KB
testcase_04 AC 66 ms
21,852 KB
testcase_05 AC 67 ms
21,740 KB
testcase_06 AC 67 ms
23,752 KB
testcase_07 AC 66 ms
21,604 KB
testcase_08 AC 64 ms
21,660 KB
testcase_09 AC 63 ms
21,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
    public static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var list = Enumerable.Range(0, 9 + 1).ToList();
        var numerics = new List<int>(4);
        var ans = string.Empty;
        var line = new string[5];
        for (var i = 0; i < n; i++)
        {
            line = Console.ReadLine().Split(' ');
            ans = line.Last();
            numerics = line.Take(4).Select(x => int.Parse(x)).ToList();
            list = (ans == "NO") ? list.Except(numerics).ToList() : list.Intersect(numerics).ToList();
        }
        Console.WriteLine(list.First());
    }
}
0