結果

問題 No.1032 数数え
ユーザー yomo3yomo3
提出日時 2020-05-07 23:22:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 770 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 74,584 KB
実行使用メモリ 71,844 KB
最終ジャッジ日時 2023-09-16 08:11:10
合計ジャッジ時間 6,333 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
56,732 KB
testcase_01 AC 151 ms
56,920 KB
testcase_02 AC 150 ms
56,692 KB
testcase_03 AC 149 ms
56,760 KB
testcase_04 AC 153 ms
56,704 KB
testcase_05 AC 153 ms
56,776 KB
testcase_06 AC 150 ms
56,624 KB
testcase_07 AC 770 ms
71,668 KB
testcase_08 AC 155 ms
56,628 KB
testcase_09 AC 237 ms
59,468 KB
testcase_10 AC 195 ms
59,600 KB
testcase_11 AC 150 ms
56,932 KB
testcase_12 AC 762 ms
71,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] cnt = new int[200001];
        for (int i = 0; i < N; i++) {
            cnt[Integer.parseInt(sc.next())]++;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i <= M; i++) {
            sb.append(i + " " + cnt[i] + '\n');
        }
        System.out.print(sb);
    }
}
0