結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー kano_townkano_town
提出日時 2014-11-28 00:15:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 440 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 3,039 ms
コンパイル使用メモリ 71,516 KB
実行使用メモリ 60,876 KB
最終ジャッジ日時 2023-09-08 14:09:54
合計ジャッジ時間 10,560 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
59,124 KB
testcase_01 AC 429 ms
60,592 KB
testcase_02 AC 119 ms
55,636 KB
testcase_03 AC 121 ms
56,180 KB
testcase_04 AC 121 ms
56,068 KB
testcase_05 AC 437 ms
60,176 KB
testcase_06 AC 119 ms
56,212 KB
testcase_07 AC 120 ms
55,528 KB
testcase_08 AC 123 ms
56,288 KB
testcase_09 AC 122 ms
55,856 KB
testcase_10 AC 120 ms
55,724 KB
testcase_11 AC 122 ms
55,924 KB
testcase_12 AC 122 ms
55,672 KB
testcase_13 AC 121 ms
56,232 KB
testcase_14 AC 372 ms
60,260 KB
testcase_15 AC 280 ms
60,028 KB
testcase_16 AC 402 ms
60,876 KB
testcase_17 AC 277 ms
60,072 KB
testcase_18 AC 403 ms
60,712 KB
testcase_19 AC 355 ms
60,272 KB
testcase_20 AC 423 ms
58,744 KB
testcase_21 AC 178 ms
58,296 KB
testcase_22 AC 313 ms
60,208 KB
testcase_23 AC 418 ms
60,068 KB
testcase_24 AC 440 ms
60,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder79 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), max = -1, maxIndex = 0;
		int[] count = new int[6];
		for (int i = 0; i < N; i++) count[sc.nextInt()-1]++;
		for (int i = 0; i < 6; i++){
			if (count[i] >= max) {
				max = count[i];
				maxIndex = i+1;
			}
		}
		System.out.println(maxIndex);
	}
}
0