結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー abcabc
提出日時 2016-11-02 11:50:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 450 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 1,873 ms
コンパイル使用メモリ 71,200 KB
実行使用メモリ 62,632 KB
最終ジャッジ日時 2023-09-08 15:01:42
合計ジャッジ時間 9,506 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 199 ms
59,288 KB
testcase_01 AC 450 ms
62,632 KB
testcase_02 AC 117 ms
56,000 KB
testcase_03 AC 120 ms
56,384 KB
testcase_04 AC 120 ms
55,960 KB
testcase_05 AC 441 ms
60,584 KB
testcase_06 AC 126 ms
55,888 KB
testcase_07 AC 124 ms
57,644 KB
testcase_08 AC 123 ms
55,800 KB
testcase_09 AC 120 ms
56,024 KB
testcase_10 AC 121 ms
55,968 KB
testcase_11 AC 121 ms
55,688 KB
testcase_12 AC 120 ms
56,328 KB
testcase_13 AC 117 ms
55,564 KB
testcase_14 AC 369 ms
59,408 KB
testcase_15 AC 303 ms
60,236 KB
testcase_16 AC 399 ms
60,408 KB
testcase_17 AC 278 ms
59,936 KB
testcase_18 AC 418 ms
58,340 KB
testcase_19 AC 362 ms
60,064 KB
testcase_20 AC 427 ms
60,684 KB
testcase_21 AC 188 ms
58,392 KB
testcase_22 AC 325 ms
60,468 KB
testcase_23 AC 423 ms
60,804 KB
testcase_24 AC 449 ms
60,640 KB
権限があれば一括ダウンロードができます

ソースコード

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