結果

問題 No.24 数当てゲーム
ユーザー the10hoursthe10hours
提出日時 2015-07-21 00:08:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 1,216 bytes
コンパイル時間 2,584 ms
コンパイル使用メモリ 105,152 KB
実行使用メモリ 22,856 KB
最終ジャッジ日時 2023-09-22 20:48:47
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,604 KB
testcase_01 AC 56 ms
22,648 KB
testcase_02 AC 57 ms
20,608 KB
testcase_03 AC 58 ms
20,808 KB
testcase_04 AC 58 ms
20,608 KB
testcase_05 AC 57 ms
20,632 KB
testcase_06 AC 57 ms
20,720 KB
testcase_07 AC 57 ms
22,856 KB
testcase_08 AC 56 ms
22,580 KB
testcase_09 AC 56 ms
22,728 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;
using System.Text;

class yc2
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int temp;
        int[] ary = {0,1,2,3,4,5,6,7,8,9};
        int[] temps = new int[4];
        string[] str1;

        for (int i = 0; i < N; i++)
        {
            str1 = Console.ReadLine().Split();

            if (str1[4] == "NO")
            {
                for (int j = 0; j < 4; j++)
                {
                    temp = int.Parse(str1[j]);
                    ary[temp] = -1;
                }
            }
            else
            {
                for (int j = 0; j < 4; j++)
                {
                    temps[j] = int.Parse(str1[j]);
                }

                for (int j = 0; j < 10; j++)
                {
                    if (ary[j] != temps[0] && ary[j] != temps[1] &&
                        ary[j] != temps[2] && ary[j] != temps[3])
                    {
                        ary[j] = -1;
                    }
                }
            }
        }
        for (int i = 0; i < 10; i++)
        {
            if (ary[i] != -1) Console.WriteLine(ary[i]);
        }
    }
}
0