結果

問題 No.392 2分木をたどれ
ユーザー vjudge1
提出日時 2025-04-20 16:24:32
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 2,972 ms
コンパイル使用メモリ 275,532 KB
実行使用メモリ 7,840 KB
最終ジャッジ日時 2025-04-20 16:24:36
合計ジャッジ時間 3,497 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int m;
	cin>>m;
	while(m--)
	{
		int x;
		cin>>x;
		string s;
		while(x!=0)
		{
			int fa=(x-1)/2;
			if(fa*2+1==x) s+='L';
			else s+='R';
			x=fa;	
		}	
		reverse(s.begin(),s.end());
		cout<<s<<endl;
	} 
	return 0;
}
0