結果

問題 No.69 文字を自由に並び替え
ユーザー piconic_Xpiconic_X
提出日時 2015-11-16 02:28:31
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 285 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 19,564 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 08:32:15
合計ジャッジ時間 834 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

let char_sum str =
  let len = String.length str in
  let rec loop i =
    if i = len then 0 else
      (int_of_char str.[i]) + loop (i+1)
  in
  loop 0

let () =
  let a, b = read_line (), read_line () in
  if char_sum a = char_sum b then print_endline "YES"
  else print_endline "NO"
0