結果

問題 No.706 多眼生物の調査
ユーザー tentententen
提出日時 2020-10-09 09:19:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 3,955 ms
コンパイル使用メモリ 71,056 KB
実行使用メモリ 57,348 KB
最終ジャッジ日時 2023-09-27 12:35:05
合計ジャッジ時間 5,892 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,344 KB
testcase_01 AC 118 ms
55,336 KB
testcase_02 AC 113 ms
55,552 KB
testcase_03 AC 147 ms
56,072 KB
testcase_04 AC 147 ms
56,328 KB
testcase_05 AC 196 ms
57,136 KB
testcase_06 AC 248 ms
57,348 KB
testcase_07 AC 118 ms
55,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] counts = new int[1000];
        for (int i = 0; i < n; i++) {
            counts[sc.next().length() - 2]++;
        }
        int max = 0;
        int idx = 0;
        for (int i = 0; i < counts.length; i++) {
            if (max <= counts[i]) {
                max = counts[i];
                idx = i;
            }
        }
        System.out.println(idx);
    }
}
0