結果

問題 No.24 数当てゲーム
ユーザー aaaaaaaaaaaaaa
提出日時 2022-05-30 09:49:00
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,498 bytes
コンパイル時間 870 ms
コンパイル使用メモリ 106,816 KB
実行使用メモリ 24,244 KB
最終ジャッジ日時 2023-10-21 00:17:50
合計ジャッジ時間 1,816 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,212 KB
testcase_01 AC 25 ms
24,212 KB
testcase_02 AC 25 ms
24,212 KB
testcase_03 WA -
testcase_04 AC 25 ms
24,212 KB
testcase_05 AC 26 ms
24,212 KB
testcase_06 AC 25 ms
24,212 KB
testcase_07 AC 26 ms
24,212 KB
testcase_08 AC 25 ms
24,212 KB
testcase_09 AC 26 ms
24,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[] n = new int[10];
            int b = 0;
            int ans = 0;
            int a = int.Parse(Console.ReadLine());
            
            for (int i = 0; i < 10; i++)
            {
                n[i] = 0;
            }

            for (int i = 0; i < a; i++)
            {
                string[] s = Console.ReadLine().Split(' ');
                for (int x = 0; x <=a+1; x++)
                {
                    if (x <= 3)
                    {
                        b = int.Parse(s[x]);
                    }
                    
                    for (int z = 0; z < 10; z++)
                    {
                        if (s[4] == "NO")
                        {
                            if (b == z)
                            {
                                n[z]--;
                            }
                        }else if (s[4] == "YES")
                        {
                            if (b == z)
                            {
                                n[z]++;
                            }
                        }
                    }
                }
            }
            for (int t = 1; t <= 9; t++)
                {

                    if (n[ans] <= n[t])
                    {
                        ans = t;
                    }
                }
            Console.WriteLine(ans);

        }
    }

}
0