結果

問題 No.392 2分木をたどれ
ユーザー CELICACELICA
提出日時 2020-11-12 23:17:02
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 1,679 ms
コンパイル使用メモリ 172,400 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-30 01:52:23
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ul = unsigned long;
using ull = unsigned long long;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int m;
	cin >> m;
	
	stringstream ss;
	for (int i = 0; i < m; ++i)
	{
		int a;
		cin >> a;

		stack<string> st;
		while (a)
		{
			st.push(a & 1 ? "L"s : "R"s);
            --a;
			a >>= 1;
		}

		while (!st.empty())
		{
			ss << st.top();
			st.pop();
		}
		ss << "\n";
	}

	cout << ss.str();

	return 0;
}
0