結果

問題 No.2153 何コーダーが何人?
ユーザー tk55513tk55513
提出日時 2023-02-17 21:01:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 5,010 ms
コンパイル使用メモリ 72,344 KB
実行使用メモリ 59,544 KB
最終ジャッジ日時 2023-09-26 18:08:49
合計ジャッジ時間 10,283 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,528 KB
testcase_01 AC 193 ms
59,544 KB
testcase_02 AC 196 ms
57,028 KB
testcase_03 AC 206 ms
56,748 KB
testcase_04 AC 202 ms
56,436 KB
testcase_05 AC 203 ms
56,448 KB
testcase_06 AC 210 ms
58,864 KB
testcase_07 AC 200 ms
56,404 KB
testcase_08 AC 200 ms
56,468 KB
testcase_09 AC 205 ms
56,760 KB
testcase_10 AC 200 ms
56,732 KB
testcase_11 AC 212 ms
59,400 KB
testcase_12 AC 200 ms
56,736 KB
testcase_13 AC 202 ms
54,596 KB
testcase_14 AC 202 ms
56,696 KB
testcase_15 AC 197 ms
56,912 KB
testcase_16 AC 198 ms
59,332 KB
testcase_17 AC 198 ms
58,896 KB
testcase_18 AC 207 ms
59,056 KB
testcase_19 AC 125 ms
56,128 KB
testcase_20 AC 124 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String... args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s=sc.next();
            int c=sc.nextInt();
            map.put(s,c);
        }
        int[] ints=new int[8];
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            ints[entry.getValue()]++;
        }
        for (int anInt : ints) {
            System.out.println(anInt);
        }
    }
}
0