結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2020-11-17 07:57:03 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 504 ms |
使用メモリ | 6,280 KB |
最終ジャッジ日時 | 2023-02-23 02:34:22 |
合計ジャッジ時間 | 1,362 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,272 KB |
testcase_01 | AC | 8 ms
6,280 KB |
testcase_02 | AC | 7 ms
6,276 KB |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int m; cin >> m; for (int i = 0; i < m; i++){ int A; cin >> A; string ans; while (A > 0){ if (A % 2 == 1){ ans += 'L'; } else { ans += 'R'; } A = (A - 1) / 2; } reverse(ans.begin(), ans.end()); cout << ans << endl; } }