結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー CroweaCrowea
提出日時 2019-01-30 15:20:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 678 bytes
コンパイル時間 1,318 ms
コンパイル使用メモリ 108,288 KB
実行使用メモリ 24,320 KB
最終ジャッジ日時 2024-04-22 18:20:56
合計ジャッジ時間 3,790 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
20,096 KB
testcase_01 AC 69 ms
24,192 KB
testcase_02 AC 33 ms
19,328 KB
testcase_03 AC 35 ms
19,200 KB
testcase_04 AC 33 ms
19,200 KB
testcase_05 AC 67 ms
24,320 KB
testcase_06 AC 35 ms
19,456 KB
testcase_07 AC 33 ms
19,200 KB
testcase_08 AC 36 ms
19,328 KB
testcase_09 AC 33 ms
19,328 KB
testcase_10 AC 35 ms
19,328 KB
testcase_11 AC 34 ms
19,328 KB
testcase_12 AC 34 ms
19,072 KB
testcase_13 AC 34 ms
19,200 KB
testcase_14 AC 54 ms
21,868 KB
testcase_15 AC 48 ms
20,992 KB
testcase_16 AC 61 ms
23,168 KB
testcase_17 AC 46 ms
20,992 KB
testcase_18 AC 60 ms
22,912 KB
testcase_19 AC 54 ms
21,820 KB
testcase_20 AC 68 ms
23,808 KB
testcase_21 AC 39 ms
19,840 KB
testcase_22 AC 49 ms
20,856 KB
testcase_23 AC 64 ms
23,808 KB
testcase_24 AC 65 ms
24,064 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;

public class Program
{
    public static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var levels = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        var map = new Dictionary<int, int>();
        foreach (var d in levels)
        {
            if (map.ContainsKey(d)) map[d]++;
            else map.Add(d, 1);
        }

        var max = map.Values.Max();
        var keys = new List<int>();
        foreach (var k in map)
            if (k.Value == max)
                keys.Add(k.Key);
        
        Console.WriteLine(keys.Max());
    }
}
0