結果
問題 | No.392 2分木をたどれ |
ユーザー |
![]() |
提出日時 | 2016-07-15 21:26:54 |
言語 | C++11 (gcc 8.5.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 772 bytes |
コンパイル時間 | 549 ms |
使用メモリ | 3,528 KB |
最終ジャッジ日時 | 2022-12-11 01:12:29 |
合計ジャッジ時間 | 1,364 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
3,528 KB |
testcase_01 | AC | 8 ms
3,500 KB |
testcase_02 | AC | 7 ms
3,476 KB |
ソースコード
/* -*- coding: utf-8 -*- * * 392.cc: No.392 2分木をたどれ - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int tn; cin >> tn; while (tn--) { int n; cin >> n; stack<char> s; while (n > 0) { s.push((n & 1) ? 'L' : 'R'); n = (n - 1) / 2; } while (! s.empty()) putchar(s.top()), s.pop(); putchar('\n'); } return 0; }