結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2017-03-26 18:32:54 |
言語 | C++11 (gcc 8.5.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 1,096 ms |
使用メモリ | 3,528 KB |
最終ジャッジ日時 | 2023-02-08 21:01:36 |
合計ジャッジ時間 | 1,825 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
3,336 KB |
testcase_01 | AC | 9 ms
3,528 KB |
testcase_02 | AC | 9 ms
3,472 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #define INF 2000000000 #define MOD 1000000007 typedef long long ll; typedef pair<int, int> P; int main() { int m; cin >> m; for (int i = 0; i < m; i++) { int a; cin >> a; string ret = ""; while (true) { if (a<=0) { break; } if (a%2==0) { ret = "R" + ret; a = a/2-1; } else { ret = "L" + ret; a /= 2; } } cout << ret << endl; } }