結果

問題 No.392 2分木をたどれ
ユーザー tonyu0tonyu0
提出日時 2020-05-17 18:58:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 927 ms
コンパイル使用メモリ 96,732 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 11:08:02
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
  int m, c;
  cin >> m;
  while (m--)
  {
    cin >> c;
    string ans = "";
    while (c)
    {
      ans.push_back((c & 1 ? 'L' : 'R'));
      c = (c - 1) >> 1;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
  }

  return 0;
}
0