結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー koukonkokoukonko
提出日時 2015-12-10 12:50:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 157 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 2,878 ms
コンパイル使用メモリ 72,712 KB
実行使用メモリ 58,208 KB
最終ジャッジ日時 2023-09-08 14:40:43
合計ジャッジ時間 5,657 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
51,212 KB
testcase_01 AC 152 ms
58,208 KB
testcase_02 AC 45 ms
49,592 KB
testcase_03 AC 44 ms
49,380 KB
testcase_04 AC 44 ms
49,456 KB
testcase_05 AC 157 ms
57,812 KB
testcase_06 AC 44 ms
49,352 KB
testcase_07 AC 45 ms
49,348 KB
testcase_08 AC 45 ms
49,244 KB
testcase_09 AC 45 ms
49,332 KB
testcase_10 AC 44 ms
49,552 KB
testcase_11 AC 44 ms
49,224 KB
testcase_12 AC 46 ms
49,156 KB
testcase_13 AC 45 ms
49,368 KB
testcase_14 AC 113 ms
55,408 KB
testcase_15 AC 86 ms
54,504 KB
testcase_16 AC 133 ms
57,644 KB
testcase_17 AC 77 ms
54,364 KB
testcase_18 AC 142 ms
58,132 KB
testcase_19 AC 119 ms
56,604 KB
testcase_20 AC 150 ms
57,944 KB
testcase_21 AC 54 ms
50,624 KB
testcase_22 AC 100 ms
53,960 KB
testcase_23 AC 147 ms
57,984 KB
testcase_24 AC 151 ms
58,024 KB
権限があれば一括ダウンロードができます

ソースコード

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