結果

問題 No.69 文字を自由に並び替え
ユーザー r6eve
提出日時 2017-08-10 10:29:06
言語 OCaml
(5.2.1)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 21,868 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 00:06:57
合計ジャッジ時間 909 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

module S = Set.Make (struct
  type t = char
  let compare x y = Char.code x - Char.code y
end)

let () =
  let a, b = Scanf.scanf "%s %s " (fun a b -> a, b) in
  let rec doit x i l set =
    if i = l then set
    else S.add x.[i] set |> doit x (i + 1) l in
  let s = doit a 0 (String.length a) S.empty in
  let t = doit b 0 (String.length b) S.empty in
  print_endline (if S.equal s t then "YES" else "NO")
0