結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2016-07-12 00:31:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 1,090 ms |
コンパイル使用メモリ | 159,064 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 14:08:07 |
合計ジャッジ時間 | 1,442 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include<bits/stdc++.h> using namespace std; void solve(){ int a; cin >> a; string str; while(a > 0){ if(a % 2 == 0){ a = (a - 2) / 2; str += "R"; }else{ a = (a - 1) / 2; str += "L"; } } reverse(str.begin(), str.end()); cout << str << endl; } int main(){ int m; cin >> m; for(int i = 0; i < m; i++){ solve(); } }