結果

問題 No.392 2分木をたどれ
ユーザー neko_the_shadowneko_the_shadow
提出日時 2016-11-28 01:02:17
言語 Scheme
(Gauche-0.9.11-p1)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 24 ms
使用メモリ 12,928 KB
最終ジャッジ日時 2023-01-04 09:50:35
合計ジャッジ時間 795 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
11,184 KB
testcase_01 AC 24 ms
12,928 KB
testcase_02 AC 24 ms
12,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve n)
  (let loop ((x n) (ls '()))
    (if (zero? x)
      (string-join ls "")
      (loop (quotient (- x 1) 2)
            (cons (if (odd? x) "L" "R") ls)))))

(define (MAIN)
  (let loop ((n (string->number (read-line))) (ls '()))
    (if (zero? n)
      (string-join (reverse ls) "\n")
      (loop (- n 1) 
            (cons (solve (string->number (read-line))) ls)))))


(print (MAIN))
0