結果

問題 No.104 国道
ユーザー Tsuneo YoshiokaTsuneo Yoshioka
提出日時 2014-12-16 23:23:27
言語 Ruby
(3.2.2)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 141 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 11,400 KB
実行使用メモリ 15,324 KB
最終ジャッジ日時 2023-09-02 15:23:21
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,276 KB
testcase_01 AC 81 ms
15,076 KB
testcase_02 AC 81 ms
15,108 KB
testcase_03 AC 83 ms
15,132 KB
testcase_04 AC 81 ms
15,124 KB
testcase_05 AC 82 ms
15,248 KB
testcase_06 AC 82 ms
15,144 KB
testcase_07 AC 83 ms
15,256 KB
testcase_08 AC 81 ms
15,112 KB
testcase_09 AC 82 ms
15,124 KB
testcase_10 AC 81 ms
15,324 KB
testcase_11 AC 82 ms
15,080 KB
testcase_12 AC 83 ms
15,292 KB
testcase_13 AC 83 ms
15,312 KB
testcase_14 AC 81 ms
15,252 KB
testcase_15 AC 82 ms
15,256 KB
testcase_16 AC 81 ms
15,084 KB
testcase_17 AC 80 ms
15,276 KB
testcase_18 AC 81 ms
15,148 KB
testcase_19 AC 81 ms
15,196 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: `*' after local variable or literal is interpreted as binary operator
Main.rb:4: warning: even though it seems like argument prefix
Syntax OK

ソースコード

diff #

cur = 1
(gets || "").chomp.each_char{|c|
    if c == 'L'
        cur = cur *2
    else
        cur = cur * 2 + 1
    end
}
puts cur
0