結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-10 18:58:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 594 bytes |
| コンパイル時間 | 1,803 ms |
| コンパイル使用メモリ | 169,624 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 18:07:07 |
| 合計ジャッジ時間 | 2,598 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, w;
map<int, int>dp;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
string ans = "";
while (n != 0) {
if (n & 1) {
n--;
n = n / 2;
ans += 'L';
}
else {
n -= 2;
n = n / 2;
ans += 'R';
}
}
reverse(ans.begin(), ans.end());
cout << ans << endl;
}
}