結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
ku_material_ro
|
| 提出日時 | 2016-09-26 00:34:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 469 bytes |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 59,380 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 14:22:19 |
| 合計ジャッジ時間 | 795 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){
int m;
int n;
string s;
cin >> m;
int a[4096];
for (int i = 0; i < m; i++){
cin >> a[i];
a[i] += 1;
}
for (int i = 0; i < m; i++){
while (1){
if (a[i] == 1){
cout << s << endl;
s = "";
break;
}
n = a[i] % 2;
if (n == 0){
s.insert(s.begin(), 'L');
}
else{
s.insert(s.begin(), 'R');
}
a[i] /= 2;
}
}
return 0;
}
ku_material_ro