結果
問題 | No.667 Mice's Luck(ネズミ達の運) |
ユーザー |
|
提出日時 | 2018-09-17 19:14:17 |
言語 | OCaml (5.2.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 684 bytes |
コンパイル時間 | 51 ms |
コンパイル使用メモリ | 16,768 KB |
最終ジャッジ日時 | 2024-11-14 20:37:59 |
合計ジャッジ時間 | 443 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
File "Main.ml", line 1, characters 5-8: 1 | open Num ^^^ Error: Unbound module Num
ソースコード
open Numlet solve s_arr =let n1 = num_of_int 1and n100 = num_of_int 100 inlet rec solve' idx rest_len rest_maru =if (idx < len_s_arr) then (Printf.printf "%.7f\n" @@ float_of_num @@ rest_maru // rest_len */ n100;let rest_maru' = if s_arr.(idx) = 1 then rest_maru -/ n1 else rest_maru insolve' (idx + 1) (rest_len -/ n1) rest_maru')and len_s_arr = Array.length s_arrand cnt_maru = Array.fold_left ( + ) 0 s_arr |> num_of_int insolve' 0 (num_of_int len_s_arr) cnt_marulet () =let s = read_line () inlet len_s = String.length s inlet s_arr = Array.init len_s (fun i -> match s.[i] with | 'o' -> 1 | _ -> 0) insolve s_arr