結果

問題 No.1335 1337
ユーザー higesawahigesawa
提出日時 2023-07-14 18:36:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 11,380 KB
実行使用メモリ 15,296 KB
最終ジャッジ日時 2023-10-14 08:25:31
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
15,284 KB
testcase_01 AC 65 ms
15,268 KB
testcase_02 AC 67 ms
15,164 KB
testcase_03 AC 68 ms
15,296 KB
testcase_04 AC 68 ms
15,092 KB
testcase_05 AC 70 ms
15,056 KB
testcase_06 AC 69 ms
15,236 KB
testcase_07 AC 67 ms
15,252 KB
testcase_08 AC 69 ms
15,120 KB
testcase_09 AC 70 ms
15,184 KB
testcase_10 AC 70 ms
15,164 KB
testcase_11 AC 67 ms
15,136 KB
testcase_12 AC 67 ms
15,288 KB
testcase_13 AC 68 ms
15,144 KB
testcase_14 AC 68 ms
15,156 KB
testcase_15 AC 71 ms
15,276 KB
testcase_16 AC 71 ms
15,284 KB
testcase_17 AC 70 ms
15,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

A = gets.chomp
S = gets.chomp

a_array = A.chars
s_array = S.chars

output = ""
s_array.each_with_index do |s, i|
  if /\d/.match(s)
    output << a_array[s_array[i].to_i]
  else
    output << s
  end
end

puts output
0