結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
ふーらくたる
|
| 提出日時 | 2016-07-12 00:58:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 654 bytes |
| コンパイル時間 | 707 ms |
| コンパイル使用メモリ | 70,000 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 14:09:42 |
| 合計ジャッジ時間 | 1,155 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include <iostream>
#include <queue>
#include <utility>
using namespace std;
typedef pair<int, string> P;
int m;
string paths[5000];
int main() {
cin >> m;
int id = 0;
queue<P> que;
que.push(P(0, paths[0]));
paths[0] = "";
while (!que.empty()) {
P node = que.front(); que.pop();
if (id + 1 > 4094) continue;
que.push(P(++id, node.second + "L"));
paths[id] = node.second + "L";
que.push(P(++id, node.second + "R"));
paths[id] = node.second + "R";
}
for (int i = 0; i < m; i++) {
int a;
cin >> a;
cout << paths[a] << endl;
}
return 0;
}
ふーらくたる