結果

問題 No.436 ccw
ユーザー ichibanshiboriichibanshibori
提出日時 2016-10-28 22:33:11
言語 F#
(F# 4.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 5,315 ms
コンパイル使用メモリ 151,092 KB
実行使用メモリ 25,400 KB
最終ジャッジ日時 2023-08-15 21:05:08
合計ジャッジ時間 8,212 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
22,952 KB
testcase_01 AC 72 ms
22,844 KB
testcase_02 AC 68 ms
22,900 KB
testcase_03 AC 72 ms
24,884 KB
testcase_04 AC 70 ms
25,000 KB
testcase_05 AC 68 ms
22,904 KB
testcase_06 AC 68 ms
22,948 KB
testcase_07 AC 71 ms
21,032 KB
testcase_08 AC 70 ms
22,968 KB
testcase_09 AC 69 ms
22,828 KB
testcase_10 AC 71 ms
22,832 KB
testcase_11 AC 68 ms
23,032 KB
testcase_12 AC 67 ms
22,876 KB
testcase_13 AC 67 ms
23,084 KB
testcase_14 AC 69 ms
20,976 KB
testcase_15 AC 69 ms
24,944 KB
testcase_16 AC 68 ms
23,088 KB
testcase_17 AC 68 ms
23,024 KB
testcase_18 AC 68 ms
22,908 KB
testcase_19 AC 70 ms
22,908 KB
testcase_20 AC 69 ms
22,976 KB
testcase_21 AC 73 ms
23,260 KB
testcase_22 AC 72 ms
23,348 KB
testcase_23 AC 73 ms
25,272 KB
testcase_24 AC 73 ms
25,400 KB
testcase_25 AC 72 ms
23,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let solve s =
    let num_c = seq s |>
                Seq.filter (fun c -> c = 'c') |>
                Seq.length
    let num_w = seq s |>
                Seq.filter (fun c -> c = 'w') |>
                Seq.length
    if num_c - 1 < num_w then num_c - 1
    else num_w


let () =
  let s = stdin.ReadLine()
  solve s |> printfn "%d"
0