結果
| 問題 | No.1032 数数え |
| ユーザー |
tenten
|
| 提出日時 | 2020-09-28 14:32:47 |
| 言語 | Java (openjdk 27.0.1.0.3 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 620 ms / 2,000 ms |
| + 177µs | |
| コード長 | 490 bytes |
| 記録 | |
| コンパイル時間 | 1,649 ms |
| コンパイル使用メモリ | 94,096 KB |
| 実行使用メモリ | 79,476 KB |
| 最終ジャッジ日時 | 2026-10-29 01:18:15 |
| 合計ジャッジ時間 | 6,333 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
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[] counts = new int[m + 1];
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
if (x <= m) {
counts[x]++;
}
}
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= m; i++) {
sb.append(i).append(" ").append(counts[i]).append("\n");
}
System.out.print(sb);
}
}
tenten