結果

問題 No.717 ファッションへのこだわり
ユーザー ichibanshiboriichibanshibori
提出日時 2018-09-11 23:13:45
言語 F#
(F# 4.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 4,416 ms
コンパイル使用メモリ 157,948 KB
実行使用メモリ 24,948 KB
最終ジャッジ日時 2023-09-06 15:21:42
合計ジャッジ時間 6,573 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
22,948 KB
testcase_01 AC 77 ms
22,984 KB
testcase_02 AC 76 ms
22,908 KB
testcase_03 AC 78 ms
22,816 KB
testcase_04 AC 79 ms
24,932 KB
testcase_05 AC 78 ms
24,908 KB
testcase_06 AC 77 ms
24,880 KB
testcase_07 AC 80 ms
22,836 KB
testcase_08 AC 77 ms
23,064 KB
testcase_09 AC 78 ms
22,916 KB
testcase_10 AC 80 ms
24,948 KB
testcase_11 AC 78 ms
23,056 KB
testcase_12 AC 76 ms
22,860 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let countAB str =
    str
    |> Seq.toList
    |> List.partition (fun c -> c = 'A')
    |> fun (aLst, bLst) -> (List.length aLst, List.length bLst)

let solve s t =
    let a1, b1 = countAB s
    let a2, b2 = countAB t
    Math.Min(a1, a2) + Math.Min(b1, b2)

let () =
    Console.ReadLine() |> ignore
    let s = Console.ReadLine()
    let t = Console.ReadLine()
    solve s t
    |> printfn "%d"
0