結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー koukonko
提出日時 2015-12-10 12:50:50
言語 Java
(openjdk 23)
結果
AC  
実行時間 165 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 72,932 KB
実行使用メモリ 46,964 KB
最終ジャッジ日時 2024-06-26 07:45:48
合計ジャッジ時間 5,267 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			buff.readLine();
			String[] box = buff.readLine().split(" ");
			int[] count = new int[6];

			for(int i = 0; i < box.length; ++i){
				count[Integer.parseInt(box[i])-1]++;
			}
			int ans = 0, max = 0;
			for(int i = 0; i < 6; ++i){
				if(count[i] >= max){
					ans = i+1;
					max = count[i];
				}
			}
			System.out.println(ans);

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0