結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 17:59:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 449 ms / 5,000 ms
コード長 420 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 72,360 KB
実行使用メモリ 60,800 KB
最終ジャッジ日時 2023-10-11 12:43:45
合計ジャッジ時間 9,689 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 200 ms
59,112 KB
testcase_01 AC 435 ms
60,312 KB
testcase_02 AC 121 ms
56,116 KB
testcase_03 AC 122 ms
55,692 KB
testcase_04 AC 122 ms
56,132 KB
testcase_05 AC 449 ms
60,748 KB
testcase_06 AC 122 ms
55,976 KB
testcase_07 AC 121 ms
55,940 KB
testcase_08 AC 122 ms
55,976 KB
testcase_09 AC 122 ms
56,180 KB
testcase_10 AC 120 ms
55,768 KB
testcase_11 AC 120 ms
55,828 KB
testcase_12 AC 119 ms
55,948 KB
testcase_13 AC 122 ms
56,164 KB
testcase_14 AC 357 ms
60,800 KB
testcase_15 AC 279 ms
60,388 KB
testcase_16 AC 408 ms
60,628 KB
testcase_17 AC 282 ms
59,952 KB
testcase_18 AC 405 ms
60,616 KB
testcase_19 AC 358 ms
60,440 KB
testcase_20 AC 435 ms
60,520 KB
testcase_21 AC 189 ms
58,760 KB
testcase_22 AC 298 ms
60,128 KB
testcase_23 AC 447 ms
60,684 KB
testcase_24 AC 424 ms
60,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int[] ar = new int[6];
		for (int i=0; i<n; i++) ar[sc.nextInt()-1]++;
		int max = Integer.MIN_VALUE;
		for (int i=0; i<6; i++) {
			max = Math.max(max, ar[i]);
		}
		for (int i=5; i>=0; i--) {
			if (ar[i] == max) {
				System.out.println(i+1); return;
			}
		}
		
	}
}
0