結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2017-12-15 09:48:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 5,000 ms |
コード長 | 1,619 bytes |
コンパイル時間 | 850 ms |
コンパイル使用メモリ | 104,576 KB |
実行使用メモリ | 18,048 KB |
最終ジャッジ日時 | 2024-12-14 15:54:31 |
合計ジャッジ時間 | 1,650 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; using System.Collections.Generic; class Program { static void Main() { int N = int.Parse(Console.ReadLine()); var ans = new List<int>() { 0,1,2,3,4,5,6,7,8,9 }; var New = new List<int>(); var x = new List<int>(); var y = new List<int>(); for(int i=0;i<N;i++){ string[] Pre = Console.ReadLine().Split(' '); for(int s = 0;s < 4;s++){ if(Pre[4] == "YES"){ x.Add(int.Parse(Pre[s])); }else if(Pre[4] == "NO"){ y.Add(int.Parse(Pre[s])); } } if(x.Count == 4){ foreach(int a in ans) { if (0 <= x.IndexOf(a) && !New.Contains(a)) { New.Add(a); } } ans = New; x = new List<int>(); New = new List<int>(); }else if(y.Count == 4){ foreach(int b in ans) { if(y.IndexOf(b)<0) { New.Add(b); } } ans = New; y = new List<int>(); New = new List<int>(); } } foreach(int c in ans){ Console.Write(c); } } }