結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2019-07-08 09:29:06 |
言語 | Elixir (1.18.1) |
結果 |
AC
|
実行時間 | 611 ms / 5,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 1,079 ms |
コンパイル使用メモリ | 62,700 KB |
実行使用メモリ | 57,288 KB |
最終ジャッジ日時 | 2024-12-31 03:25:55 |
合計ジャッジ時間 | 15,559 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
defmodule Main do def main do n = IO.gets("") |> String.trim |> String.to_integer IO.stream(:stdio, :line) |> Enum.take(n) |> Enum.map(&String.trim/1) |> Enum.map(&String.split/1) |> Enum.map(&Enum.map(&1, fn num -> String.to_integer(num) end)) |> Enum.flat_map(fn x -> x end) |> Enum.group_by(fn x -> x end) |> Enum.map(fn {_, value} -> Enum.count(value) end) |> Enum.map(fn x -> div(x,2) + rem(x,2)/4 end) |> Enum.sum |> trunc |> IO.puts end end