結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-20 16:19:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 74,100 KB
実行使用メモリ 59,400 KB
最終ジャッジ日時 2024-04-10 04:43:32
合計ジャッジ時間 10,833 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 523 ms
59,264 KB
testcase_02 AC 136 ms
54,112 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 562 ms
59,116 KB
testcase_06 AC 129 ms
54,152 KB
testcase_07 AC 128 ms
53,988 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 130 ms
54,200 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 436 ms
59,196 KB
testcase_15 AC 298 ms
58,684 KB
testcase_16 AC 487 ms
59,200 KB
testcase_17 AC 278 ms
58,700 KB
testcase_18 AC 482 ms
59,088 KB
testcase_19 AC 431 ms
58,940 KB
testcase_20 AC 537 ms
59,368 KB
testcase_21 AC 196 ms
56,924 KB
testcase_22 AC 333 ms
58,788 KB
testcase_23 AC 538 ms
59,400 KB
testcase_24 AC 532 ms
59,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] level = new int[7];
    for(int i = 0; i < N; i++) {
      level[sc.nextInt()]++;
    }
    int max = 0;
    for(int i = 0; i < 7; i++) {
      max = Math.max(max, level[i]);
    }
    int ans = 0;
    for(int i = 6; i >= 0; i--) {
      if(level[i] == max) ans = i;
    }
    System.out.println(ans);
  }
}
0