結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2018-07-04 13:44:34 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 419 ms |
使用メモリ | 4,904 KB |
最終ジャッジ日時 | 2023-02-01 03:14:27 |
合計ジャッジ時間 | 1,137 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,904 KB |
testcase_01 | AC | 9 ms
4,900 KB |
testcase_02 | AC | 9 ms
4,904 KB |
ソースコード
#include <iostream> #include <algorithm> using namespace std; using ll = long long; int bitget(int a){ int ans = 0; while (a > 0){ a /= 2; ans++; } return ans; } int main(){ int n; cin >> n; int a[10000]; for (int i = 0; i < n; i++){ cin >> a[i]; a[i]++; } for (int i = 0; i < n; i++){ for (int j = bitget(a[i])-2; j >=0; j--){ if (a[i] & (1 << j))cout << "R"; else cout << "L"; } cout << endl; } }