結果

問題 No.392 2分木をたどれ
ユーザー LeonardoneLeonardone
提出日時 2019-09-04 04:48:38
言語 Haskell
(9.8.2)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 156,736 KB
実行使用メモリ 11,308 KB
最終ジャッジ日時 2023-08-26 20:51:37
合計ジャッジ時間 1,318 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,196 KB
testcase_01 AC 22 ms
11,256 KB
testcase_02 AC 22 ms
11,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

--リジャッジで落ちたコードのputStrLnをputStrに変更

-- Try yukicoder
-- author: Leonardone @ NEETSDKASU


main = putStr . unlines . solve . map read . tail . lines =<< getContents

solve x = map (foo "") x where
    foo s 0 = s
    foo s x
        | z == 0    = foo ('R' : s) (y - 1)
        | otherwise = foo ('L' : s) y
        where
            (y, z) = divMod x 2
0