結果
| 問題 | No.79 過小評価ダメ・ゼッタイ |
| コンテスト | |
| ユーザー |
はまやんはまやん
|
| 提出日時 | 2019-06-22 15:22:16 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 5,000 ms |
| コード長 | 1,023 bytes |
| 記録 | |
| コンパイル時間 | 1,754 ms |
| コンパイル使用メモリ | 108,288 KB |
| 実行使用メモリ | 26,112 KB |
| 最終ジャッジ日時 | 2026-06-01 06:52:27 |
| 合計ジャッジ時間 | 3,911 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
else if (ma == g.Count() && ans < g.ElementAt(0))
{
ans = g.ElementAt(0);
}
}
Console.WriteLine($"{ans}");
}
}
}
はまやんはまやん