結果
問題 |
No.392 2分木をたどれ
|
ユーザー |
![]() |
提出日時 | 2025-04-18 16:08:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 3,252 ms |
コンパイル使用メモリ | 275,988 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-04-18 16:08:15 |
合計ジャッジ時間 | 3,021 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 3 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll T,n; int main(){ cin>>T; while(T--){ cin>>n; n++; vector<char>a; while(n!=1){ // cout<<n<<endl; if(n&1)a.push_back('R'); else a.push_back('L'); n>>=1; } for(ll i=0;i<a.size();i++)cout<<a[i]; cout<<endl; } } /* 1 2 L 10 2 3 R 11 3 4 LL 100 4 5 LR 101 5 6 RL 110 6 7 RR 111 7 8 LLL 1000 8 9 LLR 1001 ... 21 22 LRRL 10110 */