結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
kapo
|
| 提出日時 | 2016-07-12 17:21:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 602 bytes |
| コンパイル時間 | 566 ms |
| コンパイル使用メモリ | 65,392 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 14:41:53 |
| 合計ジャッジ時間 | 979 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <sstream>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
string solve()
{
string str;
int A;
cin >> A;
while(A > 0) {
string str2;
if(A%2) {
str2 = str;
str = "L";
str += str2;
A = A/2;
} else {
str2 = str;
str = "R";
str += str2;
A = A/2 -1;
}
}
return str;
}
int main()
{
int M;
cin >> M;
rep(i,0,M) {
string str = solve();
cout << str << endl;
}
return 0;
}
kapo