結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2020-07-01 16:42:07 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 705 bytes |
コンパイル時間 | 1,505 ms |
使用メモリ | 9,684 KB |
最終ジャッジ日時 | 2023-02-26 09:58:10 |
合計ジャッジ時間 | 2,572 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
9,684 KB |
testcase_01 | AC | 9 ms
9,636 KB |
testcase_02 | AC | 9 ms
7,720 KB |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair<int,int> ; using pll = pair<long long,long long>; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; int main(){ int m; cin >> m; while(m--){ vector<char> ans; int a; cin >> a; ++ a; while(a > 1){ int before = a; a /= 2; if(2*a==before) ans.push_back('L'); else ans.push_back('R'); } rep(i,ans.size()) cout << ans[ans.size()-1-i]; cout << endl; } return 0; }