結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2016-12-23 12:40:20 |
言語 | C++11 (gcc 8.5.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 508 ms |
使用メモリ | 4,904 KB |
最終ジャッジ日時 | 2023-01-07 15:31:17 |
合計ジャッジ時間 | 1,260 ms |
ジャッジサーバーID (参考情報) |
judge16 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,904 KB |
testcase_01 | AC | 10 ms
4,904 KB |
testcase_02 | AC | 10 ms
4,904 KB |
ソースコード
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { int a; cin >> a; while (a--) { int d; cin >> d; d++; vector<char>ans; while (d!=1) { if (d % 2 == 0)ans.push_back('L'); else ans.push_back('R'); // if (d % 2 == 0)cout << 'L'; // else cout << 'R'; d /= 2; } for (int i = ans.size()-1; i >= 0; i--) cout << ans[i]; cout << endl; } return 0; }