結果

問題 No.392 2分木をたどれ
ユーザー togari_takamototogari_takamoto
提出日時 2016-07-12 06:16:24
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 1,738 ms
コンパイル使用メモリ 145,052 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-04 17:00:45
合計ジャッジ時間 1,463 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 7 ms
4,376 KB
testcase_02 AC 8 ms
4,380 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