結果

問題 No.2153 何コーダーが何人?
ユーザー kanenistkanenist
提出日時 2023-03-05 23:06:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 4,459 ms
コンパイル使用メモリ 75,312 KB
実行使用メモリ 60,956 KB
最終ジャッジ日時 2023-10-18 05:00:55
合計ジャッジ時間 9,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
57,544 KB
testcase_01 AC 206 ms
60,956 KB
testcase_02 AC 207 ms
57,824 KB
testcase_03 AC 218 ms
58,232 KB
testcase_04 AC 210 ms
58,032 KB
testcase_05 AC 210 ms
57,988 KB
testcase_06 AC 222 ms
60,216 KB
testcase_07 AC 217 ms
58,228 KB
testcase_08 AC 207 ms
56,108 KB
testcase_09 AC 216 ms
58,260 KB
testcase_10 AC 209 ms
58,108 KB
testcase_11 AC 223 ms
60,088 KB
testcase_12 AC 210 ms
58,228 KB
testcase_13 AC 214 ms
58,052 KB
testcase_14 AC 200 ms
58,152 KB
testcase_15 AC 205 ms
58,112 KB
testcase_16 AC 224 ms
60,280 KB
testcase_17 AC 222 ms
60,160 KB
testcase_18 AC 219 ms
58,372 KB
testcase_19 AC 138 ms
57,512 KB
testcase_20 AC 137 ms
57,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	HashMap<String,Integer> map = new HashMap<>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		int m = sc.nextInt();
    		map.put(s,m);
    	}
    	int c[] = new int[8];
    	for(int i = 0; i < 8; i++) c[i] = 0;
    	for(int val : map.values()){
    		c[val] += 1;
    	}
    	for(int i = 0; i < 8; i++) System.out.println(c[i]);
    }
}
0