結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2017-03-26 18:32:54 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 1,416 ms |
コンパイル使用メモリ | 159,364 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 06:31:47 |
合計ジャッジ時間 | 1,908 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define INF 2000000000#define MOD 1000000007typedef 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;}}