結果

問題 No.566 だいたい完全二分木
ユーザー アロンアルファ
提出日時 2017-10-03 15:48:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 58,988 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-16 05:42:55
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

void set(int x)
{
	int m = (x+3*x)/2-1;
	int l = m-1,r = m+1;
	
	std::cout << m << ' ';
	if(l > 0) for(int i = 0;i < 3*x && l > 0;i++) std::cout << l-- << ' ';
	for(int max = pow(2,x);r < max;r++) std::cout << r << ' ';
	std::cout << std::endl;
}

int main()
{
	int K;

	std::cin >> K;
	set(K);

	return 0;
}
0