結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-14 10:30:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 393 bytes |
| コンパイル時間 | 597 ms |
| コンパイル使用メモリ | 70,188 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-14 17:00:30 |
| 合計ジャッジ時間 | 1,076 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
using namespace std;
void solve(int a) {
a++;
string s;
while (a > 1) {
s += a & 1 ? "R" : "L";
a >>= 1;
}
reverse(s.begin(), s.end());
cout << s << endl;
}
int main() {
int m, a;
cin >> m;
for (int i = 0; i < m; i++) {
cin >> a;
solve(a);
}
return 0;
}