結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-06 22:15:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 710 bytes |
| コンパイル時間 | 557 ms |
| コンパイル使用メモリ | 78,972 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-06 03:49:51 |
| 合計ジャッジ時間 | 981 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
int main()
{
int m;
cin >> m;
vector<string> v;
for (int i = 0; i < m; i++) {
int a;
string s = "";
cin >> a;
while (a != 0) {
if (a % 2 == 0) {
s += "R";
a /= 2;
a--;
}else{
s += "L";
a /= 2;
}
}
v.push_back(s);
}
for (int i = 0; i < v.size(); i++) {
for (int j = v[i].size() - 1; j >= 0; j--) {
cout << v[i][j];
}
cout << endl;
}
return 0;
}