結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー TatsuDX
提出日時 2016-09-08 23:44:05
言語 Java
(openjdk 23)
結果
AC  
実行時間 593 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 4,265 ms
コンパイル使用メモリ 75,028 KB
実行使用メモリ 48,036 KB
最終ジャッジ日時 2024-06-26 08:03:35
合計ジャッジ時間 12,536 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), max = 0, t;
		int[] m = new int[7];
		for(int i = 0; i < n; i++){
			t = sc.nextInt();
			m[t]++;
			max = Math.max(max, m[t]);
		}
		for(int i = 6; i > 0; i--){
			if(m[i] == max){
				System.out.println(i);
				return;
			}
		}
	}
}
0