結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2020-04-28 16:55:32 |
言語 | C++17 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 1,896 ms |
使用メモリ | 4,904 KB |
最終ジャッジ日時 | 2022-12-30 01:20:06 |
合計ジャッジ時間 | 2,448 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,900 KB |
testcase_01 | AC | 8 ms
4,904 KB |
testcase_02 | AC | 8 ms
4,904 KB |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ int q; scanf("%d",&q); rep(_,q){ int x; cin>>x; x++; string s; for(;x!=1;x>>=1) s+=((x&1)==0?'L':'R'); reverse(s.begin(),s.end()); cout<<s<<'\n'; } return 0; }