結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2022-10-24 01:41:49 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 474 bytes |
コンパイル時間 | 509 ms |
使用メモリ | 3,560 KB |
最終ジャッジ日時 | 2023-02-03 06:22:55 |
合計ジャッジ時間 | 1,218 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
3,428 KB |
testcase_01 | AC | 8 ms
3,560 KB |
testcase_02 | AC | 8 ms
3,424 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; } }