結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー はまやんはまやん
提出日時 2019-06-22 15:20:08
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 867 bytes
コンパイル時間 3,185 ms
コンパイル使用メモリ 112,144 KB
実行使用メモリ 27,268 KB
最終ジャッジ日時 2024-12-26 09:03:44
合計ジャッジ時間 5,137 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

namespace proconCSharp
{
    class Program
    {
        static int GetInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static int[] GetInts()
        {
            return Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        }

        static void Main()
        {
            var N = GetInt();
            var L = GetInts();

            var group = L.GroupBy(x => x);

            int ma = 0, ans = 0;
            foreach (var g in group)
            {
                if (ma <= g.Count())
                {
                    ma = g.Count();
                    ans = g.ElementAt(0);
                }
            }
            
            Console.WriteLine($"{ans}");
        }
    }
}
0