結果

問題 No.1026 OGAWA's New Keyboard
ユーザー gemmarogemmaro
提出日時 2020-04-21 08:55:34
言語 Elixir
(1.16.2)
結果
TLE  
実行時間 -
コード長 563 bytes
コンパイル時間 1,258 ms
コンパイル使用メモリ 55,268 KB
実行使用メモリ 109,704 KB
最終ジャッジ日時 2023-08-30 00:34:26
合計ジャッジ時間 7,707 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 568 ms
49,092 KB
testcase_01 AC 575 ms
49,264 KB
testcase_02 AC 570 ms
50,220 KB
testcase_03 AC 570 ms
49,792 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    1..(IO.read(:line)
        |> String.trim()
        |> String.to_integer())
    |> Enum.map(fn _ ->
      IO.read(:line)
      |> String.trim()
      |> String.split()
      |> (fn [t, s] -> {t |> String.to_integer(), s} end).()
    end)
    |> solve
    |> IO.puts()
  end

  def solve(t) do
    solve_rec(t, [])
  end

  def solve_rec([], r) do
    r |> Enum.join()
  end

  def solve_rec([{t, s} | l], r) do
    case t do
      0 -> solve_rec(l, r |> List.insert_at(-1, s))
      1 -> solve_rec(l, [s | r])
    end
  end
end
0