結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー MoonOnRainMoonOnRain
提出日時 2018-07-25 09:44:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 860 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 105,644 KB
実行使用メモリ 29,324 KB
最終ジャッジ日時 2023-09-07 19:33:29
合計ジャッジ時間 5,643 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
25,164 KB
testcase_01 AC 93 ms
28,304 KB
testcase_02 AC 65 ms
23,868 KB
testcase_03 AC 88 ms
20,592 KB
testcase_04 AC 87 ms
22,892 KB
testcase_05 AC 91 ms
28,016 KB
testcase_06 AC 62 ms
23,728 KB
testcase_07 AC 63 ms
21,764 KB
testcase_08 AC 84 ms
22,648 KB
testcase_09 AC 83 ms
24,748 KB
testcase_10 AC 64 ms
21,780 KB
testcase_11 AC 84 ms
24,812 KB
testcase_12 AC 83 ms
22,716 KB
testcase_13 AC 85 ms
24,768 KB
testcase_14 AC 82 ms
24,516 KB
testcase_15 AC 74 ms
25,084 KB
testcase_16 AC 87 ms
25,320 KB
testcase_17 AC 75 ms
22,944 KB
testcase_18 AC 86 ms
25,300 KB
testcase_19 AC 81 ms
26,492 KB
testcase_20 AC 92 ms
29,324 KB
testcase_21 AC 72 ms
22,004 KB
testcase_22 AC 79 ms
23,444 KB
testcase_23 AC 89 ms
27,680 KB
testcase_24 AC 91 ms
27,696 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;

namespace No79
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Int32.Parse(Console.ReadLine());
            var b = Console.ReadLine().Split(' ')
                           .GroupBy(x => x)                   // 入力の数字をキーにしてグループ化
                           .OrderByDescending(x => x.Count()) // 要素数の多い順(降順)に並び替え
                           .ThenByDescending(x => x.Key)      // 要素数が同数の場合、キーの大きい順(降順)に並び替え
                           .First()                           // 先頭のグループを取得
                           .Key;                              // キーを取得
            Console.WriteLine(b);
            Console.ReadKey();
        }
    }
}
0