結果

問題 No.1005 BOT対策
ユーザー xsd
提出日時 2020-07-02 02:02:33
言語 OCaml
(5.2.1)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 1,110 ms
コンパイル使用メモリ 22,764 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 00:53:19
合計ジャッジ時間 2,019 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%s %s" (fun s t ->
    let lens = String.length s in
    let lent = String.length t in

    let rec loop i acc =
        if i + lent > lens then acc else
            if String.sub s i lent <> t then loop (i + 1) acc else
                if lent = 1 then -1 else
                    loop (i + lent - 1) (acc + 1)
    in
    loop 0 0 |> Printf.printf "%d\n"
)
0