結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2019-09-15 09:46:10 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 446 bytes |
コンパイル時間 | 1,420 ms |
使用メモリ | 3,496 KB |
最終ジャッジ日時 | 2023-02-09 21:58:12 |
合計ジャッジ時間 | 2,177 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
3,452 KB |
testcase_01 | AC | 10 ms
3,496 KB |
testcase_02 | AC | 10 ms
3,376 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int m; cin>>m; for (int i=0; i<m; i++) { int a; cin>>a; vector<char> route; while (a > 0) { if (a % 2 == 0) { route.push_back('R'); a = (a - 2) / 2; } else { route.push_back('L'); a = (a - 1) / 2; } } reverse(route.begin(), route.end()); for (char c: route) { cout<<c; } cout<<endl; } }