結果

問題 No.279 木の数え上げ
ユーザー gemmarogemmaro
提出日時 2020-04-14 10:58:25
言語 Elixir
(1.16.2)
結果
MLE  
実行時間 -
コード長 391 bytes
コンパイル時間 1,082 ms
コンパイル使用メモリ 55,488 KB
実行使用メモリ 801,700 KB
最終ジャッジ日時 2023-08-30 00:13:19
合計ジャッジ時間 27,577 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 596 ms
49,256 KB
testcase_01 AC 597 ms
49,776 KB
testcase_02 AC 604 ms
49,828 KB
testcase_03 AC 604 ms
49,416 KB
testcase_04 AC 608 ms
50,076 KB
testcase_05 AC 622 ms
49,216 KB
testcase_06 AC 617 ms
49,092 KB
testcase_07 AC 624 ms
50,204 KB
testcase_08 AC 617 ms
49,840 KB
testcase_09 AC 599 ms
49,996 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.read(:line)
    |> solve
    |> IO.puts()
  end

  defp solve(s) do
    s
    |> String.replace(~r/[^tre]/, "")
    |> String.to_charlist()
    |> (fn t ->
          [
            Enum.count(t, &(&1 == ?t)),
            Enum.count(t, &(&1 == ?r)),
            Enum.count(t, &(&1 == ?e)) |> div(2)
          ]
        end).()
    |> Enum.min()
  end
end
0