結果

問題 No.345 最小チワワ問題
ユーザー ichibanshiboriichibanshibori
提出日時 2016-04-30 00:30:05
言語 F#
(F# 4.0)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 7,236 ms
コンパイル使用メモリ 189,736 KB
実行使用メモリ 38,488 KB
最終ジャッジ日時 2023-10-26 03:51:49
合計ジャッジ時間 21,035 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 364 ms
38,052 KB
testcase_01 AC 364 ms
38,052 KB
testcase_02 AC 366 ms
38,052 KB
testcase_03 AC 366 ms
37,924 KB
testcase_04 AC 364 ms
37,924 KB
testcase_05 AC 365 ms
38,456 KB
testcase_06 AC 363 ms
38,456 KB
testcase_07 AC 362 ms
38,452 KB
testcase_08 AC 366 ms
38,052 KB
testcase_09 AC 368 ms
38,048 KB
testcase_10 AC 365 ms
38,052 KB
testcase_11 AC 365 ms
38,440 KB
testcase_12 AC 368 ms
38,048 KB
testcase_13 AC 363 ms
38,476 KB
testcase_14 AC 362 ms
37,940 KB
testcase_15 AC 363 ms
37,924 KB
testcase_16 AC 364 ms
37,924 KB
testcase_17 AC 364 ms
37,924 KB
testcase_18 AC 365 ms
38,488 KB
testcase_19 AC 365 ms
38,480 KB
testcase_20 AC 365 ms
38,480 KB
testcase_21 AC 363 ms
37,820 KB
testcase_22 AC 367 ms
37,924 KB
testcase_23 AC 366 ms
37,924 KB
testcase_24 AC 363 ms
37,924 KB
testcase_25 AC 364 ms
37,924 KB
testcase_26 AC 369 ms
38,444 KB
testcase_27 AC 363 ms
38,444 KB
testcase_28 AC 364 ms
38,452 KB
testcase_29 AC 368 ms
38,060 KB
testcase_30 AC 365 ms
37,896 KB
testcase_31 AC 362 ms
38,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (260 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

open System
open System.Text.RegularExpressions

let pattern = new Regex(@"c.*?w.*?w")
let searchCww (str:string) =
    seq { for i in 0..(str.Length - 3) -> pattern.Match(str, i) } |>
    Seq.choose (function m when m.Success -> Some m.Length | _ -> None) |>
    (fun s -> if Seq.isEmpty s then -1 else Seq.min s)

Console.ReadLine () |> searchCww |> printfn "%d"
0