結果

問題 No.1005 BOT対策
ユーザー ikdikd
提出日時 2020-05-04 21:36:04
言語 F#
(F# 4.0)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 6,095 ms
コンパイル使用メモリ 162,860 KB
実行使用メモリ 25,856 KB
最終ジャッジ日時 2023-09-07 05:49:29
合計ジャッジ時間 9,256 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
23,692 KB
testcase_01 AC 109 ms
25,680 KB
testcase_02 AC 109 ms
23,760 KB
testcase_03 AC 109 ms
23,580 KB
testcase_04 AC 64 ms
24,244 KB
testcase_05 AC 107 ms
25,756 KB
testcase_06 AC 63 ms
22,280 KB
testcase_07 AC 63 ms
22,272 KB
testcase_08 AC 108 ms
23,632 KB
testcase_09 AC 109 ms
21,652 KB
testcase_10 AC 107 ms
23,592 KB
testcase_11 AC 105 ms
23,692 KB
testcase_12 AC 105 ms
23,640 KB
testcase_13 AC 106 ms
25,856 KB
testcase_14 AC 110 ms
23,576 KB
testcase_15 AC 105 ms
23,756 KB
testcase_16 AC 108 ms
23,708 KB
testcase_17 AC 108 ms
25,664 KB
testcase_18 AC 109 ms
25,728 KB
testcase_19 AC 63 ms
22,312 KB
testcase_20 AC 64 ms
24,320 KB
testcase_21 AC 106 ms
23,600 KB
testcase_22 AC 107 ms
23,700 KB
testcase_23 AC 105 ms
21,512 KB
testcase_24 AC 107 ms
25,636 KB
testcase_25 AC 106 ms
23,700 KB
testcase_26 AC 107 ms
23,596 KB
testcase_27 AC 63 ms
22,180 KB
testcase_28 AC 107 ms
23,692 KB
testcase_29 AC 107 ms
23,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
    let s = stdin.ReadLine()
    let t = stdin.ReadLine()

    if t.Length = 1 && s |> String.exists (fun c -> c = t.[0]) then
        printfn "-1"
        exit 0
    let rec solve i =
        if i + t.Length > s.Length then 0
        elif s.[i..(i + t.Length - 1)] = t then 1 + solve (i + t.Length - 1)
        else solve (i + 1)
    solve 0 |> printfn "%A"
    0 // return an integer exit code
0