結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-21 12:02:03 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 2,652 ms |
| コンパイル使用メモリ | 96,204 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 10:28:47 |
| 合計ジャッジ時間 | 3,026 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
import sequtils
template times*(n:int,body) = (for _ in 0..<n: body)
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
while true:
let k = getchar_unlocked()
if k < '0': break
result = 10 * result + k.ord - '0'.ord
proc path(n:int) : string =
if n == 0 : return "??"
if n == 1 : return "L"
if n == 2 : return "R"
if n mod 2 == 1: return path(n div 2) & "L"
return path((n-1) div 2) & "R"
const pathes = toSeq(0..4096).mapIt(it.path)
let m = scan()
m.times: echo pathes[scan()]