結果
問題 |
No.392 2分木をたどれ
|
ユーザー |
![]() |
提出日時 | 2025-04-17 23:18:29 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,794 bytes |
コンパイル時間 | 2,765 ms |
コンパイル使用メモリ | 275,156 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-04-17 23:18:34 |
合計ジャッジ時間 | 3,519 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include<bits/stdc++.h> using namespace std; inline int read(){ int x=0; char c=getchar(); while(c<'0' || c>'9'){ c=getchar(); } while(c>='0' && c<='9'){ x=(x<<1)+(x<<3)+(c^48); c=getchar(); } return x; } int T; void solve(){ int n; n=read(); n++; string s; while(n>1){ if(n&1){ s+="R"; }else{ s+="L"; } n>>=1; } reverse(s.begin(),s.end()); cout<<s<<"\n"; } signed main(){ // freopen("","r",stdin); // freopen("","w",stdout); T=read(); while(T--){ solve(); } return 0; } /*?? ?????? ??????????????????????? ???????????????????? ???????????5???????????????????????????????????????????????????????????????????????????????????????????????24????????????????????????????????????????????????????????????????????? ???????????????????? ???????????????????????????????????????????????????????????????????????????????????????????...????????????? ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...???????????????????????????????? ?????????????? ???????????? ????????????? ????????????? ????????? ??? ? ?? ? ??????? ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????????????????????????? ????????????????????? ???????????????????? ????????????? ???????????????? ???????????????????????? ????????????????????????? ?????? ?????????????? ???????????? ??????????????????? ???????????? ?????? ????? ??????????? ?????????????? ????? ????? ????? ?????? ??????????????? ?????????? ?????????????? ???????????? ????*/