結果

問題 No.392 2分木をたどれ
ユーザー not_522not_522
提出日時 2016-12-17 00:44:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 1,686 ms
コンパイル使用メモリ 165,872 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-20 18:26:17
合計ジャッジ時間 1,641 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    string res;
    for (++a; a != 1; a /= 2) {
      res += a % 2 ? "R" : "L";
    }
    reverse(res.begin(), res.end());
    cout << res << endl;
  }
}
0