結果
| 問題 | No.2737 Compound Word |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-20 19:29:12 |
| 言語 | OCaml (5.5.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 587µs | |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 2,088 ms |
| コンパイル使用メモリ | 22,852 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-14 23:39:49 |
| 合計ジャッジ時間 | 3,024 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
コンパイルメッセージ
ocamlfind: [WARNING] Cannot read directory ./stublibs which is mentioned in ld.conf
ソースコード
Scanf.scanf "%d" (fun n ->
let s = Array.init n (fun _ -> Scanf.scanf " %s" (fun s -> s)) in
let module S = Set.Make (struct type t = string let compare = compare end) in
let rec loop i set =
let rec loop2 j set =
if j >= n then loop (i + 1) set else
loop2 (j + 1) (if i = j then set else S.add (s.(i) ^ s.(j)) set)
in
if i = n then set else loop2 0 set
in
Printf.printf "%d\n" @@ S.cardinal @@ loop 0 S.empty
)