結果

問題 No.392 2分木をたどれ
ユーザー latte0119latte0119
提出日時 2016-07-16 15:38:29
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 737 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 62,800 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-23 13:45:07
合計ジャッジ時間 917 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;

#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;


signed main(){
    int n;cin>>n;
    while(n--){
        int a;
        cin>>a;
        vint lis;
        while(a){
            lis.pb(a);
            a=(a-1)/2;
        }
        reverse(all(lis));
        int cur=0;
        for(auto u:lis){
            if(cur*2+1==u){
                cout<<"R";
            }
            else{
                cout<<"L";
            }
            cur=u;
        }
        cout<<endl;
    }
    return 0;
}
0