結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2019-09-15 09:46:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 446 bytes |
コンパイル時間 | 1,653 ms |
コンパイル使用メモリ | 170,176 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 22:40:06 |
合計ジャッジ時間 | 1,920 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#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;}}