結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー tentententen
提出日時 2020-11-10 15:27:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 502 ms / 5,000 ms
コード長 669 bytes
コンパイル時間 2,156 ms
コンパイル使用メモリ 79,936 KB
実行使用メモリ 60,660 KB
最終ジャッジ日時 2023-09-29 23:37:13
合計ジャッジ時間 10,599 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 212 ms
59,048 KB
testcase_01 AC 476 ms
60,192 KB
testcase_02 AC 125 ms
56,040 KB
testcase_03 AC 127 ms
55,624 KB
testcase_04 AC 125 ms
55,968 KB
testcase_05 AC 502 ms
60,392 KB
testcase_06 AC 124 ms
56,108 KB
testcase_07 AC 124 ms
55,468 KB
testcase_08 AC 124 ms
54,092 KB
testcase_09 AC 124 ms
55,788 KB
testcase_10 AC 125 ms
55,440 KB
testcase_11 AC 126 ms
55,692 KB
testcase_12 AC 125 ms
55,728 KB
testcase_13 AC 124 ms
55,716 KB
testcase_14 AC 402 ms
60,496 KB
testcase_15 AC 300 ms
60,128 KB
testcase_16 AC 433 ms
60,608 KB
testcase_17 AC 312 ms
60,660 KB
testcase_18 AC 437 ms
60,260 KB
testcase_19 AC 391 ms
60,148 KB
testcase_20 AC 468 ms
60,620 KB
testcase_21 AC 202 ms
58,516 KB
testcase_22 AC 361 ms
60,220 KB
testcase_23 AC 462 ms
60,560 KB
testcase_24 AC 478 ms
60,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            map.put(x, map.getOrDefault(x, 0) + 1);
        }
        int max = 0;
        int level = 0;
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if (max <= entry.getValue()) {
                max = entry.getValue();
                level = Math.max(level, entry.getKey());
            }
        }
        System.out.println(level);
    }
}
0