結果

問題 No.436 ccw
ユーザー xsd
提出日時 2020-06-19 00:59:20
言語 OCaml
(5.2.1)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 21,444 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 01:26:50
合計ジャッジ時間 1,279 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%s" (fun s ->
    let n = String.length s in
    let rec loop i c w =
        if i = n then min (c - 1) w else
            if s.[i] = 'c' then loop (i + 1) (c + 1) w
                           else loop (i + 1) c (w + 1)
    in
    loop 0 0 0 |> Printf.printf "%d\n"
)
0