結果
| 問題 |
No.1026 OGAWA's New Keyboard
|
| ユーザー |
|
| 提出日時 | 2020-04-21 09:56:00 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 467 bytes |
| コンパイル時間 | 309 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 97,408 KB |
| 最終ジャッジ日時 | 2024-10-07 15:25:56 |
| 合計ジャッジ時間 | 4,984 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 RE * 1 |
| other | AC * 17 RE * 4 |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true
def solve(t_and_s, result)
if t_and_s.empty?
result
else
solve(t_and_s[1..-1], (case t_and_s.first[0]
when '0'
"#{result}#{t_and_s.first[1]}"
when '1'
"#{t_and_s.first[1]}#{result}"
end))
end
end
N = gets.to_i
T = N.times.map { gets.chomp.split }
RESULT = solve(T, '')
puts RESULT