結果
| 問題 | 
                            No.1005 BOT対策
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-07-30 11:45:16 | 
| 言語 | F#  (F# 4.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 549 bytes | 
| コンパイル時間 | 7,031 ms | 
| コンパイル使用メモリ | 185,624 KB | 
| 実行使用メモリ | 57,844 KB | 
| 最終ジャッジ日時 | 2024-10-09 07:04:45 | 
| 合計ジャッジ時間 | 17,044 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 WA * 3 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (233 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
let mutable s = stdin.ReadLine ()
let t = stdin.ReadLine ()
let firstLength = s.Length
let length = t.Length
let findIndex (str: string) (search: string) =
    let mutable index = -1
    for i in 0..str.Length-search.Length do
        if index = -1 && str.[i..i+search.Length-1] = search then
            index <- i
    index
    
if length = 1 then
    printfn "-1"
else
    while findIndex s t <> -1 do
        let index = findIndex s t
        s <- s.[..index+t.Length-2] + "." + s.[index+t.Length-1..]
    s.Length - firstLength |> printfn "%d"