結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー abc
提出日時 2016-11-02 11:50:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 605 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 2,187 ms
コンパイル使用メモリ 74,736 KB
実行使用メモリ 48,080 KB
最終ジャッジ日時 2024-06-26 08:05:35
合計ジャッジ時間 11,020 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numUsers = sc.nextInt();
        int[] levelsCount = new int[6];

        for (int i = 0; i < numUsers; i++) {
            levelsCount[sc.nextInt() - 1]++;
        }

        int max = 0;
        int level = 0;

        for (int i = 0; i < levelsCount.length; i++) {

            if (levelsCount[i] >= max) {

                max = levelsCount[i];
                level = i + 1;

            }

        }

        System.out.println(level);

    }

}
0