結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2017-08-11 09:27:33 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 126 ms / 5,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 21,448 KB |
実行使用メモリ | 14,336 KB |
最終ジャッジ日時 | 2024-10-09 00:11:35 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
module M = Map.Make (struct type t = int let compare = (-) end) let read () = Scanf.scanf "%d " (fun i -> i) let () = let n = read () in let rec doit i m = if i = n then m else let a = read () in doit (i + 1) (if not (M.mem a m) then M.add a 1 m else M.add a (M.find a m + 1) m) in let m = doit 0 M.empty in M.fold (fun _ n s -> s + if n = 1 then 1 else 0) m 0 |> Printf.printf "%d\n"