結果

問題 No.279 木の数え上げ
ユーザー gemmarogemmaro
提出日時 2020-04-14 11:04:36
言語 Elixir
(1.16.2)
結果
MLE  
実行時間 -
コード長 409 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 55,372 KB
実行使用メモリ 133,884 KB
最終ジャッジ日時 2023-08-30 00:11:44
合計ジャッジ時間 16,808 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 618 ms
49,784 KB
testcase_01 AC 628 ms
49,940 KB
testcase_02 AC 628 ms
49,228 KB
testcase_03 AC 625 ms
49,248 KB
testcase_04 AC 622 ms
49,300 KB
testcase_05 AC 606 ms
49,324 KB
testcase_06 AC 623 ms
49,268 KB
testcase_07 AC 636 ms
49,932 KB
testcase_08 AC 628 ms
49,240 KB
testcase_09 AC 627 ms
49,412 KB
testcase_10 MLE -
testcase_11 AC 624 ms
57,084 KB
testcase_12 MLE -
testcase_13 AC 620 ms
55,208 KB
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.to_charlist()
    |> Enum.filter(&(&1 == ?t || &1 == ?r || &1 == ?e))
    |> (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