結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー kano_town
提出日時 2014-11-28 00:15:34
言語 Java
(openjdk 23)
結果
AC  
実行時間 560 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 3,466 ms
コンパイル使用メモリ 77,344 KB
実行使用メモリ 48,100 KB
最終ジャッジ日時 2024-06-26 07:16:05
合計ジャッジ時間 12,082 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder79 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), max = -1, maxIndex = 0;
		int[] count = new int[6];
		for (int i = 0; i < N; i++) count[sc.nextInt()-1]++;
		for (int i = 0; i < 6; i++){
			if (count[i] >= max) {
				max = count[i];
				maxIndex = i+1;
			}
		}
		System.out.println(maxIndex);
	}
}
0