結果
問題 |
No.24 数当てゲーム
|
ユーザー |
|
提出日時 | 2019-01-31 17:21:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 710 bytes |
コンパイル時間 | 960 ms |
コンパイル使用メモリ | 112,108 KB |
実行使用メモリ | 19,328 KB |
最終ジャッジ日時 | 2024-11-16 10:25:25 |
合計ジャッジ時間 | 1,967 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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()); } }