結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー Tsukasa_Type
提出日時 2018-02-09 19:06:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 555 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 2,892 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 47,952 KB
最終ジャッジ日時 2024-06-26 08:23:26
合計ジャッジ時間 11,445 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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