結果

問題 No.2153 何コーダーが何人?
ユーザー viral8viral8
提出日時 2022-12-09 21:35:19
言語 Java
(openjdk 23)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 3,875 ms
コンパイル使用メモリ 74,840 KB
実行使用メモリ 43,520 KB
最終ジャッジ日時 2024-10-14 20:47:19
合計ジャッジ時間 7,913 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.HashMap;
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] count = new int[8];
		HashMap<String,Integer> list = new HashMap<>();
		while(N-->0){
			String name = sc.next();
			int C = sc.nextInt();
			list.put(name,C);
		}
		for(String name:list.keySet()){
			int c = list.get(name);
			count[c]++;
		}
		for(int ans:count)
			System.out.println(ans);
	}
}
0