結果
問題 | No.79 過小評価ダメ・ゼッタイ |
ユーザー |
|
提出日時 | 2019-01-30 15:20:20 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 67 ms / 5,000 ms |
コード長 | 678 bytes |
コンパイル時間 | 974 ms |
コンパイル使用メモリ | 109,620 KB |
実行使用メモリ | 24,192 KB |
最終ジャッジ日時 | 2024-10-14 17:31:56 |
合計ジャッジ時間 | 3,070 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; public class Program { public static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var levels = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); var map = new Dictionary<int, int>(); foreach (var d in levels) { if (map.ContainsKey(d)) map[d]++; else map.Add(d, 1); } var max = map.Values.Max(); var keys = new List<int>(); foreach (var k in map) if (k.Value == max) keys.Add(k.Key); Console.WriteLine(keys.Max()); } }