結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

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(); i >= 0; i--)
			cout << ans[i];
		cout << endl;
	}
	return 0;


}


0