結果
問題 | No.392 2分木をたどれ |
ユーザー |
|
提出日時 | 2018-05-05 09:06:11 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 548 bytes |
コンパイル時間 | 503 ms |
使用メモリ | 4,904 KB |
最終ジャッジ日時 | 2023-01-27 14:58:32 |
合計ジャッジ時間 | 1,355 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,904 KB |
testcase_01 | AC | 10 ms
4,904 KB |
testcase_02 | AC | 10 ms
4,900 KB |
ソースコード
#include<iostream> #include<vector> using namespace std; int main(){ int m; cin >> m; while(m-- > 0){ int x; cin >> x; vector<char> res; while(x != 0){ if(x % 2 == 0){ res.push_back('R'); }else{ res.push_back('L'); } x--; x /= 2; } for(vector<char>::reverse_iterator it = res.rbegin(); it != res.rend(); it++){ cout << (*it); } cout << endl; } return 0; }