結果

問題 No.392 2分木をたどれ
ユーザー ooaiu
提出日時 2024-11-29 12:32:06
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 3,191 ms
コンパイル使用メモリ 245,512 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-29 12:32:11
合計ジャッジ時間 3,875 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef LOCAL
#include <bits/stdc++.h>

using namespace std;

#define debug(...) (void(0))
#else
#include "algo/debug.h"
#endif

void solve() {
    int N; cin >> N;

    while(N--) {
        int a; cin >> a;
        a++;
        string ans{};
        while(a > 1) {
            if(a & 1) {
                ans += 'R';
            }else {
                ans += 'L';
            }
            a >>= 1;
        }
        reverse(ans.begin(), ans.end());
        cout << ans << endl;
    }
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int tt = 1;
    // std::cin >> tt;
    while(tt--) {
        solve();
    }
}
0