結果
| 問題 | 
                            No.24 数当てゲーム
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mrc1031
                         | 
                    
| 提出日時 | 2016-10-12 13:43:12 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,345 bytes | 
| コンパイル時間 | 967 ms | 
| コンパイル使用メモリ | 110,696 KB | 
| 実行使用メモリ | 26,956 KB | 
| 最終ジャッジ日時 | 2024-11-22 02:38:53 | 
| 合計ジャッジ時間 | 1,890 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 WA * 3 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        // No.24 数当てゲーム
        var answer = new string[10];
        for (int i = 0; i <= answer.Length - 1; i++)
            answer[i] = i.ToString();
        // ターン数
        int n = int.Parse(Console.ReadLine());
        var r = new string[5];
        // ターン数分繰り返し
        for (int i = 0; i <= n - 1; i++)
        {
            r = Console.ReadLine().Split(' ');
            Array.Sort(r);
            if ("NO".Equals(r[4]))
            {
                for (int j = 0; j <= r.Length - 2; j++)
                {
                    answer[int.Parse(r[j])] = "";
                }
            }
            else
            {
                int idx = 0;
                for (int j = 0; j <= answer.Length - 1; j++)
                {
                    if (idx <= r.Length - 1 && r[idx].Equals(answer[j]))
                    {
                        idx++;
                        continue;
                    }
                    answer[j] = "";
                }
            }
        }
        for (int i = 0; i < answer.Length; i++)
        {
            if (!"".Equals(answer[i]))
            {
                Console.WriteLine(answer[i]);
                break;
            }
        }
    }
}
            
            
            
        
            
mrc1031