結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー phsplsphspls
提出日時 2020-03-27 00:01:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 5,000 ms
コード長 557 bytes
コンパイル時間 6,494 ms
コンパイル使用メモリ 105,816 KB
実行使用メモリ 28,352 KB
最終ジャッジ日時 2023-08-30 15:54:26
合計ジャッジ時間 10,294 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
21,972 KB
testcase_01 AC 101 ms
26,348 KB
testcase_02 AC 67 ms
21,600 KB
testcase_03 AC 68 ms
23,796 KB
testcase_04 AC 68 ms
21,676 KB
testcase_05 AC 100 ms
26,412 KB
testcase_06 AC 66 ms
21,676 KB
testcase_07 AC 66 ms
21,724 KB
testcase_08 AC 68 ms
21,724 KB
testcase_09 AC 68 ms
23,824 KB
testcase_10 AC 68 ms
21,752 KB
testcase_11 AC 69 ms
23,724 KB
testcase_12 AC 69 ms
23,840 KB
testcase_13 AC 72 ms
23,772 KB
testcase_14 AC 91 ms
25,168 KB
testcase_15 AC 81 ms
22,580 KB
testcase_16 AC 94 ms
25,948 KB
testcase_17 AC 82 ms
22,640 KB
testcase_18 AC 93 ms
23,852 KB
testcase_19 AC 88 ms
23,068 KB
testcase_20 AC 102 ms
26,580 KB
testcase_21 AC 76 ms
24,056 KB
testcase_22 AC 83 ms
22,844 KB
testcase_23 AC 99 ms
28,332 KB
testcase_24 AC 100 ms
28,352 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;
using System.Collections.Generic;

public class P0079 {
    public static void Main() {
        var n = int.Parse(Console.ReadLine().Trim());
        var dict = new Dictionary<int, int>();
        foreach(int i in Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList()) {
            dict[i] = dict.GetValueOrDefault(i) + 1;
        }
        var entries = dict.AsEnumerable().ToList();
        Console.WriteLine(entries.OrderByDescending(pair => pair.Value).ThenByDescending(pair => pair.Key).First().Key);
    }
}
0