結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー YukimotoPG
提出日時 2019-02-14 17:58:02
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 420 bytes
コンパイル時間 2,265 ms
コンパイル使用メモリ 74,176 KB
実行使用メモリ 61,012 KB
最終ジャッジ日時 2024-09-13 11:31:54
合計ジャッジ時間 10,879 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 5 WA * 1 RE * 16
権限があれば一括ダウンロードができます

ソースコード

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<n; 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