結果

問題 No.392 2分木をたどれ
ユーザー nak3nak3
提出日時 2017-03-26 18:32:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 145,292 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-20 11:05:18
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 10 ms
4,376 KB
testcase_02 AC 9 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;


int main()
{
	int m;
	cin >> m;

	for (int i = 0; i < m; i++) {
		int a;
		cin >> a;
		string ret = "";
		while (true) {
			if (a<=0) {
				break;
			}
			if (a%2==0) {
				ret = "R" + ret;
				a = a/2-1;
			} else {
				ret = "L" + ret;
				a /= 2;
			}
		}
		cout << ret << endl;
	}
}
0