結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー TaK7907TaK7907
提出日時 2017-10-20 02:08:34
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 874 bytes
コンパイル時間 810 ms
コンパイル使用メモリ 113,540 KB
実行使用メモリ 34,504 KB
最終ジャッジ日時 2024-05-01 06:06:37
合計ジャッジ時間 2,639 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,472 KB
testcase_01 AC 47 ms
30,736 KB
testcase_02 AC 24 ms
26,700 KB
testcase_03 AC 25 ms
26,884 KB
testcase_04 AC 24 ms
24,924 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 24 ms
24,584 KB
testcase_08 AC 23 ms
24,920 KB
testcase_09 AC 24 ms
24,416 KB
testcase_10 AC 26 ms
24,752 KB
testcase_11 AC 25 ms
24,924 KB
testcase_12 AC 26 ms
26,832 KB
testcase_13 AC 26 ms
24,716 KB
testcase_14 AC 42 ms
26,588 KB
testcase_15 AC 35 ms
24,116 KB
testcase_16 AC 43 ms
27,868 KB
testcase_17 AC 33 ms
28,244 KB
testcase_18 AC 47 ms
27,824 KB
testcase_19 AC 40 ms
26,300 KB
testcase_20 AC 50 ms
32,464 KB
testcase_21 AC 30 ms
27,588 KB
testcase_22 AC 38 ms
26,368 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

public class Program {
    public static int Solver(System.IO.TextReader reader) {
        reader.ReadLine();
        var l = MyLib.GetIntListFromTextReader( reader, ' ' );
        int[] n = { 0, 0, 0, 0, 0, 0 };
        foreach (var v in l) {
            ++n[ v - 1 ];
        }
        int maxNum = n.Length - 1;
        for (var i = n.Length - 1; i != 1; --i) {
            if (n[ i - 1 ] > n[ maxNum ]) maxNum = i - 1;
        }
        return maxNum + 1;
    }

    private static void Main() {
        Console.WriteLine( Solver( Console.In ) );
    }
}

//--- MyLib ---

public class MyLib {
    public static List<int> GetIntListFromTextReader(System.IO.TextReader reader, char delimitor) {
        return reader.ReadLine().Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse );
    }
}

0