結果
問題 | No.392 2分木をたどれ |
ユーザー | sawfish |
提出日時 | 2022-10-24 01:41:49 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 474 bytes |
コンパイル時間 | 585 ms |
コンパイル使用メモリ | 74,672 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-15 08:43:33 |
合計ジャッジ時間 | 1,077 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 8 ms
4,380 KB |
testcase_02 | AC | 9 ms
4,380 KB |
ソースコード
#include <iostream> #include <algorithm> #include <map> using namespace std; using LL = long long; using ULL = unsigned long long; int main() { int m; cin >> m; map<int, string> map; int A; for (int i = 0; i < m; i++) { cin >> A; string r; while (A) { if (A % 2 == 0) r += "R"; else r += "L"; A = (A - 1) / 2; } reverse(r.begin(), r.end()); cout << r << endl; } }