結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー uafr_cs
提出日時 2015-05-15 02:45:09
言語 Java
(openjdk 23)
結果
AC  
実行時間 565 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 47,692 KB
最終ジャッジ日時 2024-06-26 07:34:29
合計ジャッジ時間 10,735 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final int SIZE = 6;
		final int N = sc.nextInt();
		int[] counts = new int[SIZE];
		for(int i = 0; i < N; i++){
			counts[sc.nextInt() - 1]++;
		}
		
		int max = 0;
		for(int i = 0; i < SIZE; i++){
			if(counts[max] <= counts[i]){
				max = i;
			}
		}
		
		System.out.println(max + 1);
		
	}
	
}
0