結果

問題 No.1005 BOT対策
ユーザー natoriusannatoriusan
提出日時 2023-07-30 11:44:32
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 9,943 ms
コンパイル使用メモリ 184,336 KB
実行使用メモリ 58,028 KB
最終ジャッジ日時 2024-04-17 13:01:48
合計ジャッジ時間 18,502 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 335 ms
34,428 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 59 ms
29,824 KB
testcase_05 WA -
testcase_06 AC 58 ms
30,080 KB
testcase_07 AC 58 ms
29,696 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 332 ms
34,468 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 59 ms
29,908 KB
testcase_20 AC 58 ms
30,080 KB
testcase_21 AC 332 ms
34,460 KB
testcase_22 AC 331 ms
34,276 KB
testcase_23 AC 331 ms
34,472 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 58 ms
29,824 KB
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (277 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/

ソースコード

diff #

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..]
        printfn "%s" s
    s.Length - firstLength |> printfn "%d"
0