結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2020-06-02 21:20:37 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 470 bytes |
コンパイル時間 | 1,304 ms |
コンパイル使用メモリ | 175,608 KB |
実行使用メモリ | 9,088 KB |
最終ジャッジ日時 | 2024-11-24 13:36:16 |
合計ジャッジ時間 | 1,719 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
importControl.MonadasMmain::IO()main = dom <- readLna <- M.replicateM m readLnputStr $ solve asolve::Int->Stringsolve a = unlines $ reverse $ solve' a []solve'::Int->String->Stringsolve' t ss = foldl (\acc x -> solve'' x "" : acc) ss tsolve''::Int->String->Stringsolve'' 0 x = xsolve'' n x| n `mod` 2 == 0 = solve'' ((n `div` 2) - 1) ( 'R' : x )| otherwise = solve'' ((n - 1) `div` 2) ( 'L' : x )