結果

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

テストケース

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

ソースコード

diff #

let char_sum str =
  let len = String.length str - 1 in
  let rec loop i =
    if i = len + 1 then 0 else
      (int_of_char str.[1]) + 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