結果

問題 No.717 ファッションへのこだわり
ユーザー ducktailducktail
提出日時 2018-07-30 15:17:25
言語 Haskell
(9.8.2)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 164,568 KB
実行使用メモリ 9,124 KB
最終ジャッジ日時 2023-10-11 23:40:31
合計ジャッジ時間 2,072 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,972 KB
testcase_01 AC 3 ms
6,948 KB
testcase_02 AC 2 ms
7,072 KB
testcase_03 AC 3 ms
7,136 KB
testcase_04 AC 2 ms
7,008 KB
testcase_05 AC 3 ms
7,028 KB
testcase_06 AC 3 ms
7,380 KB
testcase_07 AC 3 ms
8,036 KB
testcase_08 AC 4 ms
8,900 KB
testcase_09 AC 4 ms
9,124 KB
testcase_10 AC 3 ms
8,072 KB
testcase_11 AC 4 ms
8,188 KB
testcase_12 AC 3 ms
8,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative ((<$>), (<*>))

main :: IO ()
main = do
  [n, m] <- map read <$> words <$> getLine
  solve n m <$> getLine <*> getLine >>= print

solve :: Int -> Int -> String -> String -> Int
solve n m s t = let (sa, sb) = f n s
                    (ta, tb) = f m t
                in min sa ta + min sb tb
  where f l xs = let l' = (length . filter (== 'A')) xs in (l', l - l')
0