結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
dgd1724
|
| 提出日時 | 2016-11-08 19:33:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 685 bytes |
| コンパイル時間 | 1,100 ms |
| コンパイル使用メモリ | 162,604 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-25 05:18:36 |
| 合計ジャッジ時間 | 1,584 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include <bits/stdc++.h>
//const static double de_PI = 3.14159265358979323846;
//const static int de_MOD = 1000000007;
//const static int de_MAX = 999999999;
//const static int de_MIN = -999999999;
int main(void) {
//std::ifstream inf("123.txt"); std::cin.rdbuf(inf.rdbuf());
int m = 0;
std::cin >> m;
std::vector<std::string> A(m);
int num = 0;
for (int i = 0; i < m; i++) {
std::cin >> num;
while (num != 0) {
if (num % 2 == 0) {
A[i].push_back('R');
num = num / 2 - 1;
}
else {
A[i].push_back('L');
num = num / 2;
}
}
std::reverse(A[i].begin(), A[i].end());
}
for (int i = 0; i < m; i++) {
std::cout << A[i] << std::endl;
}
}
dgd1724