結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-03-03 20:15:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 449 ms / 5,000 ms
コード長 541 bytes
コンパイル時間 2,459 ms
コンパイル使用メモリ 71,676 KB
実行使用メモリ 60,820 KB
最終ジャッジ日時 2023-09-08 14:47:50
合計ジャッジ時間 9,762 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
58,884 KB
testcase_01 AC 428 ms
60,764 KB
testcase_02 AC 120 ms
55,876 KB
testcase_03 AC 121 ms
55,792 KB
testcase_04 AC 120 ms
56,244 KB
testcase_05 AC 449 ms
60,572 KB
testcase_06 AC 120 ms
56,136 KB
testcase_07 AC 120 ms
55,712 KB
testcase_08 AC 120 ms
56,180 KB
testcase_09 AC 122 ms
56,068 KB
testcase_10 AC 120 ms
56,192 KB
testcase_11 AC 117 ms
55,756 KB
testcase_12 AC 119 ms
55,844 KB
testcase_13 AC 120 ms
56,140 KB
testcase_14 AC 377 ms
60,820 KB
testcase_15 AC 279 ms
60,252 KB
testcase_16 AC 404 ms
60,392 KB
testcase_17 AC 271 ms
60,212 KB
testcase_18 AC 402 ms
60,444 KB
testcase_19 AC 358 ms
59,804 KB
testcase_20 AC 432 ms
60,776 KB
testcase_21 AC 186 ms
58,748 KB
testcase_22 AC 331 ms
60,296 KB
testcase_23 AC 423 ms
60,368 KB
testcase_24 AC 440 ms
60,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int max = -1;
        int maxIndex = 0;
        int[] count = new int[6];
        for(int i=0; i<n; i++) {
            count[in.nextInt()-1]++;
        }

        for(int i=0; i<6; i++) {
            if(count[i] >= max) {
                max = count[i];
                maxIndex = i+1;
            }
        }

        System.out.println(maxIndex);
    }
}
0