結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 19:06:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 463 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 3,737 ms
コンパイル使用メモリ 72,352 KB
実行使用メモリ 62,300 KB
最終ジャッジ日時 2023-09-08 15:20:38
合計ジャッジ時間 9,791 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 202 ms
58,624 KB
testcase_01 AC 445 ms
60,584 KB
testcase_02 AC 126 ms
55,852 KB
testcase_03 AC 126 ms
56,116 KB
testcase_04 AC 126 ms
55,928 KB
testcase_05 AC 463 ms
62,300 KB
testcase_06 AC 124 ms
55,800 KB
testcase_07 AC 125 ms
56,308 KB
testcase_08 AC 126 ms
55,740 KB
testcase_09 AC 125 ms
55,860 KB
testcase_10 AC 125 ms
55,756 KB
testcase_11 AC 125 ms
55,800 KB
testcase_12 AC 124 ms
55,732 KB
testcase_13 AC 125 ms
56,120 KB
testcase_14 AC 394 ms
60,160 KB
testcase_15 AC 285 ms
60,684 KB
testcase_16 AC 420 ms
60,020 KB
testcase_17 AC 280 ms
60,064 KB
testcase_18 AC 401 ms
59,916 KB
testcase_19 AC 372 ms
60,696 KB
testcase_20 AC 441 ms
60,664 KB
testcase_21 AC 191 ms
58,792 KB
testcase_22 AC 307 ms
60,068 KB
testcase_23 AC 431 ms
60,568 KB
testcase_24 AC 435 ms
60,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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