結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-07-12 00:10:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 373 bytes |
| コンパイル時間 | 490 ms |
| コンパイル使用メモリ | 55,468 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 14:06:41 |
| 合計ジャッジ時間 | 753 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main()
{
int m,a;
cin >> m;
for (int i = 0; i < m; i++) {
string s;
cin >> a;
while (a) {
if (!((a - 1) % 2)) {
s.insert(s.begin(), 'L');
a = (a - 1) / 2;
}
else if (!((a - 2) % 2)) {
s.insert(s.begin(), 'R');
a = (a - 2) / 2;
}
}
cout << s << endl;
}
return 0;
}
kurenai3110