結果

問題 No.392 2分木をたどれ
ユーザー sggkshiosggkshio
提出日時 2016-12-23 12:40:20
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 854 ms
コンパイル使用メモリ 78,188 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 06:05:49
合計ジャッジ時間 1,127 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>



using namespace std;


int main() {

	int a; cin >> a;
	while (a--) {
		int d;
		cin >> d;
		d++;
		vector<char>ans;
		while (d!=1) {
			
			if (d % 2 == 0)ans.push_back('L');
			else ans.push_back('R');
			
		//	if (d % 2 == 0)cout << 'L';
		//	else cout << 'R';
			d /= 2;
		}
		for (int i = ans.size()-1; i >= 0; i--)
			cout << ans[i];
		cout << endl;
	}
	return 0;


}


0