結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ooh_25ooh_25
提出日時 2017-06-05 12:10:12
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 877 bytes
コンパイル時間 1,181 ms
コンパイル使用メモリ 110,764 KB
実行使用メモリ 30,156 KB
最終ジャッジ日時 2023-10-22 05:31:10
合計ジャッジ時間 2,757 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
25,976 KB
testcase_01 AC 54 ms
30,132 KB
testcase_02 AC 29 ms
25,448 KB
testcase_03 AC 29 ms
25,448 KB
testcase_04 AC 29 ms
25,448 KB
testcase_05 AC 56 ms
30,156 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 29 ms
25,448 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 29 ms
25,448 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 46 ms
26,796 KB
testcase_15 AC 39 ms
26,640 KB
testcase_16 AC 50 ms
27,548 KB
testcase_17 AC 39 ms
26,600 KB
testcase_18 AC 49 ms
27,488 KB
testcase_19 AC 45 ms
26,756 KB
testcase_20 AC 56 ms
30,156 KB
testcase_21 AC 33 ms
25,888 KB
testcase_22 AC 41 ms
26,604 KB
testcase_23 AC 54 ms
30,000 KB
testcase_24 AC 55 ms
30,076 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 lecture
{
    class Program
    {
        public static void Main(String[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
      
            int [] counts= new int[N];
         
            for (int i = 0; i < L.Length; i++)
            {
                int j = L[i];
                counts[j]++;

            }
            int max = 0;
            int index = 0;

            for (int i = L.Length-1; i >= 1; i--)
            {
                if(max < counts[i]){
                    max = counts[i];
                    index = i;
                }
            }
           
            Console.WriteLine(index);
        }
    }
}
0