結果
| 問題 |
No.566 だいたい完全二分木
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-18 18:11:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 306 bytes |
| コンパイル時間 | 2,124 ms |
| コンパイル使用メモリ | 191,708 KB |
| 最終ジャッジ日時 | 2025-01-07 14:12:32 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void dfs(int l,int r) {
int m=(l+r)/2;
cout<<m<<' ';
if (l==m) return;
dfs(l,m-1);
dfs(m+1,r);
}
int main() {
int k;
cin>>k;
int n=(1<<k)-1;
dfs(2,n);
cout<<1<<' ';
cout<<endl;
return 0;
}