結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
nobuta05
|
| 提出日時 | 2016-08-23 19:08:21 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 667 bytes |
| コンパイル時間 | 20,071 ms |
| コンパイル使用メモリ | 381,184 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 00:36:01 |
| 合計ジャッジ時間 | 14,938 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
fn main() {
let mut num = String::new();
std::io::stdin().read_line(&mut num).ok().expect("ERROR");
let num: usize = num.trim().parse().ok().expect("ERROR");
for _ in 0..num {
let mut n = String::new();
std::io::stdin().read_line(&mut n).ok().expect("ERROR");
let mut n: usize = n.trim().parse().ok().expect("ERROR");
let mut res = String::new();
while n > 0 {
if n % 2 == 0 {
res = format!("{}{}", "R", res);
}
else {
res = format!("{}{}", "L", res);
}
n = (n-1) >> 1;
}
println!("{}", res);
}
}
nobuta05