結果
問題 | No.2153 何コーダーが何人? |
ユーザー | tk55513 |
提出日時 | 2023-02-17 21:01:04 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 218 ms / 2,000 ms |
コード長 | 582 bytes |
コンパイル時間 | 3,331 ms |
コンパイル使用メモリ | 75,848 KB |
実行使用メモリ | 57,432 KB |
最終ジャッジ日時 | 2024-07-19 12:07:40 |
合計ジャッジ時間 | 7,664 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
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); } } }