結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ooh_21ooh_21
提出日時 2017-06-01 11:31:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 106 ms / 5,000 ms
コード長 1,048 bytes
コンパイル時間 2,101 ms
コンパイル使用メモリ 106,684 KB
実行使用メモリ 28,504 KB
最終ジャッジ日時 2023-09-08 15:09:33
合計ジャッジ時間 5,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
20,036 KB
testcase_01 AC 103 ms
26,344 KB
testcase_02 AC 61 ms
21,668 KB
testcase_03 AC 61 ms
23,624 KB
testcase_04 AC 61 ms
21,764 KB
testcase_05 AC 103 ms
28,504 KB
testcase_06 AC 59 ms
23,784 KB
testcase_07 AC 60 ms
23,804 KB
testcase_08 AC 60 ms
21,588 KB
testcase_09 AC 61 ms
23,660 KB
testcase_10 AC 62 ms
23,608 KB
testcase_11 AC 61 ms
21,728 KB
testcase_12 AC 61 ms
21,720 KB
testcase_13 AC 61 ms
21,652 KB
testcase_14 AC 90 ms
25,004 KB
testcase_15 AC 77 ms
22,600 KB
testcase_16 AC 96 ms
21,800 KB
testcase_17 AC 76 ms
20,404 KB
testcase_18 AC 95 ms
23,764 KB
testcase_19 AC 87 ms
20,796 KB
testcase_20 AC 106 ms
26,264 KB
testcase_21 AC 68 ms
21,772 KB
testcase_22 AC 81 ms
22,596 KB
testcase_23 AC 102 ms
26,084 KB
testcase_24 AC 104 ms
26,236 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pj9
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();

            Array.Sort(L);
            Array.Reverse(L);

            int exL = L[0];
            int bestlevel = L[0];

            int count = 0;
            int maxcount = 0;

            for(int i = 1;i < N;i++)
            {
                if (exL == L[i])
                {
                    count++;
                    if(maxcount < count)
                    {
                        bestlevel = L[i];
                        maxcount = count;
                    }
                }
                else
                {
                    exL = L[i];
                    count = 0;
                }
            }

            Console.WriteLine(bestlevel);
        }
    }
}
0