結果

問題 No.104 国道
ユーザー gemmaro
提出日時 2020-04-06 11:04:25
言語 Ruby
(3.4.1)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-07-05 22:11:12
合計ジャッジ時間 2,171 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

class Array # rubocop:todo Style/Documentation
  def solve
    if empty?
      1
    else
      f = pop
      solve * 2 + f
    end
  end
end

S = gets.chomp.chars.map { |i| i == 'R' ? 1 : 0 }

RESULT = S.solve

puts RESULT
0