結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
chike_plus
|
| 提出日時 | 2020-03-18 07:36:53 |
| 言語 | F# (F# 10.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| 記録 | |
| コンパイル時間 | 7,556 ms |
| コンパイル使用メモリ | 215,364 KB |
| 実行使用メモリ | 39,424 KB |
| 最終ジャッジ日時 | 2026-05-24 20:12:18 |
| 合計ジャッジ時間 | 13,209 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 15 RE * 6 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (411 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.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 最小チワワ問題``()
chike_plus