結果

問題 No.24 数当てゲーム
ユーザー kmtrc130kmtrc130
提出日時 2017-04-25 10:39:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 605 bytes
コンパイル時間 4,840 ms
コンパイル使用メモリ 102,304 KB
実行使用メモリ 23,752 KB
最終ジャッジ日時 2023-10-11 09:14:55
合計ジャッジ時間 5,300 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,680 KB
testcase_01 AC 60 ms
23,660 KB
testcase_02 AC 60 ms
21,604 KB
testcase_03 AC 60 ms
19,556 KB
testcase_04 AC 59 ms
23,676 KB
testcase_05 AC 61 ms
23,752 KB
testcase_06 AC 59 ms
21,712 KB
testcase_07 AC 58 ms
21,544 KB
testcase_08 AC 57 ms
21,604 KB
testcase_09 AC 58 ms
21,884 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.Linq;

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        string[] ABCDR;

        int[] chk = new int[10];

        for (int i = 0; i < N; i++)
        {
            ABCDR = Console.ReadLine().Split(' ').ToArray();

            for (int j = 0; j < ABCDR.Length - 1; j++)
            {
                if ("YES".Equals(ABCDR[ABCDR.Length - 1])) chk[int.Parse(ABCDR[j])]++;
                else chk[int.Parse(ABCDR[j])] = -1;
            }
        }

        Console.WriteLine(Array.IndexOf(chk, chk.Max()));
    }
}
0