結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー GrenacheGrenache
提出日時 2015-09-23 00:34:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 458 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 3,038 ms
コンパイル使用メモリ 73,344 KB
実行使用メモリ 60,876 KB
最終ジャッジ日時 2023-09-08 14:38:09
合計ジャッジ時間 10,772 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 200 ms
59,224 KB
testcase_01 AC 438 ms
60,840 KB
testcase_02 AC 120 ms
56,228 KB
testcase_03 AC 119 ms
56,504 KB
testcase_04 AC 119 ms
55,980 KB
testcase_05 AC 458 ms
60,324 KB
testcase_06 AC 121 ms
56,064 KB
testcase_07 AC 123 ms
56,076 KB
testcase_08 AC 120 ms
54,356 KB
testcase_09 AC 119 ms
56,116 KB
testcase_10 AC 120 ms
56,240 KB
testcase_11 AC 124 ms
55,988 KB
testcase_12 AC 125 ms
55,840 KB
testcase_13 AC 125 ms
56,024 KB
testcase_14 AC 399 ms
60,568 KB
testcase_15 AC 286 ms
60,112 KB
testcase_16 AC 423 ms
60,232 KB
testcase_17 AC 279 ms
60,224 KB
testcase_18 AC 406 ms
60,876 KB
testcase_19 AC 363 ms
59,856 KB
testcase_20 AC 436 ms
60,780 KB
testcase_21 AC 187 ms
58,296 KB
testcase_22 AC 308 ms
60,480 KB
testcase_23 AC 454 ms
60,688 KB
testcase_24 AC 430 ms
60,184 KB
権限があれば一括ダウンロードができます

ソースコード

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