結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー jimano
提出日時 2018-01-14 16:04:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 702 bytes
コンパイル時間 3,460 ms
コンパイル使用メモリ 73,828 KB
実行使用メモリ 46,328 KB
最終ジャッジ日時 2024-06-26 08:22:45
合計ジャッジ時間 6,575 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0082 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int N = Integer.parseInt(br.readLine());
			String[] L = br.readLine().split(" ");
			int[] level = new int[6];

			for (String s : L) {
				level[Integer.parseInt(s) - 1]++;
			}

			int max = 0;
			int maxCnt = 0;
			for (int i = 0; i < level.length; i++) {
				if (max <= level[i]) {
					max = level[i];
					maxCnt = i + 1;
				}
			}
			System.out.println(maxCnt);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0