結果

問題 No.24 数当てゲーム
ユーザー k-a-rgbk-a-rgb
提出日時 2023-10-06 14:29:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 1,307 bytes
コンパイル時間 6,331 ms
コンパイル使用メモリ 104,532 KB
実行使用メモリ 23,548 KB
最終ジャッジ日時 2023-10-06 14:29:59
合計ジャッジ時間 3,713 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,424 KB
testcase_01 AC 58 ms
21,560 KB
testcase_02 AC 57 ms
21,552 KB
testcase_03 AC 59 ms
21,484 KB
testcase_04 AC 57 ms
21,364 KB
testcase_05 AC 58 ms
23,540 KB
testcase_06 AC 57 ms
21,440 KB
testcase_07 AC 58 ms
21,424 KB
testcase_08 AC 58 ms
23,548 KB
testcase_09 AC 58 ms
21,628 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;


namespace PracticeAtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
			//024的宛ゲーム
			//0~9のbool配列 質問毎にtlueの掛け算 最後に残ったTlueが答え
			bool[] boA = new bool[]{true,true,true,true,true,true,true,true,true,true};
			///Console.WriteLine(boA[0]);
			
			string sA = Console.ReadLine();
			int x = int.Parse(sA);
			String sB;
			string[] t;
			
			var result = false;
			
			for(int i = 0; i<x;i++){
				sB = Console.ReadLine();
				t = sB.Split(' ');
				//Console.WriteLine(t[4]);
			
				if(t[4]=="YES"){
				//	Console.WriteLine("YES");
					for(int j= 0; j<10;j++){
						//4つの数字をおなじ配列をfalse化
						result = t.Contains(j.ToString());
						if(result){
						
						}else{
								boA[j] = false;							
						}
					}
				}else if(t[4]=="NO"){
					//Console.WriteLine("NO");
					for(int j= 0; j<10;j++){
						//4つの数字をおなじ配列をfalse化
											
						result = t.Contains(j.ToString());
						if(result){
								boA[j] = false;							
						}
					}
					
					
				}else{
				//	Console.WriteLine("??");
				
				}
			}
			
			int z = Array.IndexOf(boA,true);
			Console.WriteLine(z);
			
		}
    }
}
0