結果

問題 No.24 数当てゲーム
ユーザー TDTD
提出日時 2022-05-27 15:11:42
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 3,105 bytes
コンパイル時間 808 ms
コンパイル使用メモリ 109,528 KB
実行使用メモリ 24,152 KB
最終ジャッジ日時 2023-10-20 19:41:39
合計ジャッジ時間 1,707 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,152 KB
testcase_01 AC 25 ms
24,152 KB
testcase_02 AC 25 ms
24,152 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            string[] b = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
            string[] c = new string[b.Length];
            string[,] s1 = new string[a, 5];
            string ans="";
            for (int i = 0; i < a; i++)//入力
            {
                string[] s = Console.ReadLine().Split(' ');
                
                for (int j = 0; j <= 4; j++)
                {
                    s1[i, j] = s[j];
                }
            }

            for (int x=0;x<a;x++)//文字列の長さ分足す
            {
                if (s1[x, 4] == "YES")//YESの時
                {
                    for (int y = 0; y <= 3; y++)
                    {
                        for (int z = 0; z < 9; z++)
                        {

                            if (s1[x, y] == b[z])
                            {
                                if (c[z] == "c")
                                {
                                    c[z] = "d";
                                }
                                else
                                {
                                    c[z] = "c";
                                    break;
                                }

                            }
                        }

                    }

                }
                else//NOの時
                {
                    for (int y = 0; y <= 3; y++)
                    {
                        for (int z = 0; z < 9; z++)
                        {
                            if (s1[x, y] == b[z])
                            {
                                c[z] = "c";
                                break;
                            }
                        }

                    }
  
                }
                    if (x == a - 1)
                    {
                    int count = 0;
                    for (int t = 0; t < a - 1; t++)
                    {
                        if (s1[t, 4] == "YES")//YESの時
                        {
                            count++;
                        }
                    }

                    if (count >= 1)
                    {
                        for (int s = 0; s < c.Length; s++)
                        {
                            if (c[s] == "d")
                            {
                                ans += b[s];
                            }
                        }
                        Console.WriteLine(ans);
                    }
                    else
                    {
                        for (int s = 0; s < c.Length; s++)
                        {
                            if (c[s] == null)
                            {
                                ans += b[s];
                            }
                        }
                        Console.WriteLine(ans);
                    }

                    }
                }

            }
        }

    }
0