結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー Grenache
提出日時 2015-09-23 00:34:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 575 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 3,281 ms
コンパイル使用メモリ 74,868 KB
実行使用メモリ 59,276 KB
最終ジャッジ日時 2024-06-26 07:43:23
合計ジャッジ時間 11,806 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder79 {

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

        int n = sc.nextInt();
        int[] lc = new int[6];
        for (int i = 0; i < n; i++) {
        	int l = sc.nextInt() - 1;
        	lc[l]++;
        }

        int max = 0;
        int maxi = 0;
        for (int i = 5; i >= 0; i--) {
        	if (lc[i] > max) {
        		max = lc[i];
        		maxi = i + 1;
        	}
        }
        
        System.out.println(maxi);

        sc.close();
    }
}
0