結果

問題 No.24 数当てゲーム
ユーザー CroweaCrowea
提出日時 2019-01-31 17:21:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 710 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 114,652 KB
実行使用メモリ 27,472 KB
最終ジャッジ日時 2024-04-28 02:14:11
合計ジャッジ時間 2,419 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
27,464 KB
testcase_01 AC 28 ms
25,392 KB
testcase_02 AC 28 ms
27,468 KB
testcase_03 AC 30 ms
27,472 KB
testcase_04 AC 29 ms
25,552 KB
testcase_05 AC 29 ms
25,532 KB
testcase_06 AC 29 ms
27,344 KB
testcase_07 AC 27 ms
25,144 KB
testcase_08 AC 27 ms
25,292 KB
testcase_09 AC 28 ms
27,312 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;

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