結果
問題 | No.345 最小チワワ問題 |
ユーザー | chike_plus |
提出日時 | 2020-03-18 07:55:50 |
言語 | F# (F# 4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 718 bytes |
コンパイル時間 | 5,202 ms |
コンパイル使用メモリ | 154,448 KB |
実行使用メモリ | 27,336 KB |
最終ジャッジ日時 | 2023-08-20 19:41:53 |
合計ジャッジ時間 | 5,769 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 51 ms
20,164 KB |
testcase_01 | AC | 50 ms
22,172 KB |
testcase_02 | AC | 50 ms
24,196 KB |
testcase_03 | AC | 50 ms
22,240 KB |
testcase_04 | AC | 49 ms
22,032 KB |
testcase_05 | AC | 51 ms
22,232 KB |
testcase_06 | AC | 50 ms
24,216 KB |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | AC | 51 ms
24,188 KB |
testcase_11 | RE | - |
testcase_12 | AC | 51 ms
22,252 KB |
testcase_13 | RE | - |
testcase_14 | AC | 52 ms
24,240 KB |
testcase_15 | AC | 51 ms
22,152 KB |
testcase_16 | AC | 50 ms
24,148 KB |
testcase_17 | AC | 50 ms
22,236 KB |
testcase_18 | AC | 49 ms
22,092 KB |
testcase_19 | AC | 50 ms
20,004 KB |
testcase_20 | AC | 51 ms
22,108 KB |
testcase_21 | AC | 51 ms
22,236 KB |
testcase_22 | AC | 50 ms
22,064 KB |
testcase_23 | AC | 49 ms
22,236 KB |
testcase_24 | AC | 50 ms
22,148 KB |
testcase_25 | AC | 49 ms
22,128 KB |
testcase_26 | AC | 50 ms
22,188 KB |
testcase_27 | AC | 50 ms
24,240 KB |
testcase_28 | AC | 52 ms
22,172 KB |
testcase_29 | AC | 50 ms
22,196 KB |
testcase_30 | AC | 49 ms
22,232 KB |
testcase_31 | RE | - |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
let ``No.345 最小チワワ問題``() = let s = stdin.ReadLine() let Windexes = s |> Seq.mapi (fun i c -> if c.Equals( 'w' ) then i + 1 else -1 ) |> Seq.filter (fun i -> i >= 0) |> Seq.pairwise let res = s |> Seq.mapi (fun i c -> if c.Equals( 'c' ) then i else -1 ) |> Seq.filter (fun i -> i >= 0) |> Seq.map ( fun n -> Windexes |> Seq.tryFind (fun (t1, t2) -> n < t1 ) |> function | Some (x1,x2) -> x2 - n | None -> -1 ) res |> Seq.max |> function | -1 -> -1 | _ -> res |> Seq.filter( fun n -> n > 0) |> Seq.min |> stdout.WriteLine ``No.345 最小チワワ問題``()