結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2016-07-16 15:39:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 737 bytes |
| コンパイル時間 | 599 ms |
| コンパイル使用メモリ | 62,848 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 13:46:35 |
| 合計ジャッジ時間 | 993 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#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<<"L";
}
else{
cout<<"R";
}
cur=u;
}
cout<<endl;
}
return 0;
}
latte0119