結果

問題 No.392 2分木をたどれ
ユーザー neko_the_shadowneko_the_shadow
提出日時 2016-11-28 01:00:24
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 16,108 KB
最終ジャッジ日時 2023-08-18 08:38:29
合計ジャッジ時間 690 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve n)
  (let loop ((x n) (ls '()))
    (if (zero? x)
      (string-join (reverse 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