結果

問題 No.104 国道
ユーザー fshutofshuto
提出日時 2019-04-30 16:02:51
言語 Ruby
(3.2.2)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 106 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 11,348 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-08-28 19:14:42
合計ジャッジ時間 2,803 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,096 KB
testcase_01 AC 76 ms
15,212 KB
testcase_02 AC 76 ms
15,120 KB
testcase_03 AC 77 ms
15,140 KB
testcase_04 AC 77 ms
15,108 KB
testcase_05 AC 81 ms
15,164 KB
testcase_06 AC 77 ms
15,092 KB
testcase_07 AC 77 ms
15,148 KB
testcase_08 AC 76 ms
15,260 KB
testcase_09 AC 77 ms
15,128 KB
testcase_10 AC 76 ms
15,148 KB
testcase_11 AC 77 ms
15,112 KB
testcase_12 AC 77 ms
15,092 KB
testcase_13 AC 77 ms
15,028 KB
testcase_14 AC 77 ms
15,160 KB
testcase_15 AC 77 ms
15,288 KB
testcase_16 AC 77 ms
15,168 KB
testcase_17 AC 77 ms
15,128 KB
testcase_18 AC 76 ms
15,328 KB
testcase_19 AC 77 ms
15,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: `*' after local variable or literal is interpreted as binary operator
Main.rb:6: warning: even though it seems like argument prefix
Main.rb:6: warning: `+' after local variable or literal is interpreted as binary operator
Main.rb:6: warning: even though it seems like unary operator
Syntax OK

ソースコード

diff #

ans = 1
gets.chomp.chars.each do |x|
  if x=='L'
    ans *=2
  else
    ans = ans *2 +1
  end
end
puts ans
0