結果
| 問題 | No.1032 数数え |
| ユーザー |
|
| 提出日時 | 2025-12-23 00:15:32 |
| 言語 | Standard ML (MLton 20210117) |
| 結果 |
AC
|
| 実行時間 | 360 ms / 2,000 ms |
| コード長 | 772 bytes |
| 記録 | |
| コンパイル時間 | 3,148 ms |
| コンパイル使用メモリ | 691,836 KB |
| 実行使用メモリ | 41,916 KB |
| 最終ジャッジ日時 | 2025-12-23 00:15:39 |
| 合計ジャッジ時間 | 5,402 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
fun readInt () =
valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)
fun printAns m ls =
let
val table = Array.array (m + 1, 0)
in
(
List.app
(fn l =>
if 0 < l andalso l <= m then Array.update (table, l, Array.sub (table, l) + 1)
else ignore ()
)
ls;
Array.appi
(fn (index, count) =>
if index = 0 then ignore ()
else print (Int.toString index ^ " " ^ Int.toString count ^ "\n"))
table
)
end
val () =
let
val n = readInt ()
val m = readInt ()
val ls = List.tabulate (n, fn _ => readInt ())
in
printAns m ls
end