結果

問題 No.24 数当てゲーム
ユーザー akichiakichi
提出日時 2017-08-08 01:27:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 1,112 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 108,568 KB
実行使用メモリ 27,036 KB
最終ジャッジ日時 2024-04-20 03:47:27
合計ジャッジ時間 1,793 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,936 KB
testcase_01 AC 23 ms
27,036 KB
testcase_02 AC 23 ms
26,868 KB
testcase_03 AC 28 ms
22,584 KB
testcase_04 AC 29 ms
26,728 KB
testcase_05 AC 27 ms
24,752 KB
testcase_06 AC 23 ms
22,832 KB
testcase_07 AC 27 ms
24,824 KB
testcase_08 AC 28 ms
24,996 KB
testcase_09 AC 26 ms
24,752 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.Collections;

    class Program {
        static void Main(string[] args) {

            int n = int.Parse(Console.ReadLine());
            List<string[]> ios = new List<string[]>();
            BitArray rts = new BitArray(n);
            for (int i = 0; i < n; i++) {
                string read = Console.ReadLine();

                string rt = read.Substring(8);
                string inStr = read.Substring(0, 7);
                string[] ins = inStr.Split(' ');
                ios.Add(ins);
                rts[i] = rt == "YES";
            }

            for (int ans = 0; ans < 10; ans++) {
                bool success = true;
                for (int j = 0; j < n; j++) {
                    if (ios[j].Contains(ans.ToString()) != rts[j]) {
                        success = false;
                        break;
                    }
                }
                if (success) {
                    Console.WriteLine(ans);
                    return;
                }
            }
        }
    }
0