結果
| 問題 | No.392 2分木をたどれ |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-04-18 17:31:10 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 396 ms |
| コンパイル使用メモリ | 93,784 KB |
| 実行使用メモリ | 9,068 KB |
| 最終ジャッジ日時 | 2026-07-09 17:38:30 |
| 合計ジャッジ時間 | 1,151 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
#include<iostream>
#include<cstdio>
#include<stack>
using namespace std;
int main()
{
int m;scanf("%d",&m);
int x;stack<char>ans;
for(int i=1;i<=m;++i)
{
scanf("%d",&x);
while(x>2)
{
if(x%2==0)ans.push('R');
else ans.push('L');
--x;x/=2;
cout<<x<<endl;
}
if(x==1)ans.push('L');
else ans.push('R');
while(!ans.empty())
{
cout<<ans.top();
ans.pop();
}
cout<<endl;
}
return 0;
}
vjudge1