結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー bluemegane
提出日時 2018-09-28 20:09:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 621 bytes
コンパイル時間 827 ms
コンパイル使用メモリ 114,720 KB
実行使用メモリ 29,908 KB
最終ジャッジ日時 2024-10-12 05:28:46
合計ジャッジ時間 2,904 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.

ソースコード

diff #

using System.Linq;
using System;

public class P
{
    public int LvL { get; set; }
    public int c { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var ps = new P[6];
        for (int i = 0; i < 6; i++) ps[i] = new P { LvL = i };
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        for (int i = 0; i < n; i++) ps[a[i] - 1].c++;
        var ans = ps.OrderByDescending(x => x.c).ThenByDescending(x => x.LvL).First().LvL + 1;
        Console.WriteLine(ans);
    }
}
0