結果

問題 No.104 国道
ユーザー go_boardwalkgo_boardwalk
提出日時 2017-04-06 12:51:34
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 225 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 11,892 KB
最終ジャッジ日時 2023-09-22 23:01:11
合計ジャッジ時間 1,276 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,860 KB
testcase_01 AC 16 ms
11,652 KB
testcase_02 AC 17 ms
11,656 KB
testcase_03 AC 17 ms
11,760 KB
testcase_04 AC 16 ms
11,812 KB
testcase_05 AC 19 ms
11,756 KB
testcase_06 AC 19 ms
11,828 KB
testcase_07 AC 19 ms
11,744 KB
testcase_08 AC 17 ms
11,772 KB
testcase_09 AC 17 ms
11,628 KB
testcase_10 AC 17 ms
11,660 KB
testcase_11 AC 17 ms
11,788 KB
testcase_12 AC 17 ms
11,624 KB
testcase_13 AC 16 ms
11,636 KB
testcase_14 AC 17 ms
11,680 KB
testcase_15 AC 17 ms
11,632 KB
testcase_16 AC 17 ms
11,892 KB
testcase_17 AC 17 ms
11,656 KB
testcase_18 AC 17 ms
11,632 KB
testcase_19 AC 17 ms
11,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define root (string->list (read-line)))

(print (let loop ((r root) (ans 1))
  (cond ((null? r) ans)
        ((equal? #\L (car r)) (loop (cdr r) (* ans 2)))
        ((equal? #\R (car r)) (loop (cdr r) (+ (* ans 2) 1))))))


0