結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 569 ms
49,060 KB
testcase_01 AC 570 ms
51,264 KB
testcase_02 AC 564 ms
49,792 KB
testcase_03 AC 570 ms
49,244 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()
    end)
    |> solve_rec([], [])
    |> IO.puts()
  end

  def solve_rec([], l, r) do
    (l |> Enum.join()) <> (r |> Enum.join() |> String.reverse())
  end

  def solve_rec([[t, s] | a], l, r) do
    case t do
      "0" -> solve_rec(a, l, [s | r])
      "1" -> solve_rec(a, [s | l], r)
    end
  end
end
0