結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2020-03-18 07:36:53 |
言語 | F# (F# 4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 15,549 ms |
コンパイル使用メモリ | 185,396 KB |
実行使用メモリ | 36,352 KB |
最終ジャッジ日時 | 2024-12-14 01:25:28 |
合計ジャッジ時間 | 20,539 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 15 RE * 6 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (293 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/
ソースコード
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 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) -> t1 > n ) |> function | Some (x1,x2) -> x2 - n | None -> -1 ) |> Seq.min |> stdout.WriteLine ``No.345 最小チワワ問題``()