結果

問題 No.392 2分木をたどれ
ユーザー Mcpu3Mcpu3
提出日時 2018-12-06 18:01:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 1,506 ms
コンパイル使用メモリ 66,396 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-12 02:49:39
合計ジャッジ時間 1,066 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int m, a;
	string ans;
	cin >> m;
	for (int i = 0; i < m; ++i) {
		cin >> a;
		ans = "";
		do {
			if (a % 2) ans += 'L';
			else {
				ans += 'R';
				--a;
			}
		} while (a /= 2);
		reverse(ans.begin(), ans.end());
		cout << ans << endl;
	}
}
0