結果

問題 No.24 数当てゲーム
ユーザー laneguelanegue
提出日時 2020-04-02 04:47:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 1,303 ms
コンパイル使用メモリ 65,520 KB
実行使用メモリ 22,760 KB
最終ジャッジ日時 2023-09-10 00:50:11
合計ジャッジ時間 3,524 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
20,616 KB
testcase_01 AC 63 ms
20,592 KB
testcase_02 AC 64 ms
20,660 KB
testcase_03 AC 62 ms
20,608 KB
testcase_04 AC 62 ms
20,700 KB
testcase_05 AC 62 ms
22,760 KB
testcase_06 AC 62 ms
20,688 KB
testcase_07 AC 60 ms
20,696 KB
testcase_08 AC 61 ms
20,728 KB
testcase_09 AC 62 ms
22,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
public class Program
{
	static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		bool[] numbers = new bool[10];
		for (int i = 0; i < numbers.Length; i++)
		{
			numbers[i] = true;
		}
		for (int i = 0; i < N; i++)
		{
			string[] inputs = Console.ReadLine().Split(' ');
			int[] n = new int[4];
			for (int j = 0; j < 4; j++)
			{
				n[j] = int.Parse(inputs[j]);
			}
			if (inputs[4] == "YES")
			{
				for (int j = 0; j < 10; j++){
					if (! Array.Exists(n, e => e == j))
					{
						numbers[j] = false;
					}
				}
			}
			else
			{
				for (int j = 0; j < 4; j++){
					numbers[n[j]] = false;
				}
			}
			Console.Error.WriteLine(String.Concat(numbers));
		}
		Console.WriteLine(Array.FindIndex(numbers, e => e));
	}
}
0