結果

問題 No.392 2分木をたどれ
ユーザー togari_takamototogari_takamoto
提出日時 2016-07-12 06:16:24
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 1,187 ms
使用メモリ 3,584 KB
最終ジャッジ日時 2022-12-08 16:48:44
合計ジャッジ時間 1,930 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,536 KB
testcase_01 AC 7 ms
3,404 KB
testcase_02 AC 7 ms
3,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(ll i = 0; i < (n); ++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	ll m; cin >> m;
	REP(i, m) {
		ll a; cin >> a;
		string s;
		for (; a != 0; a = (a - 1) / 2) s += a % 2 == 0 ? "R" : "L";
		reverse(ALL(s));
		cout << s << endl;
	}
	return 0;
}
0