結果

問題 No.392 2分木をたどれ
ユーザー tonyu0tonyu0
提出日時 2020-05-17 18:58:02
言語 C++17
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 1,038 ms
使用メモリ 3,444 KB
最終ジャッジ日時 2022-11-24 14:16:52
合計ジャッジ時間 1,581 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,372 KB
testcase_01 AC 6 ms
3,444 KB
testcase_02 AC 7 ms
3,376 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