結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー nanophoto12nanophoto12
提出日時 2014-11-28 00:01:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 99 ms / 5,000 ms
コード長 1,031 bytes
コンパイル時間 3,663 ms
コンパイル使用メモリ 105,064 KB
実行使用メモリ 26,568 KB
最終ジャッジ日時 2023-09-08 14:08:20
合計ジャッジ時間 6,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
21,936 KB
testcase_01 AC 96 ms
26,312 KB
testcase_02 AC 64 ms
21,660 KB
testcase_03 AC 63 ms
23,656 KB
testcase_04 AC 63 ms
21,800 KB
testcase_05 AC 97 ms
26,308 KB
testcase_06 AC 62 ms
21,600 KB
testcase_07 AC 65 ms
23,532 KB
testcase_08 AC 67 ms
21,620 KB
testcase_09 AC 66 ms
21,672 KB
testcase_10 AC 65 ms
21,660 KB
testcase_11 AC 63 ms
23,780 KB
testcase_12 AC 64 ms
21,596 KB
testcase_13 AC 62 ms
19,632 KB
testcase_14 AC 85 ms
23,004 KB
testcase_15 AC 76 ms
22,492 KB
testcase_16 AC 90 ms
25,920 KB
testcase_17 AC 79 ms
22,436 KB
testcase_18 AC 94 ms
23,996 KB
testcase_19 AC 87 ms
22,896 KB
testcase_20 AC 99 ms
26,568 KB
testcase_21 AC 73 ms
22,036 KB
testcase_22 AC 82 ms
22,516 KB
testcase_23 AC 98 ms
26,208 KB
testcase_24 AC 98 ms
26,400 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;

class Probram79
{
    public static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var dictionary = new Dictionary<int, int>();
        for (int i = 0; i < n; i++)
        {
            int level = array[i];
            if (dictionary.ContainsKey(level))
            {
                dictionary[level]++;
            }
            else
            {
                dictionary.Add(level,1);
            }
        }
        var keys = dictionary.Keys.ToArray();
        var values = dictionary.Values.ToArray();
        var max = values.Max();
        int maxValue = int.MinValue;
        for (int i = 0; i < keys.Length; i++)
        {
            if (values[i] == max)
            {
                maxValue = Math.Max(maxValue, keys[i]);
            }
        }
        Console.WriteLine(maxValue);
    }
}
0