結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー curryudon08curryudon08
提出日時 2020-06-19 14:55:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 717 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 107,168 KB
実行使用メモリ 28,408 KB
最終ジャッジ日時 2023-09-16 12:50:51
合計ジャッジ時間 5,538 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
22,168 KB
testcase_01 AC 101 ms
26,412 KB
testcase_02 AC 64 ms
19,604 KB
testcase_03 AC 64 ms
21,660 KB
testcase_04 AC 64 ms
21,664 KB
testcase_05 AC 97 ms
24,388 KB
testcase_06 AC 64 ms
23,800 KB
testcase_07 AC 62 ms
19,720 KB
testcase_08 AC 65 ms
21,780 KB
testcase_09 AC 62 ms
23,752 KB
testcase_10 AC 62 ms
21,668 KB
testcase_11 AC 64 ms
21,848 KB
testcase_12 AC 65 ms
21,712 KB
testcase_13 AC 64 ms
21,684 KB
testcase_14 AC 89 ms
23,064 KB
testcase_15 AC 78 ms
24,624 KB
testcase_16 AC 92 ms
23,832 KB
testcase_17 AC 77 ms
22,640 KB
testcase_18 AC 92 ms
23,876 KB
testcase_19 AC 86 ms
22,888 KB
testcase_20 AC 100 ms
28,408 KB
testcase_21 AC 73 ms
22,040 KB
testcase_22 AC 82 ms
22,640 KB
testcase_23 AC 98 ms
26,332 KB
testcase_24 AC 100 ms
26,376 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;

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

            var d = new Dictionary<int,int>();
            for(var i = 0; i < n; i++){
                var t = l[i];
                if(d.ContainsKey(t)){
                    d[t] += 1;
                }else{
                    d.Add(t,1);
                }
            }
            var m = d.OrderByDescending(x => x.Value).ThenByDescending(x => x.Key).First();
            Console.WriteLine(m.Key);
        }
    }
}
0