結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー SuunnSuunn
提出日時 2018-11-20 06:02:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 385 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 2,213 ms
コンパイル使用メモリ 71,696 KB
実行使用メモリ 60,928 KB
最終ジャッジ日時 2023-08-26 02:11:46
合計ジャッジ時間 8,476 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 182 ms
59,384 KB
testcase_01 AC 371 ms
60,556 KB
testcase_02 AC 108 ms
55,852 KB
testcase_03 AC 104 ms
55,892 KB
testcase_04 AC 105 ms
56,312 KB
testcase_05 AC 385 ms
60,540 KB
testcase_06 AC 106 ms
55,996 KB
testcase_07 AC 108 ms
56,152 KB
testcase_08 AC 105 ms
56,320 KB
testcase_09 AC 103 ms
55,844 KB
testcase_10 AC 107 ms
56,344 KB
testcase_11 AC 102 ms
55,796 KB
testcase_12 AC 103 ms
55,780 KB
testcase_13 AC 107 ms
56,072 KB
testcase_14 AC 314 ms
60,080 KB
testcase_15 AC 250 ms
59,908 KB
testcase_16 AC 347 ms
60,440 KB
testcase_17 AC 246 ms
60,144 KB
testcase_18 AC 344 ms
60,356 KB
testcase_19 AC 328 ms
60,348 KB
testcase_20 AC 363 ms
60,928 KB
testcase_21 AC 166 ms
58,404 KB
testcase_22 AC 271 ms
60,164 KB
testcase_23 AC 361 ms
60,436 KB
testcase_24 AC 381 ms
60,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

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