結果

問題 No.345 最小チワワ問題
ユーザー ichibanshiboriichibanshibori
提出日時 2016-04-30 00:16:58
言語 F#
(F# 4.0)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 10,418 ms
コンパイル使用メモリ 189,812 KB
実行使用メモリ 38,688 KB
最終ジャッジ日時 2023-10-26 03:50:47
合計ジャッジ時間 24,696 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 375 ms
38,660 KB
testcase_01 AC 371 ms
38,668 KB
testcase_02 AC 370 ms
38,672 KB
testcase_03 AC 372 ms
38,672 KB
testcase_04 AC 372 ms
38,672 KB
testcase_05 AC 376 ms
38,668 KB
testcase_06 AC 370 ms
38,668 KB
testcase_07 AC 367 ms
38,492 KB
testcase_08 AC 366 ms
38,492 KB
testcase_09 AC 365 ms
38,492 KB
testcase_10 AC 370 ms
38,656 KB
testcase_11 AC 366 ms
38,492 KB
testcase_12 AC 362 ms
38,496 KB
testcase_13 AC 361 ms
38,496 KB
testcase_14 AC 374 ms
38,688 KB
testcase_15 AC 372 ms
38,672 KB
testcase_16 AC 373 ms
38,660 KB
testcase_17 AC 378 ms
38,668 KB
testcase_18 AC 376 ms
38,664 KB
testcase_19 AC 376 ms
38,656 KB
testcase_20 AC 373 ms
38,656 KB
testcase_21 AC 367 ms
38,492 KB
testcase_22 AC 375 ms
38,668 KB
testcase_23 AC 370 ms
38,656 KB
testcase_24 AC 374 ms
38,668 KB
testcase_25 AC 369 ms
38,668 KB
testcase_26 AC 375 ms
38,668 KB
testcase_27 AC 372 ms
38,656 KB
testcase_28 AC 365 ms
38,492 KB
testcase_29 AC 376 ms
38,668 KB
testcase_30 AC 371 ms
38,668 KB
testcase_31 AC 363 ms
38,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (245 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 =
    pattern.Matches(str) |>
    function m when m.Count = 0 -> -1
           | m -> seq { 0..(str.Length - 3) } |>
                  Seq.map (fun i -> pattern.Match(str, i)) |>
                  Seq.choose (function m when m.Success -> Some m.Length | _ -> None) |>
                  Seq.min

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