結果

問題 No.392 2分木をたどれ
ユーザー togari_takamoto
提出日時 2016-07-12 06:16:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 1,332 ms
コンパイル使用メモリ 161,224 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-14 14:11:53
合計ジャッジ時間 1,741 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

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