結果

問題 No.1026 OGAWA's New Keyboard
ユーザー gemmaro
提出日時 2020-04-21 10:03:34
言語 Ruby
(3.4.1)
結果
AC  
実行時間 441 ms / 1,000 ms
コード長 280 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 48,256 KB
最終ジャッジ日時 2024-09-16 05:04:58
合計ジャッジ時間 4,219 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve(t_and_s)
  l = []
  r = []
  t_and_s.each do |t, s|
    case t
    when '0'
      r << s
    when '1'
      l << s
    end
  end
  (l.reverse + r).join
end

N = gets.to_i
T = N.times.map { gets.chomp.split }

RESULT = solve(T)

puts RESULT
0