結果

問題 No.717 ファッションへのこだわり
ユーザー wotsushi
提出日時 2018-07-28 15:55:33
言語 Elixir
(1.18.1)
結果
AC  
実行時間 564 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 1,025 ms
コンパイル使用メモリ 63,476 KB
実行使用メモリ 56,796 KB
最終ジャッジ日時 2024-12-31 02:08:39
合計ジャッジ時間 9,557 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  defp count(str, x) do
    str
    |> String.graphemes
    |> Enum.count(&(&1 == x))
  end

  def main do
    [_, _] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1)
    s = IO.gets("") |> String.trim
    t = IO.gets("") |> String.trim

    ans = min(count(s, "A"), count(t, "A")) + min(count(s, "B"), count(t, "B"))

    IO.puts ans
  end
end
0