結果

問題 No.706 多眼生物の調査
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-06-29 22:56:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 269 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 3,750 ms
コンパイル使用メモリ 77,880 KB
実行使用メモリ 57,668 KB
最終ジャッジ日時 2023-09-13 15:32:09
合計ジャッジ時間 4,458 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,260 KB
testcase_01 AC 120 ms
55,552 KB
testcase_02 AC 120 ms
55,808 KB
testcase_03 AC 154 ms
56,420 KB
testcase_04 AC 158 ms
56,600 KB
testcase_05 AC 204 ms
56,928 KB
testcase_06 AC 269 ms
57,668 KB
testcase_07 AC 123 ms
56,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] sl = new int[1000];
        for(int i=0; i<n; i++) {
            String s = in.next();
            sl[s.length() - 2]++;
        }

        int max = 0, maxcount = 0;
        for(int i=0; i<1000; i++) {
            if(max <= sl[i]) {
                max = sl[i];
                maxcount = i;
            }
        }

        System.out.println(maxcount);
    }
}
0