結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2020-01-08 17:55:40 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 485 bytes |
コンパイル時間 | 559 ms |
使用メモリ | 6,952 KB |
最終ジャッジ日時 | 2022-12-28 10:50:53 |
合計ジャッジ時間 | 1,262 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,904 KB |
testcase_01 | AC | 9 ms
6,952 KB |
testcase_02 | AC | 9 ms
4,904 KB |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n;cin>>n; vector<char> a; for(int i = 0; n > i; i++){ int z;cin>>z;z++; while(z/2){ if(z%2)a.push_back('R'); else a.push_back('L'); z/=2; } reverse(a.begin(),a.end()); for(int i = 0; a.size() > i; i++){ cout << a[i]; } cout << endl; a.clear(); } }